#JJZFIVE
1 messages · Page 1 of 1 (latest)
hello! what do you mean by they input their email in the card? which field is this and what field passing it into for the PaymentIntent?
Hi Alex! How are you? Let me show you.
Here's my payment card I built around the PaymentElement
I'd like to have access to this email when Stripe hits my webhook. Again, I'm listening to only payment_intent.succeeded events since that seems the most up-to-date per the Stripe docs
that email field looks like an input field which you defined yourself, am i right?
Yep, I defined it myself! Here's my React code that confirms the payment. I'm trying to pass the email as billing details in the payment method data const { error } = await stripe.confirmPayment({ elements, confirmParams: { // Make sure to change this to your payment completion page return_url: "http://localhost:3000/purchase-confirmed", payment_method_data: { billing_details: { email: email, }, }, }, });
The problem is that this payment method data doesn't show up in the object that gets passed to the webhook
can you share the PaymentIntent id?
hmmm, it's not displayed on the payment_intent.succeeded event but I guess you can listen for the charge.succeeded event instead.
Interesting
you can see it in https://dashboard.stripe.com/test/events/evt_3MMlhGGV1TqT5N6a2AtTjlyW
I was looking at the difference between charge and payment_intent
I wanted to use Payment_intent because it seems more up to date
Do I lose anything if I use charge instead? The charge event does include my data which is good though
you should definitely use PaymentIntents to accept payments (yes, it is the most up to date way to accept payments). PaymentIntents generate an underlying Charge object when payment is attempted, so as long as the Charge event contains the data which you're looking for, it's fine to use it instead.
Oh perfect!
So I'll just listen for charge.succeeded instead of payment_intent.succeeded? And I shouldn't be messing anything up?
yep, that's right. But as usual, please test throughly to make sure that the event contains the details you need for all possible scenarios