#srujan-paymentelement-select
1 messages · Page 1 of 1 (latest)
Hello, huge apologies I missed your original message. Thanks for bumping your thread
Can you send me a screenshot of what you are seeing there?
Oh wait I see it
No worries! I thought it might've been a bug or something
It is the proper behavior, basically the Payment Element requires that you also add a button to your webpage that makes the confirmPayment call. Once you do that, the google pay dialogue will show up and let you complete it https://stripe.com/docs/js/payment_intents/confirm_payment
I know we have a demo somewhere for this. One sec while I look for it
Awesome thank you!
How can I check to see if user has selected card vs google vs apple pay with the Payment Element?
(In React/JavaScript)
Well if I have to share a Pay button in the form for both card and google pay I want to conditionally display the text based on our design teams decisions
You can use https://stripe.com/docs/js/element/events/on_change?type=paymentElement#element_on_change-handler-value otherwise, but it's rare that you need this
It'll be calling confirmPayment regardless but also for analytics purposes we want to know that info
Like what % of our conversion is card vs google vs apple pay
yeah but then you can track this after the payment succeeds/fails. It's recorded on the Charge object
no in the API
You have a PaymentIntent, every confirmation attempt will create a Charge, whether it succeeds or not.
And you can look at that Charge in the API, such as the payment_method_details property that will have all the info you need
What method would I use on the frontend to retrieve payment_method_details?
You don't, it's all server-side
Analytics is something you usually do async, for example by listening to Events on your webhook endpoint
https://stripe.com/docs/js/element/events/on_change?type=paymentElement#element_on_change-handler-value otherwise is what I shared earlier, that's an event sent client-side based on the payment method chosen by your customer