Skip to content

Conversation

smorttey
Copy link
Contributor

@smorttey smorttey commented Sep 22, 2025

Summary by CodeRabbit

  • Documentation
    • Added Charges (Mobile Money) guide: create, OTP submission, timeout/webhook verification flows with Ruby examples.
    • Linked Mobile Money under Payment Channels in Advanced Guides and TOC.
    • Expanded Development docs with Style & Linting (StandardRB setup, Gemfile entry, lint/auto-fix commands, rake tasks, cache note).
    • Added Testing guidance with example response formats and error-type coverage.
    • Installation & Release subsection outlining rake install/release.
    • No public API or behavior changes.

Copy link

coderabbitai bot commented Sep 22, 2025

Walkthrough

Documentation-only update to README.md adding a Charges (Mobile Money) section with usage examples (create charge, submit OTP, verify), a TOC entry, API reference link, Development style/linting notes (StandardRB), expanded Testing guidance, and Installation/Release notes. No code or public API changes.

Changes

Cohort / File(s) Summary
Documentation: README updates
README.md
Added Charges (Mobile Money) usage workflow (create charge, submit OTP, verify) with Ruby examples; inserted TOC entry and Payment Channels link; added Development "Style and Linting" (StandardRB, Gemfile, lint/auto-fix commands, rake tasks, cache note); appended Testing section with response example and error-type validation; added Installation and Release instructions. No code or API 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
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit taps keys with a whisker-twitch grin,
New docs hop in: charges begin!
OTP bounces, verify we go,
Mobile money flowing in a tidy row.
Linted burrows, tests tucked tight—thump-thump: shipped just right. 🐇💸

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the primary change — README updates to add Mobile Money (Charges) documentation and a style/linting guide — and directly matches the raw_summary and PR objectives. It is concise, specific, and focused on the main documentation changes without extraneous details. This makes it clear to reviewers what the pull request contains.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e275f2 and 3574934.

📒 Files selected for processing (1)
  • README.md (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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 @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between f8dd978 and 1e275f2.

📒 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 as def submit_otp(payload) in lib/paystack_sdk/resources/charges.rb; passing a keyword-style hash (reference:, otp:) is accepted and specs call charges.submit_otp(otp_payload).


226-238: Verified — Paystack statuses and display_text are correct

Both "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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant