#arvind_singh_21006

1 messages · Page 1 of 1 (latest)

vale swanBOT
astral surge
#

you should never use the Charges API here, it's deprecated.

if you're asking why the amount is * 100 it's because in Stripe you specify the amount in the lowest currency unit(e.g 4237 means $42.37 (it's in cents)

vagrant coral
#

can you define in depth

astral surge
#

I can if you ask a specific question, what can I clarify exactly?

vagrant coral
#

why we multiple by 100 ? in charge method on amount field ?

astral surge
#

it's because in Stripe you specify the amount in the lowest currency unit(e.g 4237 means $42.37 (it's in cents)

vagrant coral
#

when i check stripe dashboard payment there are showing customer paying 12 doller but on the dashboard showing 1200 doller ?why

astral surge
#

do you have an example ch_xxx ID where that happened?

vagrant coral
#

yes i have

#

they return the 12000 something like this

#

?why

astral surge
#

if you post the ID I might be able to have a look and tell you

vagrant coral
#

okay

#

ch_3Nd5sUHnkNc8JPqN1eK3B4zt

astral surge
#

you passed us 120000 which is 120000 cents, which is $1,200.00

#

so that means in your code your variable payment_detail['amt'] is 1200 for example. If you passed that without multiplying it by 100, it would be 1200 cents, which is $12.00

vagrant coral
#

sorry i'm not understand this

astral surge
#

what can I clarify?

vagrant coral
#

how can i calculate it ? it would be 1200 cents, which is $12.00

#

to convert 12 doller

astral surge
#

depends what amount you want to charge. What do you want?

vagrant coral
#

i want to pass 12 doller then when i fatched my transaction then showing me 12 doller only

astral surge
#

well then wherever you are getting the variable payment_detail['amt'] from, that already has calculated the correct value to be able to charge $12.00 (12 dollars) on Stripe.

vale swanBOT
astral surge
#

so presumably you don't need to then multiply it by 100 so you should not do that.