#slush-pricing
1 messages · Page 1 of 1 (latest)
{
// Replace this constant with a calculation of the order's amount
// Calculate the order total on the server to prevent
// people from directly manipulating the amount on the client
return 1400;
}```
So 1400 is $14 correct?
My database outputs numbers like 14, 34.99, 12.05, 12.5
How would you suggest making it so that it would fit for this API?
Does stripe just assume everything has 2 decimal places?
ah yeah so our amounts are in the smallest currency units. So 1499 is $14.99
but some currencies are "zero decimal": https://stripe.com/docs/currencies#zero-decimal
so for example 1499 for currency: 'jpy' is 1499 JPY, not 14.99
yeah
Also is there a way to force a failure on a paymentinentrequest?
For example im trying to calculateorderamount and if for some reason an error returns from my database I want to be able to cancel the payment intent
I could just make the "Amount = "error""
But not sure if there is a better way
I'm not really following what you mean by that
why would there be an error with the amount?
Im grabbing the amount from my database.
So if the database goes down or whatever and it cant retrieve the amount not sure the best way to handle it.
you have bigger problems at that point 😅