#shaun-emailreceipt-guest
1 messages · Page 1 of 1 (latest)
@blazing latch You can set it after the payment too to trigger an email receipt if you prefer
shaun-emailreceipt-guest
https://stripe.com/docs/api/payment_intents/update and set receipt_email then
Does that attach the customer in stripe?
We are sending customer details with confirm payment
I'm really sorry, Discord is quite busy and I barely understand what you describe
You said you are using Guest Customers and want to send a receipt. So I am explaining that as the developer you can write code to call the Update PaymentIntent API after the payment succeeds and pass receipt_email to the right email address to trigger an email receipt to be sent
Sorry for the confusion
Perhaps it would be better to ask, how can we ensure customers are created in stripe and attached to the payment so that a receipt is emailed to them
All good! And gotcha I didn't know you wanted real Customer objects. There are many reasons Guest Customers can happen so first I'd recommend reading https://stripe.com/docs/payments/checkout/guest-customers
And then I need to know more about your integration as the developer. Are you using Checkout? PaymentElement? Something else?
Currently we create a payment intent in the backend and stripe is calls confirmpayment on front end
Thank you, we are using payment Element
Okay, so you wrote the whole integration yourself. If you don't create a Customer, it's expected that there's no Customer. So really you need to change your code to properly create a Customer and associate it with the PaymentIntent
Ok that makes sense, does the customer need to be created before the payment intent, or can we create a payment intent and then associate a customer to it?
If you want the email receipt to be sent automatically, the Customer has to be created before the PaymentIntent succeeds and that Customer has to have an email set explicitly
Ok
THank you
What is the end point that allows us to associate the customer with the payment intent ?
There's no specific "endpoint". When you create the PaymentIntent you pass customer: 'cus_123'
ok
But is there a way to associate the customer to the payment intent after it has been created? The issue we have is that the payment element form is on the same page that the customer enters their details so we need to show create the payment intent before the customer is created
There are many ways to integrate. You need to figure out the right flow for you.
You can create the Customer after the payment is completed but it will not send an email receipt. In that case we're back to what I said earlier.
Sorry Discord has been extremely busy and I'm struggling to understand what part is confusing you exactly
A normal flow is
1/ Create Customer with email
2/ Create PaymentIntent with customer: 'cus_123'
3/ Confirm PaymentIntent => triggers email receipt
But you can do that instead
1/ Create a PaymentIntent
2/ Confirm PaymentIntent
3/ Afterwards create a Customer with the right email
4/ Update PaymentIntent with customer: 'cus_123' to associated the two and receipt_email to force an email receipt to be sent
does that make sense @blazing latch ?
That's great thank you, is it possible to update the payment intent (add customer) before it's confirmed?
yes