stripe-firebase-extensions icon indicating copy to clipboard operation
stripe-firebase-extensions copied to clipboard

Readonly Email Address with customerEmail

Open EdwardBock opened this issue 3 years ago • 6 comments

Feature request

firestore-stripe-subscriptions

Is your feature request related to a problem? Please describe.

We do not want the users to change their email address in checkout.

Describe the solution you'd like

It seems that when you provide customerEmail prop with the create checkout session the email field is readonly.

  • https://stripe.com/docs/api/checkout/sessions/create

So I would suggest that if the checkout session document has a field customer_email, this field will be added to the checkout session params.

  • https://github.com/stripe/stripe-firebase-extensions/blob/next/firestore-stripe-subscriptions/functions/src/index.ts#L96-L113
  • https://github.com/stripe/stripe-firebase-extensions/blob/next/firestore-stripe-subscriptions/functions/src/index.ts#L136-L153

Describe alternatives you've considered

Alternatively the checkout_session documents field customer_email could be a boolean and if it is true the users email address will be provided as customerEmail.

EdwardBock avatar Jun 22 '21 14:06 EdwardBock

I have to decide if I implement an own solution for the checkout url handling or wait for you guys to support our change requests. Sadly I don't see any reaction on this.

EdwardBock avatar Jul 08 '21 05:07 EdwardBock

@EdwardBock sorry for the delay! The customer email is already being pre-filled from the customer object, therefore setting customer_email is not possible. customer_email can only be set when no customer object is being supplied, and then Stripe Checkout will create a new customer object which wouldn't work with the extension.

I've flagged this with the team and they are working on enabling this when setting a customer object, and once possible we can update this in the extension.

thorsten-stripe avatar Jul 08 '21 06:07 thorsten-stripe

Thank you for this explanation! Then I'll have to wait patiently 👍

EdwardBock avatar Jul 08 '21 06:07 EdwardBock

@thorsten-stripe Is it possible to hide the email address input from the user in the checkout form?

EdwardBock avatar Jul 08 '21 07:07 EdwardBock

I think this is related... I just updated the extension and now the email field on the stripe checkout page is editable, where as before it was read-only. Can we force that to be read-only again or hide it like @EdwardBock suggested?

Thanks!

maxsupera avatar Jul 15 '21 02:07 maxsupera

Yes, it would be very useful if the email field could be hidden (or be read-only).

axel01 avatar Jul 22 '21 10:07 axel01

When creating a Checkout Session with the customer parameter (which is the default behaviour for this extension), the email field from the associated Customer object will be pre-filled and uneditable. This is confirmed on our documentation here.

It is not currently possible to remove/hide the email field on the payment page.

jsteele-stripe avatar Feb 02 '23 13:02 jsteele-stripe

Hi, how can I make the email readonly in the normal Payment links generated from the UI? Currently it let to edit.

dmezquiam avatar Feb 09 '24 22:02 dmezquiam