Skip to content
Advertisement

Stripe checkout button is not passing the email address

I am setting up a stripe button to charge a one time fee for a product. I the button works and it charges the customer but when i want to send an email to the customer, i can not fetch the customer email and also the customer email is not showing up in stripe dashboard. I have the following code;

JavaScript

When submit the payment I get the following error;

JavaScript

Does anyone know why?

Advertisement

Answer

You are using a deprecated version of Checkout which no longer sees any major updates. Instead you should use Stripe’s new Checkout: https://stripe.com/docs/payments/checkout

To answer your question, you aren’t getting the email value because you aren’t explicitly adding it to the form data to be POSTed to your backend. This should fix it:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement