#ricardodias

1 messages ยท Page 1 of 1 (latest)

lucid hillBOT
frigid fiber
#

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.

proven beacon
#

thank you @frigid fiber

frigid fiber
#

did that help fix the issue you're having? ๐Ÿ™‚

proven beacon
#

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?

frigid fiber
#

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

proven beacon
#

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?

frigid fiber
proven beacon
#

Ok. In this case, Stripe knows if the setupCardPayment is successfully and changes the subscription status to active

#

Is this correct?

shut wolf
#

๐Ÿ‘‹

#

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)

proven beacon
#

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 ๐Ÿ™‚

shut wolf
#

Sure thing