#ricardodias
1 messages ยท Page 1 of 1 (latest)
Hello ๐
You would typically use confirmCardSetup with SetupIntents to store the payment method for future usage. With SetupIntents, there is typically no charge associated of a specific amount (sometimes you may see $0 or $1 auth charge on your statement but its reversed later)
For a Payment, you'd want to use confirmCardPayment function instead.
thank you @frigid fiber
did that help fix the issue you're having? ๐
Kinda. We have a system of subscriptions, so we are using SetupIntents to save the user information. The problem here, for what I understood, is that with this logic we can't inform the user of the amount, because we are using confirmCardSetup.
Do we have a choice here? If we use PaymentIntents, can we tell stripe that this is a subscription and charge a amount every month, for example?
If your goal is to create the Subscription off-session (when the customer isn't around) then you'd need to use the SetupIntent first and store the payment method information.
If your customer is on-session then you can instead
1/ Create a subscription
2/ Get client_secret by locating Subscription -> latest_invoice -> PaymentIntent -> clientSecret
3/ Use confirmCardPayment client-side
in step 3. if the payment fails, we need to request a cancelSubscription right way correct?
Why not the opposite way? confirm first the card and then, if successfully, we create the subscription
Its just because we need the response from the createSubscription function?
You can set the payment_behavior to something like default_incomplete where the subscription will only transition to active state if the payment succeeds
https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_behavior
Ok. In this case, Stripe knows if the setupCardPayment is successfully and changes the subscription status to active
Is this correct?
๐
Stepping in
So unless you are using a trial period, you don't want to be using setupCardPayment
You use confirmCardPayment as my colleague noted above to attempt to complete the first charge of the Sub
If that charge is declined, you can have your customer attempt again using a different payment method. If they don't successfully complete the Charge within 23 hours, the Sub will be automatically canceled (it will move to a status of incomplete_expired)
We dont have payed trials. Only full free or subscriptions.
I think we are just using the wrong flow and functions. The way you guys are describing it, its way more simple and less error prone
confirmCardPayment it is. thank you guys ๐
Sure thing