#datedm
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Just to be clear when you say
with a customer portal checkout flow.
Do you mean the Customer Portal
https://stripe.com/docs/customer-management
Or Checkout?
https://stripe.com/docs/payments/checkout/how-checkout-works
They are two very different products
Okay. So you are creating Checkout Sessions in subscription mode with a free trial included as part of the subscription
correct.
Since there's no charge there's no authorization until the free trial is over at which point the scammers have already used your service for the length of the trial, correct?
yes. our UI will change after the card is rejected and our service becomes unusable until they add a valid payment method.
But - they are just making totally new accounts and using the same bad cards to get more free trials.
Well, you could use Checkout to save the payment method by change the mode to setup https://stripe.com/docs/payments/save-and-reuse?platform=checkout and then create the Subscription after the user has saved their payment method
im not following you
how will that prevent them from using cards with invalid funds on them
When you attach a new payment method to the Customer record it will trigger a card validation
ahh ok
one moment, i have a couple more questions but im tied up right now, ill reply in a few
How does that flow create a free trial? Can you create free trials the same with setup mode?
also, does this charge the user anything? or does it validate the card without charging them
No. setup mode only created a saved payment method on the customer which will trigger card validation. After the payment method is saved, then you create a subscription with trial using Subscription API (not Checkout Session API) and attach the saved payment method to the subscription: https://stripe.com/docs/billing/subscriptions/trials
So, is this the flow you're suggesting:
- User clicks sign up
- Create a checkout session with mode
setup - User enters card details
- User submits form
- Use
checkout.session.completedwebhook to listen for completion - On completion, grab the setup intent and attach it to the customer
- If the card validation passes, create the subscription with the free trial
- If the card validation fails, do not create the subscription and tell the user in the UI somewhere that their subscription creation failed due to a bad card
- On completion, grab the setup intent and attach it to the customer
This step is not required as setup intent will attach the payment methods to customer
- If the card validation passes, create the subscription with the free trial
In addition to this, setdefault_payment_methodof the subscription to the payment method (pm_xxx) created during Checkout Sessionsetupmode: https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.