#srujan-paymentelement-select

1 messages · Page 1 of 1 (latest)

spring gulchBOT
cyan lichen
#

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

onyx brook
#

No worries! I thought it might've been a bug or something

cyan lichen
#

I know we have a demo somewhere for this. One sec while I look for it

onyx brook
#

Ohhh I see

#

So I won't see the google pay interface until I call confirmPayment

cyan lichen
#

Correct

onyx brook
#

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)

brazen ridge
#

srujan-paymentelement-select

#

@onyx brook usually you don't need this information

onyx brook
#

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

brazen ridge
onyx brook
#

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

brazen ridge
#

yeah but then you can track this after the payment succeeds/fails. It's recorded on the Charge object

onyx brook
#

Oh I see

#

Like in the dashboard?

brazen ridge
#

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

onyx brook
#

What method would I use on the frontend to retrieve payment_method_details?

brazen ridge
#

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

onyx brook
#

Oh so you're saying I would want to setup analytics server-side

#

That makes sense

brazen ridge
onyx brook
#

This is good to know though

#

I appreciate the help!