-
Notifications
You must be signed in to change notification settings - Fork 15
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
medusa paystack breaks in medusa v2 no default service exported #155
Comments
Hi @justinelut 👋 |
Unfortunately i am a frontend developer and i dont know how to develop npm packages, i was developing a nextjs application for an ecommerce application based in kenya, i was using your paystack module and medusa, i have completed the frontend and deployed the backend but am unable to add payment, |
Started working on V2 support in #v2-support |
Hey, I am also in a similar position as @justinelut Just wanted to ask, how long do you think updating the plugin to V2 will take? Sorry if its a bother, just unsure on the process |
A beta version of this plugin with support for Medusa V2 has been published under the You are welcome to try it out and report early issues here npm install medusa-payment-paystack@next You can find a tentative list of breaking changes here. I expect to be done with the rest of the migration - tests, updating starters and writing a migration guide soon. |
Awesome thank you so much |
just cleared the card id but still getting the same error, duplicate transaction reference |
@justinelut You will have to provide more information for me to be able to help you.
|
@justinelut the issue is you're passing a different amount on the frontend than is sent to Paystack on the backend. You're looking to pay 87089KES on your store. Paystack requires you send the value in the smallest subunit of the currency, i.e. amount * 100. The plugin sends Paystack the amount therefore as 8708900. Since the transaction has been initiated with that amount, when you send 87089 to Paystack on the frontend they return that 400 error. To fix this, multiply the cart total in the frontend by 100 so the amount sent to Paystack is in the smallest currency sub-unit. i.e. in the |
This among other reasons is why for V2 of this plugin, we'll likely no longer be recommending the react-paystack library. Paystack has a "Resume transaction" flow designed especially for this usecase which the library doesn't support. The storefront should not have to deal with the details of the transaction, it should just "resume" the transaction initiated on the backend. I have an open issue filed in the react-paystack library - iamraphson/react-paystack#113 and there's an open PR iamraphson/react-paystack#110 adding partial support for it which both haven't received any activity so it isn't likely it will be added there anytime soon. In V2, the recommended flow will be taking only the |
Thank you this works for me and am able to capture payments in the paystack dashboard, i think paystack should fix that multiplying by 100, its so frustrating to debug, if you dont follow the documentation properly |
Thanks for the latest update. UPDATE: i was using |
With the release of v2.0 of the plugin in Nov '24 and the updating of the examples we have in this repo to show how the plugin can be integrated with V2 installations, this plugin now has official support for Medusa V2. Closing this issue now, thank you guys. |
Error: Loaders for module Payment failed: medusa-payment-paystack doesn't seem to have a main service exported -- make sure your module has a default export of a service, is there a way to fix this because am using medusa v2 for my store.
The text was updated successfully, but these errors were encountered: