Skip to content

feat:add verify refund functionality#18

Merged
fireayehu merged 1 commit into
fireayehu:mainfrom
flavnat:feat/refund-verify
Apr 17, 2026
Merged

feat:add verify refund functionality#18
fireayehu merged 1 commit into
fireayehu:mainfrom
flavnat:feat/refund-verify

Conversation

@flavnat
Copy link
Copy Markdown
Contributor

@flavnat flavnat commented Apr 8, 2026

Description

This PR adds support for the verifyRefund functionality to the SDK, allowing users to verify the status of an initiated refund using its reference ID based directly on the official Chapa API documentation.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test coverage improvement

Changes Made

  • Added VerifyRefundOptions and VerifyRefundResponse interfaces for strong typing of requests and responses.
  • Implemented the verifyRefund tracking method in the Chapa class to call the /v1/refund/:ref_id/verify endpoint.
  • Introduced a validateVerifyRefundOptions schema using zod to validate the ref_id parameter.
  • Added automated unit tests covering the new verifyRefund implementation within test/refund.test.ts.

Testing

  • All existing tests pass
  • Added new tests for new functionality
  • Manual testing completed

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

The verifyRefund endpoint uses the GET method. The test properly mimics dynamic ref_id formatting passed into the URL directly rather than the query body compared to the initial refund flow.

@fireayehu fireayehu merged commit ece0c97 into fireayehu:main Apr 17, 2026
3 checks passed
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.

2 participants