Stripe Checkout without requiring name or email

蓝咒 提交于 2020-01-24 19:30:30

问题


I would like to implement Stripe checkout for subscriptions. I have followed the guidance here and everything works. However, the checkout form that Stripe provides requires the user to enter (i) the name on the card and also (ii) the user's email.

Is there a way to remove these two items, so that the user does not need to enter them? Is it acceptable (in terms of security) to remove these items?

The goal here is to make it easy for users to go through the payment flow, and also to limit the information I have access to about the user.

I am using Node.

Note that I will be collecting the user's email elsewhere in the signup process, so showing the email on the Checkout form is redundant (even if I can prefill it).

Here are a few more details:

When I use Stripe Elements instead of Checkout, everything seems to work fine without requiring the customer's name.

I had also thought the old Checkout did not require name--I believe the old modal did not have a name field. And many credit card forms I have completed over the years that had the Stripe styling did not require name or email in the credit card form.

And according to this answer, name is often not required by forms because it is generally not actually used in the verification process (though that answer is a few years old).

I see an answer here from 2017 stating that the email field is required. I am wondering if this is still the case.

EDIT: I understand that if I want to use a fully customizable form, then I can use Elements. But this question is about Checkout. The form that Elements loads does not require users to enter their names, and Checkout did not previously require users enter their names. If Checkout does require names now, has Stripe ever explained why?


回答1:


Checkout currently supports pre-filling your user's email using the customer_email field when creating a CheckoutSession [0] but Checkout doesn't support not collecting email.

The "name" input field is not configurable and cannot be pre-filled. You might have to create your own custom form using Stripe.js and Elements to not collect your user's email and name.

[0] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer_email



来源:https://stackoverflow.com/questions/59648750/stripe-checkout-without-requiring-name-or-email

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!