使用Stripe创建订阅前,应在哪个流程节点验证用户邮箱?
Great question—this is a super common dilemma when building subscription-based services, and the short answer is: you absolutely should wait for email verification before creating a Stripe subscription and processing payment. Here's why, plus a step-by-step best practice workflow:
Core Reasoning to Avoid Pre-Verification Charges
- Reduce payment disputes & chargebacks: If a user mistypes their email or abandons the process after submitting payment, they’ll never receive your verification email (or access to your service) but will still see a charge on their card. This is a surefire way to trigger chargebacks, which hurt your Stripe account’s health and can lead to restrictions.
- Build user trust: Asking for payment after a user has confirmed their email feels less intrusive and more transparent—they’ve already committed to verifying their identity, so they’re more receptive to completing the payment step.
- Clean up redundant data: Creating Stripe customers for unverified users clogs your Stripe dashboard with unused records, making it harder to track active subscribers and analyze metrics.
Recommended Step-by-Step Workflow
Collect basic user info first, trigger verification
- When a user submits your initial form (email + password), create a pending/unverified user in your system immediately.
- Send a verification email right away (with a one-time link or code) and redirect the user to a page telling them to check their inbox to continue.
- Do not collect credit card information at this stage—keep the first step as simple as possible to reduce drop-off.
Post-verification: Collect payment details & create subscription
- Once the user clicks the verification link and confirms their email, update their status in your system to "verified".
- Redirect them to a dedicated payment page (or continue the flow if you’re using a single-page app) where you collect their credit card details using Stripe.js.
- Generate the card token, then create a Stripe Customer object linked to the verified user, followed by the Subscription to initiate the charge.
Handle edge cases gracefully
- If a user doesn’t verify their email within a reasonable window (e.g., 24-48 hours), automatically delete the pending user from your system to avoid clutter.
- If payment fails after verification (e.g., declined card), give the user clear instructions to retry their payment—since they’re already verified, you don’t need to re-send the verification email.
Why This Works Better Than Alternative Flows
Skipping verification before charging might seem like a way to speed up the process, but it leads to more headaches down the line: higher support tickets, worse Stripe metrics, and unhappy users. By frontloading email verification, you filter out invalid or low-intent users early, ensuring that every Stripe subscription you create is tied to a real, engaged user.
内容的提问来源于stack exchange,提问作者Gilberg

