#asdfgh-rates
1 messages · Page 1 of 1 (latest)
👋 happy to help
I didn't quite follow what you are trying to achieve, could you please explain?
Okay, maybe I will present my use case
Lets say that the price is not fixed for the user and it increases with time
The price starts from zero
And user can pay in any moment
So if price is lower than the minimum amount of the payment intent user will not pay at all
And if it is higher, I want to present payment sheet
And I want to check in some way if the current price is enough to create payment intent
The problem is that I would have to check it for each currency and I would have to use api for the exchange rates
So maybe there is an easier way?
Maybe I can catch specific Stripe exception which says that amount for payment intent is not enough and then fulfill the user payment for free
here's a list of minimum amounts https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts
Yes, I have seen that, but that doesnt solve my problem
I think that checking for each currency is not a best way to do it
And what if Stripe will change that in future?
I dont want my code be dependent on this list
unfortunately that's not possible using the APIs today
Understood
And what about exception
Can I check somewhere which exceptions throws create payment intent method?
yes you can check for this error https://stripe.com/docs/error-codes#amount-too-small