#saadalti-flutter
1 messages · Page 1 of 1 (latest)
hello
@chrome axle Stripe expects the amount in the lowest currency unit
to charge $10 you have to pass amount: 1000
that's expected since a double is not an integer
you can't pass amount: 10.20, you can't pass amount: 1020.00 you have to pass the exact number of cents as an integer
exactly what I said above and gave the example
So what should i do
pass an integer as a number of cents?
Sorry you haven't explained anything other than "doesn't work". Like what's your code, what is the exact error message, what exact value are you sending as a parameter?
how to convert 10.20 to 1020 without manually typing it
which programming language are you using?
Dart flutter
can you say more? Can you share real code? Usually you have a server for charging, since it uses the Secret API key
calculateAmount(String amount) {
final a = (int.parse(amount)) * 100;
return a.toString();
}
so what is the value of a?
No wait
I understand but you're the developer here I mean can you debug this, print the exact value before/after, etc.
Im the project manager Will let my developer to contact you
Is there any link to send him?
His name is emmanual he will talk on the channel
Please assist him and thank you
I'd recommend having them writing to support instead I'm about to run
cc @restive steeple
let's talk here instead since we already spent a few hours on this
any way to automatically convert any decimal number in flutter eg 12.30 to 1230 and automatically pass to stripe to process payment as $12.30?