#Dimitris
1 messages · Page 1 of 1 (latest)
Hi
Can it be there's something wrong with our implementation, since the Google Pay Result is received, or does Google Pay not like Stripe's sandbox environment for some reason? Any way to check without switching to production yet?
Can you share the PaymentIntent Id?
Are you using PaymentSheet ?
Is there a way to close the Stripe SDK's Google Pay Launcher programmatically?
AFAIK, no. but let's figure out for issue 1 first...
Google Pay Launcher hasn't an exposed function in order to cancel the launcher:
https://stripe.dev/stripe-android/payments-core/com.stripe.android.googlepaylauncher/-google-pay-launcher/index.html?query=class GooglePayLauncher
If you mean this, the last transaction's payment id was: pi_3MskOkGthd62JLPh1KBoP7UR
thanks, You can delete the secret_SG... part
This PaymentIntent is just created and no payment attempt was done so far on it...
Can you share more details about how you are integrating Google Pay? can you try testing this sample activity and see if you can reproduce the same issue on it ?
https://github.com/stripe/stripe-android/blob/master/example/src/main/java/com/stripe/example/activity/GooglePayLauncherIntegrationActivity.kt
When the client arrives at the screen where the payment should be initiated, we fetch the stripe data with the client secret from the server, which is the one I sent you above (pi_ and secret_ combined)
we also create the GooglePayLauncher:
String publicKey = getStripePublicKey();
PaymentConfiguration.init(getActivity(), publicKey);
GooglePayEnvironment environment = BuildConfig.STRIPE_TEST_ENVIRONMENT ?
GooglePayEnvironment.Test : GooglePayEnvironment.Production;
googlePayLauncher = new GooglePayPaymentMethodLauncher(
this,
new GooglePayPaymentMethodLauncher.Config(environment, MERCHANT_COUNTRY_CODE,
"our payment text prompt")
),
this::onGooglePayReady,
this::onGooglePayResult
);
when the launcher is ready onGooglePayReady is called, we present the gpay launcher:
googlePayLauncher.present("EUR", Math.toIntExact(stripeDataResponse.getPaymentAmount()));
when the user taps on Continue in google pay launcher, onGooglePayResult is called where we send the payment method id, client secret and other data to our server
when the user taps on Continue in google pay launcher, onGooglePayResult is called where we send the payment method id, client secret and other data to our server
This shouldn't be happening in your case ... can you try to reproduce the issue on the sample Activity I shared with you?
ok I'm cloning the project. What do you mean shouldn't happen?
What do you mean shouldn't happen?
I meant, according to the PaymentIntent Id you shared, there wasn't any attempt to confirm it
For some reason the project cannot be cloned and the zip file does not open, I will try creating a new project to test it. Meanwhile, can you tell me, should the confirmation be done when the user taps on the native launcher button, or does the server has something to do with it? I mean, at which point does the state change from INCOMPLETE to COMPLETE?
when calling presentForPaymentIntent it should handle the payment confirmation too.
I just saw that the sample uses GooglePayLauncher; we use GooglePayPaymentMethodLauncher, which has a present() method, not presentForPaymentIntent(). Is there a problem with this implementation in general?
No, just different approach, the first approach using GooglePayLauncher is simplier... while the GooglePayPaymentMethodLauncher is for creating a PaymentMethod and continue to confirm the payment in backend: following this:
https://stripe.com/docs/google-pay?platform=android#creating-a-paymentmethod
So the issue here is that our backend needs the payment method to do some calculation in their end, but they have not implemented the confirmation. If I understand correctly, using GooglePayLauncher does not provide a PaymentMethod, so in order to send the PaymentMethodId we should use GooglePayPaymentMethodLauncher.
iOS seems to work a bit differently. They use client-side confirmation, but are still getting a PaymentMethodId to send to the server. Is that correct?
Is there a way to get the PaymentMethod if we use client-side confirmation as well (GooglePayLauncher)? Or should the backend finalize the payment?
Hi! I'm taking over my colleague. Please, give me a moment to catch up.
of course, thank you
If I understand correctly, using GooglePayLauncher does not provide a PaymentMethod, so in order to send the PaymentMethodId we should use GooglePayPaymentMethodLauncher.
You will get a PaymentMethod in both case, but when usingGooglePayLauncheryou'll get the PaymentMethod after the payment is completed. WithGooglePayPaymentMethodLauncheryou'll get the PaymentMethod first (and then you can charge the customer with it).
That's great. How do I get the PaymentMethod after the payment in the first case, though? There is no relevant method for GooglePayLauncher.Result, while there is one for GooglePayPaymentMethodLauncher.Result