#redbull-paymentelement-googlepay
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
Hi 👋
What code are you using to create the Payment Method?
I am creating a payment intent and returning client secret back
so, I am not creating the payment method in code
should I?
Sorry, my mistake. Can you share the code you use to create the Payment Element?
sure, just a minute
export const createPaymentIntent = async (amount: number) => {
const customerId = 'cus_PNyMEVA3h6rNB2';
const paymentIntent = await stripe.paymentIntents.create({
amount: amount * 100,
currency: 'usd',
customer: customerId,
automatic_payment_methods: {
enabled: true,
},
});
return {
clientSecret: paymentIntent.client_secret,
};
};
oh sorry, that's payment intent. let me paste a code related to payment element too
my code is a bit mixed with business logic but I hope you will understand what is happening there. So, this is parent component with Elements:
and this is checkout form(child component)
Wait...
You're just asking about the
"Another step will appear to securely submit your payment information." text?
That is totally normal and how this has always worked
You can see it in the preview of the Payment Element here: https://stripe.com/docs/payments/quickstart
Google Pay requires the launching of a separate modal window whose content is controlled by Google
ok, let me check this article and fire that example app. Maybe I don't understand something. I'd expect the list of payment cards from Google wallet to appear after selecting google pay
Nope that's a Google Pay requirement
And it is always how the Payment Element has behaved
Apple Pay is the same way
should I run this app locally or there is already somewhere hosted version?
I mean this demo app from the article
I would run it locally but you will need to use a tool like ngrok so you can load your local app in an https URL with a valid cert
Otherwise Google Pay won't show up
got it, so this app has implemented flow with redirect to the next step when selecting google pay?
But a colleague of mine has a pretty cool demo set up if you just want to test it out
https://4242.io/test/payment-element/
Just test it out on that page to see what happens
let me check
oh, actually I just hit submit when google pay selected in my app and it redirected me to the next step). I am sorry about asking this stupid question. For some reason It wasn't obvious to me that nothing is displayed when selecting google pay and only after hitting submit button redirect is happening. Thank you for your help
No problem! My colleague's site is also a good place to see a lot of examples of different Stripe elements in use.