Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe checkout - Remove or make email field read only

I'm using stripe checkout as described in https://stripe.com/docs/payments/checkout

On the server side, I create a new stripe customer (if there isn't one already), and use that customer id to create a checkout session. and then redirect to checkout using stripe api

stripe.redirectToCheckout({
  // Make the id field from the Checkout Session creation API response
  // available to this file, so you can provide it as parameter here
  // instead of the {{CHECKOUT_SESSION_ID}} placeholder.
  sessionId: '{{CHECKOUT_SESSION_ID}}'
}).then(function (result) {
  // If `redirectToCheckout` fails due to a browser or network
  // error, display the localized error message to your customer
  // using `result.error.message`.
});

in the checkout page (which is stripe hosted), there is a email field which is pre populated, but is editable. I have had customers changing that email address. Is there a way I can make the email address on stripe checkout readonly field?

like image 726
rrag Avatar asked May 11 '20 09:05

rrag


People also ask

Can you customize Stripe checkout?

You can customize the look and feel of Checkout in the Stripe Dashboard. Go to Branding Settings where you can: Upload a logo or icon. Customize the Checkout page's background color, button color, font, and shapes.

Is Stripe checkout deprecated?

Stripe will not be updating the Stripe Checkout modal to comply with Strong Customer Authentication (SCA) and as a result they no longer recommend using that integration.

How do I send an email after Stripe payment?

Stripe can automatically send email receipts after a successful payment, or when you refund one. This is done by providing an email address when making the API request, using the email address of a Customer object, or updating a PaymentIntent with a customer's email address after checkout.

Is checkout Stripe secure?

It means Stripe is very secure. They exceed industry security standards and are trusted by thousands of businesses of all sizes across the globe including many Fortune 500 companies.


2 Answers

A possible work around:

You can use customer_email instead customer parameter when you create a session. In this case users can not change the value of email field.

Then, you can get the created customer and update it if you need added some data using the API: https://stripe.com/docs/api/customers/update

But, the problem is that stripe will create a new customer for each checkout.

like image 81
MatiasG Avatar answered Oct 07 '22 19:10

MatiasG


I got an email from stripe today

We are disabling customers’ ability to overwrite their email address
Starting October 26, customers can no longer edit their email address after you pass it into a Checkout Session. We’ve made this change to prevent duplicative subscriptions from being created by accident for existing customers and prevent unexpected updates to the Customer object during Checkout.

And here it is in all its glory

enter image description here

like image 39
rrag Avatar answered Oct 07 '22 21:10

rrag