#kaushal-google-pay

1 messages · Page 1 of 1 (latest)

icy solar
#

Hey @winter cradle let's talk here!

winter cradle
#

Hi @icy solar

#
  1. googlePayLauncher.presentForPaymentIntent - if we use this method, will the payment be taken on the success of the completion itslef
    or later ?
  2. googlePayLauncher.present - if we use this method, will it take only the payment details, not the actual payment ?
#

I have read the docs, but still not understanding how it will work in reality

icy solar
#

Can you give a lot more context: how are you integrating, which guide are you following, do you have some code example? Which library are you using? stripe-android or React Native?

winter cradle
#

I am using Stripe-android

#

currently i am using the googlePayLauncher.presentForPaymentIntent in the test environment, the google sheet appeared and i did the payment with my real card

#

this is my code :
googlePayLauncher = new GooglePayLauncher(
this,
new GooglePayLauncher.Config(
GooglePayEnvironment.Test,
"UK",
"Excel Exec",
false,
new GooglePayLauncher.BillingAddressConfig(
false, GooglePayLauncher.BillingAddressConfig.Format.Min,
false
),
false
),
this::onGooglePayReady,
this::onGooglePayResult
);

googlePayLauncher.presentForPaymentIntent(clientSecret);

#

so with this approach, will the amount be deducted from the user card details on confirm itself on the app ?

icy solar
#

yes when you confirm the PaymentIntent it takes the payment at the same time

#

this is the best way to integrate really

winter cradle
#

Oh ok

#

so what about the second approach, GooglePayPaymentMethodLauncher.present ?

jovial elbow
#

👋 stepping in as koopajah needs to step away

#

Yep so the recommended route is googlePayLauncher.presentForPaymentIntent(clientSecret) which will handle the confirm for you

winter cradle
#

will this method just take the payment details and let the server will handle the payment ?

jovial elbow
#

Otherwise, yes, GooglePayPaymentMethodLauncher.present will result in just the PaymentMethod object

#

Which you can pass back to your server for confirmation

winter cradle
#

ah ok understand clearly

winter cradle
#

yeah

#

cool thanks , please don't close this thread for now, will ask couple more questions in some time

jovial elbow
#

Sure thing

winter cradle
#

I am using the first method as i said, it was working fine an hour back, the sheet was opening and the payment was taken

#

but now suddenly if try to open the sheet i am getting this error on a dialog , request failed, unexpected developer error, pls try again

#

if i see my logs , it saying this : error:java.lang.RuntimeException: Google Pay failed with error:

jovial elbow
#

What did you change in your code recently?

winter cradle
#

nothing actually, i just went for my dinner and came back and started checking again after an hour

jovial elbow
#

And there is no error in your logs after failed with error:?

#

Have you done a clean build?

winter cradle
#

yes , no error , its only this :

jovial elbow
#

Okay can you clean and build again?

winter cradle
#

ah ok, will try now

#

did that, actually uninstalled the app and tried still same

jovial elbow
winter cradle
#

ok, thanks again

jovial elbow
#

Sure thing

winter cradle
#

working in a different phone the same code, in my phone actually, i have joined the google pay test card group , i think that is creating problem

jovial elbow
#

Ah yeah Google Pay can be really finicky that way