#Dimitris

1 messages · Page 1 of 1 (latest)

grand cypressBOT
gritty sigil
#

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...

primal mist
#

If you mean this, the last transaction's payment id was: pi_3MskOkGthd62JLPh1KBoP7UR

gritty sigil
#

thanks, You can delete the secret_SG... part

#

This PaymentIntent is just created and no payment attempt was done so far on it...

primal mist
#

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

gritty sigil
#

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?

primal mist
#

ok I'm cloning the project. What do you mean shouldn't happen?

gritty sigil
#

What do you mean shouldn't happen?
I meant, according to the PaymentIntent Id you shared, there wasn't any attempt to confirm it

primal mist
#

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?

gritty sigil
#

when calling presentForPaymentIntent it should handle the payment confirmation too.

primal mist
#

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?

gritty sigil
grand cypressBOT
primal mist
#

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?

fossil dragon
#

Hi! I'm taking over my colleague. Please, give me a moment to catch up.

primal mist
#

of course, thank you

crude lynx
#

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 using GooglePayLauncher you'll get the PaymentMethod after the payment is completed. With GooglePayPaymentMethodLauncher you'll get the PaymentMethod first (and then you can charge the customer with it).

primal mist
#

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