#swathi

1 messages · Page 1 of 1 (latest)

paper mirageBOT
silent prairie
#

Hello there

paper wedge
#

hie

silent prairie
#

Are you just trying to collect card details via Google Pay?

paper wedge
#

yes intially am saving card details and then after successful authentication we are collecting amount

silent prairie
#

Gotcha, and are you using a SetupIntent to do so?

paper wedge
#

yes

silent prairie
#

Gotcha, I believe that with a SetupIntent then the amount should show as 0 automatically?

#

Are you not seeing that?

#

This will remove the amount at times which can be helpful to avoid confusion for your customers

#

Otherwise, I don't recall if you can set amount to 0, but I believe you can. You should be able to test it out

paper wedge
#

before creating setupIntent for googlepay/applepay we will create a paymentRequest right?

#

In paymentRequest: we have total object in that we have amount parameter, here can we pass 0 amount?

silent prairie
#

Yes

paper wedge
#

thanks

paper wedge
#

one more issue

#

getting following error while passing value to the paymentRequest

#

Invalid value for paymentRequest(): total.amount should be a positive amount in the currency's subunit. You specified: 599.

silent prairie
#

Hmm that's a weird error

#

Can you show me your code for this?

paper wedge
silent prairie
#

Hmm can you log out revisedPrice just before you set stripe.paymentRequest?

#

And currency.toLowerCase()?

#

I think our API doesn't care about case sensitivity here btw

paper wedge
#

revisedPrice--- 5.99
StripeAppleGoogleForm.js?bf7e:100 currency--- usd

silent prairie
#

Yep so you don't want the ., try just 599

paper wedge
#

tried that also

#

getting same error

silent prairie
#

Did you hardcode it?

paper wedge
#

then it is working fine

silent prairie
#

Okay so yeah it is something about your revisedPrice variable initialization that is causing the issue

#

How do you initialize that?

paper wedge
#

am doing price(5.99) multiplied by 100 and passing it to revisedprice(599)

silent prairie
#

Can you show me the code?

#

It sounds like when you do that multiplication it seems that it is setting the decimal

paper wedge
silent prairie
#

Okay so I see you have a commented out log there

#

If you comment that in, you see 599?

paper wedge
#

yes

silent prairie
#

What is dataHelper?

#

That is just where calculateStripeAmount lives?

paper wedge
#

yes

silent prairie
#

Hmmm very strange

#

Let's try doing something like let testAmount = dataHelper.calculateStripeAmount(revisedPrice, currency) up above the paymentRequest and then log out testAmount

paper wedge
#

issue resolved thanks

silent prairie
#

Out of curiosity, what was it?