-
Notifications
You must be signed in to change notification settings - Fork 1
Update README to include Mobile Money charges and style/linting guide #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughDocumentation-only update to Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client App
participant SDK as SDK
participant API as Paystack API
rect rgb(235,245,255)
note over C,API: Create Mobile Money charge
C->>SDK: Charges.create(mobile_money: {...})
SDK->>API: POST /charge (mobile_money payload)
API-->>SDK: charge pending + reference
SDK-->>C: charge response (pending)
end
rect rgb(240,255,240)
note over C,API: Submit OTP (if required)
C->>SDK: Charges.mobile_money.submit_otp(reference, otp)
SDK->>API: POST /charge/submit_otp
API-->>SDK: status update (success/failure/pending)
SDK-->>C: OTP submission result
end
rect rgb(255,250,235)
note over C,API: Verify charge
C->>SDK: Charges.verify(reference)
SDK->>API: GET /charge/{reference}
API-->>SDK: final status/details
SDK-->>C: verification response
end
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
README.md (3)
207-207
: Fix markdownlint MD034 (bare URL).Convert the bare URL to a proper Markdown link.
Apply this diff:
-Initiate Mobile Money payments using the Charges API. This channel is available to businesses in Ghana, Kenya, and Côte d'Ivoire. See the Paystack guide: https://paystack.com/docs/payments/payment-channels/#mobile-money +Initiate Mobile Money payments using the Charges API. This channel is available to businesses in Ghana, Kenya, and Côte d'Ivoire. See the Paystack guide: [Mobile Money](https://paystack.com/docs/payments/payment-channels/#mobile-money).
259-262
: Clarify which reference to verify (transaction vs charge).Depending on the flow,
transactions.verify
typically expects a transaction reference. Consider adding a note clarifying that the same reference passed when creating the charge becomes the transaction reference after authorization; otherwise rely on webhooks.Apply this diff:
-For offline flows, listen for `charge.success` webhooks. You may also verify after the provider timeout window: +For offline flows, listen for `charge.success` webhooks. You may also verify after the provider timeout window. Note: `transactions.verify` expects a transaction reference (often the same `reference` you supplied when creating the charge once it converts to a transaction):
711-721
: Add a link to StandardRB and optional install note.Tiny docs polish: link to the tool and hint how to add it.
Apply this diff:
-This project uses StandardRB for code style and linting. +This project uses [StandardRB](https://github.com/standardrb/standard) for code style and linting. + +Add to your Gemfile (if not already present): + +```ruby +gem "standard" +```
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md
(4 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
README.md
207-207: Bare URL used
(MD034, no-bare-urls)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (6)
README.md (6)
17-17
: TOC entry looks good.Anchor matches the new section header.
34-34
: TOC updated correctly for Style/Linting.Header id aligns with the section below.
205-213
: Great addition: Mobile Money quickstart.Clear, actionable examples.
705-705
: Good cross-link to official Mobile Money docs.Helpful for deeper dives.
247-253
: Confirmed — method exists and README example is valid.
Defined asdef submit_otp(payload)
in lib/paystack_sdk/resources/charges.rb; passing a keyword-style hash (reference:, otp:
) is accepted and specs callcharges.submit_otp(otp_payload)
.
226-238
: Verified — Paystack statuses and display_text are correctBoth "pay_offline" and "send_otp" are valid charge response statuses for Mobile Money flows and response.display_text is the documented field for user prompts; the README handling is correct.
… verification process; include StandardRB gem installation instructions for style and linting.
Summary by CodeRabbit