#alko89
1 messages · Page 1 of 1 (latest)
Hi there!
There's no built in option in Stripe to do this no. But you could build that logic on your end.
checking the card fingerprint?
Yes exactly. But how to do this exactly depends on your current integration. How are you creating the Subscriptions?
we're using checkout sessions
With Checkout Session, you can only know the details of the card used after the Subscription is created, so it's a bit tricky.
does your subscription has a free trial? If so, you could cancel the subscription after creating it if the payment method was already used.
can I get the card from checkout.session.completed webhook?
Yes, but at that point the Subscription is already created.
But if you use trials, you can simply cancel that subscription yes.
ok perfect!
one more thing, I want the trial to not be free, but discounted
was thinking to use a "setup fee" when creating subscription
can I simply add payment_intent_data to the checkout session?
You have two options for this:
- Replace the free trial by a discount on the first month: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-discounts
- Or keep the free trial and in
line_itemsuse two price: the recurring price and a one-time price
However, if you do this, and the user used an existing payment method... what will you do?
You can still cancel the Subscription, but since there was already a payment made, you should also refund the user.
ok, I think I have all I need for now, thanks! 🙂