#kaushal-google-pay
1 messages · Page 1 of 1 (latest)
Hi @icy solar
- googlePayLauncher.presentForPaymentIntent - if we use this method, will the payment be taken on the success of the completion itslef
or later ? - 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
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?
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 ?
yes when you confirm the PaymentIntent it takes the payment at the same time
this is the best way to integrate really
👋 stepping in as koopajah needs to step away
Yep so the recommended route is googlePayLauncher.presentForPaymentIntent(clientSecret) which will handle the confirm for you
will this method just take the payment details and let the server will handle the payment ?
Otherwise, yes, GooglePayPaymentMethodLauncher.present will result in just the PaymentMethod object
Which you can pass back to your server for confirmation
ah ok understand clearly
Specifically the PaymentMethod will be in the resultCallback: https://stripe.dev/stripe-android/payments-core/com.stripe.android.googlepaylauncher/-google-pay-payment-method-launcher/-google-pay-payment-method-launcher.html
yeah
cool thanks , please don't close this thread for now, will ask couple more questions in some time
Sure thing
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:
What did you change in your code recently?
nothing actually, i just went for my dinner and came back and started checking again after an hour
And there is no error in your logs after failed with error:?
Have you done a clean build?
Okay can you clean and build again?
Okay in that case I'd recommend first logging out your params that you are passing to GooglePayLauncher to ensure there isn't an issue server-side. And then if that all looks good you will need to hook up ADB (https://developers.google.com/pay/api/android/support/troubleshooting) as sometimes these GooglePay errors can be pretty cryptic
ok, thanks again
Sure thing
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
Ah yeah Google Pay can be really finicky that way