#vpaniza
1 messages · Page 1 of 1 (latest)
Hey there, I can't re-open threads but if you would summarize the issue then I would be happy to help.
Hey! sure, this was the issue I was trying to assess:
I am trying to apply 100% discount coupons on particular subscriptions (e.g B2B2C customers), but ideally, I would like to get their payment method details in case something happens with my product or whatever
And the solution proposed was to (I as previously using paymentIntents), to use setUp intents for getting a client_secret, in combination with "on_subscription" when setting the payment_settings.save_default_payment_method
And that definitely works on 100% subcriptions. The paymentmethod is saved in case the subscription discount conditions change. But now, regular subscriptions, with no discounts, remain as incomplete on this process
Gotcha
That's because with a regular Subscription you don't have a SetupIntent
Instead you have a PaymentIntent
And you use that client secret
And set the same payment_settings.save_default_payment_method
And then on successful payment the PaymentMethod will be set as the Sub's default
So you want the subscription.latest_invoice.payment_intent.client_secret to pass to the frontend
Instead of the subscription.pending_setup_intent.client_secret
So what you're basically saying is that I need two different flows, one for discount subscriptions and another for regular subscriptions ?
Yes if it is a 100% off discount
yeah, exactly. just for 100% or for any % that would be the equivalent to an amount BELOW the minimum charge?
Yep correct
Thank you very much, I was struggling finding a way to just use either setup intents or payment intents