#saadalti-flutter

1 messages · Page 1 of 1 (latest)

cloud sonnet
#

hello

#

@chrome axle Stripe expects the amount in the lowest currency unit

#

to charge $10 you have to pass amount: 1000

chrome axle
#

Hmmm

#

Will check now

#

Weird

#

Not working

#

Any help?

#

Stripe says invalid double

cloud sonnet
#

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

chrome axle
#

So what should i do

cloud sonnet
#

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?

chrome axle
#

how to convert 10.20 to 1020 without manually typing it

cloud sonnet
#

which programming language are you using?

chrome axle
#

Dart flutter

cloud sonnet
#

can you say more? Can you share real code? Usually you have a server for charging, since it uses the Secret API key

chrome axle
#

calculateAmount(String amount) {
final a = (int.parse(amount)) * 100;
return a.toString();
}

cloud sonnet
#

so what is the value of a?

chrome axle
#

No wait

cloud sonnet
#

I understand but you're the developer here I mean can you debug this, print the exact value before/after, etc.

chrome axle
#

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

cloud sonnet
#

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

restive steeple
#

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?

sweet belfry
#

(NOT with Stripe) integerCents = Round(decimalPrice*100) Exact syntax depends on language.

#

(NOT with Stripe) decimalPrice = integerCents/100.0

restive steeple
#

thanks

#

to stripe