#jared-green_code
1 messages ยท Page 1 of 1 (latest)
๐ 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.
- jared-green_code, 5 days ago, 35 messages
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?
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.
And what is the error you are seeing?
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."}
And do you log the full events from the onChange listener?
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.
What code are you using to submit the payment?
Sorry can you strip this down to the relevant parts? I can't review 400 lines of code when the server is busy
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();
...
}
It looks like there is a paymentMethod value being logged at that point. Where was this created?
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.
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.
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
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?
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.
OK, so we need to use the ExpressCheckoutElement if we want to support Google Pay in a web view.
Thanks for your help.
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
OK, good idea.
Oh, do you have an example Confirmation Token or Payment Intent where you see this error?