Skip to content

Conversation

@tolu-paystack
Copy link
Contributor

Description

Addresses #212. Makes it such that if you don't pass a currency to PaystackProvider, your integration's default currency is used.

Also adds XOF as one of the supported currencies (Paystack is in beta in CIV)

Issue URL

#212

@just1and0 just1and0 requested a review from Copilot May 2, 2025 19:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the Paystack integration by removing the default currency from the PaystackProvider and adding XOF as a supported currency.

  • Updated generatePaystackParams to conditionally include the currency parameter
  • Expanded the Currency type to include XOF in development/types.ts
  • Removed the default 'NGN' currency in PaystackProvider and now conditionally includes the currency prop

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
development/utils.ts Conditionally includes currency in the generated parameters
development/types.ts Adds XOF as a supported currency
development/PaystackProvider.tsx Removes default currency and conditionally passes currency to the Paystack params
Comments suppressed due to low confidence (1)

development/PaystackProvider.tsx:20

  • Removing the default currency value changes the component's API; please ensure that integrations explicitly handle a fallback or default currency as intended.
currency,

@just1and0
Copy link
Owner

Hey @tolu-paystack 👋

Thanks for this thoughtful contribution! This change addresses an important usability concern—defaulting to NGN in the provider can unintentionally prioritize Nigerian merchants, requiring others to pass in an extra prop unnecessarily.

Your decision to remove the hardcoded currency aligns well with Paystack’s own default behavior (using the merchant’s integration currency), and improves the developer experience by ensuring consistency and reducing surprises across different regions.

I reviewed the code, and it follows the style and simplicity we aim for in this package—clean, focused, and purposeful. Great job keeping the changes minimal and scoped only to what was necessary.

A couple of suggestions before we merge:

  • It would be helpful to update the README or usage example if it currently implies that currency is optional.

Other than that, this is solid work! Thanks again for helping improve the project for the wider community 🌍🚀

@just1and0 just1and0 self-requested a review May 2, 2025 19:44
Copy link
Owner

@just1and0 just1and0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tolu-paystack, again, great job on the PR, just one last thing before we merge it in.

@tolu-paystack
Copy link
Contributor Author

Hey @just1and0 just seen your comment. Makes sense, I'll update the README now

@tolu-paystack
Copy link
Contributor Author

@just1and0 updated

Copy link
Owner

@just1and0 just1and0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@just1and0 just1and0 merged commit a0c01c8 into just1and0:main May 8, 2025
1 check passed
@just1and0
Copy link
Owner

@all-contributors add @tolu-paystack for code

@allcontributors
Copy link
Contributor

@just1and0

I've put up a pull request to add @tolu-paystack! 🎉

@github-actions
Copy link

🎉 This PR is included in version 5.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants