Git Product home page Git Product logo

Comments (6)

a11rew avatar a11rew commented on May 20, 2024

Yes you are right on the plugin taking the cart amount and sending that to Paystack. In Medusa and the plugin by extension, prices are represented in the lowest denomination of the currency. To charge KES 3650 in your case, you need to provide the prices in the admin as 3650 * 100.

The default Medusa starter localizes the amounts and so it should show up as KES 3650 on your frontend pages with 365000 given to the plugin and subsequently sent to Paystack.

from medusa-payment-paystack.

a11rew avatar a11rew commented on May 20, 2024

Please do create a separate issue for the transaction failing issue. The error logs you added are indicative of an issue after the original failure which probably happened in the plugin. You could enable debug mode in the plugin to see extra logs which could guide you to what is failing. Add debug: true to the plugin's config to enable debug mode

from medusa-payment-paystack.

kevinrobert3 avatar kevinrobert3 commented on May 20, 2024

Isn't that a bit off that I need to add my prices in backend as KES 365000, that means changing so much across the board, e.g. for other currencies, showing it back in storefront etc. When we could get an option to change the value before the plugin consumes it. Adding the prices as n * 100 in backend is changing a lot of inner workings, even for reporting, only to accommodate Paystack. Also check the other issue similar to this, that would mean the person has to change the prices in their backend in the live environment to accommodate paystack

from medusa-payment-paystack.

kevinrobert3 avatar kevinrobert3 commented on May 20, 2024

It would also mean that someone who has used a different payment processor and chooses Paystack later with the plugin would have to change all their product prices to n * 100 to use the plugin.

I propose push a breaking change in plugin doing the n * 100 internally. Everybody is sorted that way in the most least effort way

from medusa-payment-paystack.

a11rew avatar a11rew commented on May 20, 2024

I am confused. To clarify, are you using the default Medusa admin dashboard?

If you are, this is what adding KES prices should look like:
image

When being saved to the backend, the admin dashboard automatically localizes the prices to the lowest denomination before sending to the backend, i.e. the n*100 conversion you want done.
image

Prices will be stored in the database with this value and all the other parts of Medusa (fulfillment, storefront, this plugin etc) expect the prices in the lowest denomination. Paystack also expects amounts in the lowest denomination (i.e. to pay KES 3650, the amount value sent to Paystack needs to be 365000). You can confirm this from the Checkout demo.

This is the default behaviour and I suggested performing the n*100 conversion yourself because I imagined you were on a custom admin. You shouldn't need to do that otherwise.

You'd have to provide more information on your setup and changes you have added that may affect how amounts are set in your store for us to be able to help.

from medusa-payment-paystack.

kevinrobert3 avatar kevinrobert3 commented on May 20, 2024

Oh wow. I actually really noticed the prices in the other issue' screenshots. I had not noticed this price amounts. Yes I am on a custom admin. This is all fine then. The most weird thing to do and see, however, but I'll change the prices on my end.
I'll close this one and open the other issue

from medusa-payment-paystack.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.