-
Notifications
You must be signed in to change notification settings - Fork 14
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
Payment Processor Migration #20
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Removes prior clunky gitignore workarounds for top level publishing. Files are output to dist folder
- Updates to Typescript - Updates to use new Payment Processor API
Turns out the AbstractPaymentProcessor is backwards compatible so it doesn't need to be a major version bump
I'm going to check it out and update soon but a quick one @a11rew did you test it locally ? |
Yes @femakin. On v1.13 as well as v1.8. |
femakin
approved these changes
Aug 18, 2023
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.
Everything looks good to me. I will integrate and test locally as well
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Payment Providers are considered deprecated in Medusa. This PR updates this plugin to support new Payment Processor API.
This will be a minor version bump.
Changes
The plugin exports a service which is an instance of an
AbstractPaymentProcessor
. The internal class methods have changed but no user facing functionality is changed.The plugin now exports a
PluginOptions
interface for type annotations when configuring the plugin.Replaced previous Babel build process with TSC. Jest tests also rewritten in Typescript.
authorizePayment
.We previously tried to ensure the amount paid on Paystack matched the cart total before marking an order as paid. This was problematic because for a number of reasons: handling currencies is a lot more complex than just rounding up and asserting equality - currencies need to be considered, floating point arithmetic pitfalls handled and amounts evaluated without rounding up.
I consider getting that part right out of the scope of this project, users are responsible for ensuring the txRef they get from the plugin is sent to Paystack on the frontend along with the right amount.