#ivan-connect-emailreceipt

1 messages · Page 1 of 1 (latest)

deep nightBOT
raw aurora
#

@spark rampart First, are you using Standard accounts and creating a payment on the connected account using Direct Charges?

spark rampart
#

Yeah, I am using standard accounts and I am using checkout sessions for the payment

raw aurora
#

Okay so that's not possible for you to control directly. There are 4 options

  1. Let the individual Standard account(s) control this setting in their Dashboard
  2. Write your own email integration yourself as a platform
  3. After a successful payment, listen to checkout.session.completed, look at the resulting PaymentIntent/Charge and check if it has receipt_email set. If it does, then one was sent, if it doesn't, none was sent and you can call the Update Charge API https://stripe.com/docs/api/charges/update and pass receipt_email to the email associated with the Checkout Session to force one
  4. Collect an email upfront and set it on payment_intent_data[receipt_email] when you create the Checkout Session
#

ivan-connect-emailreceipt

deep nightBOT
spark rampart
#

Got it, thank you.
I am going to focus in the point #3 for my next questions:
The checkout session form has a email field, so if an email is provided it means that a successful payment email is sent to the user, if not(I could verify it with the checkout.session.completed), I could update the Charge to pass the customer email to force successful payment email. Did I understand well?

hot lantern
#

👋

#

Stepping in as koopajah needed to step away

#

The customer_email field on the Checkout Session does not necessarily determine that a receipt email was sent... the email would only be sent if the Connected Account had the successful payment emails setting turned on in their Dashboard.

#

That is why you need to actually check the receipt_email property

spark rampart
#

Now I understand better, thank you.
I see that to update the charge I would need the charge_id, but I am checking the checkout.session.object and I don't see the charge_id there. Should I get the charge_id in the checkout.session.completed event?

hot lantern
spark rampart
#

Interesting, so in the call to retrieve the checkout session I would put something like this:
expand: ['payment_intent.latest_charge']. That would return me the charge_id to update the receipt_email property with the customer email to force that the Stripe sends an email to the customer that confirm the successful payment.
All this before is an option to the scenario where my connected account doesn't set Successful payments option?

hot lantern
#

Yep

spark rampart
#

Can I test that the email is sent in test env?

hot lantern
#

No

#

We don't send emails in test to prevent spam

spark rampart
#

Ok, thank you very much.