#ebellotpu6
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
this is why we don't really recommend this workflow for creating subscriptions
this is the recommended integration
where you create the subscription, and using the latest_invoice.payment_intent you send the client_secret to your front-end and use it with Stripe Elements
as explained in this step https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#create-subscription you can use payment_settings.save_default_payment_method: 'on_subscription' to save the PM for future usage off_session
and in all cases SCA is required upon the issuing bank's discretion and you should always be ready to ask your customer to come back to your app and authenticate the payment (3DS) if the PI is in requires_action status
So first I create the subscription and then i get the payment method?
yes this would prevent the "double" authentication
but with this I can first, provide the card details, then sign the contract and finally confirm the payment? Or should I sign first and then collect the card details to make the payment?
because I need 100% that the signed contract contains info about the payment method, so I need that the contract signs after get the paymentmethod but also I don't want that a customer complete a payment and doesn't sign the contract...
you can use https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_behavior allow_incomplete
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
hmmm, that's a bit tricky
yes, i know it, but is what the Product Owner wants...
thinking about a solution here
honestly I couldn't find any other way than what you're currently doing. SI then PI
which would entail 2 authentications
unless what you can do is once the SI succeeds you can update the customer's invoice_settings.default_payment_method and once you create the subscription if the PI has a status of requires_action then you can use https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-attached to authenticate 3DS
And what would happen if I set on_session to the payment and subscription?
Are you referring to this field?
https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage
Use on_session if you intend to only reuse the payment method when your customer is present in your checkout flow.
In your case it looks like you are creating subscription off_session
well, I am getting card info and after the customer signs a contract, I am creating the payment and subscriotion. This means offsession?
The PaymentMethod need to be configured for off_session as it'll be used later for renewal
You have two options, follow our recommended integration fr building a Stripe Subscription https://stripe.com/docs/billing/subscriptions/build-subscriptions
Or use SetupIntent and PaymentIntent as mentioned by my colleague previously