#NEWJOSSY
1 messages ยท Page 1 of 1 (latest)
In cases where there is no initial payment (i.e. free trial, 100% discount) then we won't generate a Payment Intent โ you can't have a zero-amount Payment Intent.
Ok, but why there is no client secret for 99.9 discount
Instead, you'd confirm the pending_setup_intent field on the Subscription: https://stripe.com/docs/api/subscriptions/object#subscription_object-pending_setup_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Depends on what the actual discount amount it. We have minimum charge amounts. If the total is beneath that, then there's no payment and we'll debit the customer balance (to be paid on the next invoice)
How big is that limit when payment intent will be generated ?
Depends on your settlement currency: https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts
Oh, ok, thanks
In cases where there's no latest_invoice.payment_intent, you'd use the pending_setup_intent field as stated ๐
Can this be used for confirmPayment on the front-end ?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I mean if there is a 100% discount we need to use setup intent client secret, right?
You'd use confirmSetup: https://stripe.com/docs/js/setup_intents/confirm_setup
Oh
Correct yes. So you'd need logic to check the returned Subscription object after creation and see whether pending_setup_intent has a value. If it does, use that client_secret with confirmSetup
Otherwise use latest_invoice.payment_intent with confirmPayment
Ok, one more question to clarify
Currently we are using confirm API where we check payment_intent
by its id
if its status == PaymentStatus.Succeeded we are confirming update and making changes to our db to change some restrictions
but if we use setupIntent, what changes should be done?
What do you mean by 'confirming update'?
Is this for provisioning/fulfilment?
I guess so, we are applying changes for payed subscription plan only if payment was succeed
General recommendation is to rely on invoice.paid for that: https://stripe.com/docs/billing/subscriptions/webhooks
That will account for both Setup Intent and Payment Intent scenarios