#jared-green_code

1 messages ยท Page 1 of 1 (latest)

astral crystalBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1409563911904296970

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

narrow hawk
#

Hello ๐Ÿ‘‹

The code you are sharing is using our web-based Payment Element but you said you are using Stripe react native. Can you clarify exactly what Stripe integration you are using?

shell spoke
#

Hey, we have a web checkout page that we show in an embedded web view in the react native app.

#

Sorry, we are not doing anything with Stripe react native. The stripe element is on a a web checkout page.

narrow hawk
#

And what is the error you are seeing?

shell spoke
#

Android has added support for Google Pay in the Android webview. After updating the Android configuration I can see Google Pay shown as an option in the Stripe Element. However, tapping on the pay button and executing the handleSubmit function, results in this submitError object.

{"code":"incomplete","type":"validation_error","message":"Please fill in your card details."}

narrow hawk
#

And do you log the full events from the onChange listener?

shell spoke
#

I can see in the console logs that the onChange listener is called when Google Pay is selected and not call again before the pay button is tapped.

#

I can try and get the full event for you from the onChange listener when Google Pay is selected if that helps.

narrow hawk
#

What code are you using to submit the payment?

shell spoke
narrow hawk
#

Sorry can you strip this down to the relevant parts? I can't review 400 lines of code when the server is busy

shell spoke
#

When the user taps the pay button the handleSubmit function is called. We are seeing this error object in the result of the elements.submit() call on line 358.

#

const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
...
const { error: submitError } = await elements.submit();
...
}

narrow hawk
#

It looks like there is a paymentMethod value being logged at that point. Where was this created?

shell spoke
#

The paymentMethod is a string that is set when the handleElementChange function is called. We can see from the logs that the payment method is still set to Google Pay when handle Submit is executed.

#

I am thinking that the code to read the users payment method from Google Pay is failing when executed from inside a webview.

narrow hawk
#

And you are following the guidance for GooglePay in Webviews here?

shell spoke
#

Yes, this is how we got Google Pay to show at all. Before these changes, the Stripe element would not show the Google Pay in the embedded web view.

narrow hawk
#

Our most recent updates are that we (Stripe) support this using the Express Checkout Element doc but not the Payment Element. I suspect the fact that it is displayed at all is a bug we'll need to fix

shell spoke
#

OK, so Google Pay should not work in an embedded web view if we are using the Stripe Element, correct?

#

Are you planning on supporting this use case in the future?

narrow hawk
#

OK, so Google Pay should not work in an embedded web view if we are using the Stripe Element, correct?

No that is not what I said. We do support Google Pay in WebViews if you are using the ExpressCheckoutElement.

shell spoke
#

OK, so we need to use the ExpressCheckoutElement if we want to support Google Pay in a web view.

#

Thanks for your help.

narrow hawk
#

For right now, I would exclude Google Pay as a rendered payment method in the Payment Element by specifying {googlePay: "never"} in the wallets option

#

That way you don't have Google Pay showing up in both and confusing your customers

shell spoke
#

OK, good idea.

narrow hawk
#

Oh, do you have an example Confirmation Token or Payment Intent where you see this error?