Reputation: 1230
I'm configuring Stripe and have the whole checkout process working, except for the fact that despite configuring the 'receipt_email' variable, Stripe does not send me an email with the receipt after a (test) purchase has been made.
const response = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: `${process.env.REACT_APP_BASE_URL}/projects/${project.id}`,
payment_method_data: {
billing_details: {
name: name,
email: email
},
},
receipt_email: email
},
redirect: "if_required"
})
The email address does appear on the Stripe dashboard against the receipt_email
, but an email with the receipt is not sent.
I've also enabled stripe emails as per below:
Am I configuring this wrong? Is there something else I need to do? Is it just because I'm on test mode? Any help would be appreciated.
Edit
I found a page on stripe support which talks about the reasons why a person may not be receiving emails. One of the reasons says:
Ensure the email you’re expecting is for a live transaction. Stripe only sends email receipts for payments that are made with your live API key or through your live Dashboard. If you are expecting an email for a test transaction, one will not be sent.
This would answer the 'why' of this question, but I find it hard to believe that Stripe wouldn't offer a way to test the email functionality until live prod deployment when real money gets involved. Is there really no way to test the automation?
Upvotes: 1
Views: 3345
Reputation: 1
In "test" mode, it's impossible to automatically send email from stripe after payment even if you set "receipt_email" parameter. Only in "live" mode, it's possible. *In "test" mode, sending custom email using webhook is still possible from your app.
Actually, I couldn't find the information above on stripe documentation so I asked stripe support, then, they said so as I said above.
Upvotes: 3
Reputation: 2784
Unfortunately, there really isn't a way to test receipts being sent automatically for payments created using your test API keys. This is mentioned here : https://stripe.com/docs/receipts
Instead, you can view or manually send a receipt using the Dashboard by finding the payment in the Dashboard and click "Send Receipt" under "Receipt history".
Upvotes: 2