#eirikbakke
1 messages ยท Page 1 of 1 (latest)
The subscription update/downgrade happens in backend, and it doesn't invovle payment unless you set proration_behavior=invoice_immediately.
Yes, that's the intent here.
invoice_immediately
Basically exactly like the Billing Portal would do it--except due to limitations of the Billing Portal I appear to have to implement it myself.
(Most importantly the fact that the Billing Portal cannot allow users to upgrade the quantity without also allowing them to downgrade it.)
1/ The Billing portal allows user to upgrade and downgrade
2/ I don't see why introducing 3DS is relevant here
The requirement is to allow users to upgrade (but not downgrade) their subscription with immediate invoicing/payment for the difference. During this payment 3DS could be required.
OK. You can also configure billing portal in the way that it doesn't allow downgrade by excluding the list price IDs that you don't want your customer to update to (https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-products-prices)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
About the 3DS, you can create a Radar rule that to request for 3DS when a certain condition is met (i.e., metadata=xyz). So that you can listen to invoice.created event, and set the metadata on its PaymentIntent object to trigger 3DS.
I'm thinking of the case where the user's card is what triggers 3DS, rather than me requesting it myself. Can the 3DS authentication happen on-session, rather than in response to a webhook?
(I'd really love to do this from the Billing Portal, and might try to find a hack to do it... just investigating my options here)
(Thanks for the idea of hiding the price ID; the upgrade here is in terms of quantity rather than to a different price, but something similar could be done by making a configuration with a minimum quantity.)
https://stripe.com/docs/payments/3d-secure#manual-three-ds here's how you manually trigger a 3DS. However, since the PaymentIntent is created by the invoice, you still need to listen to the invoice.created event, get the PaymentIntent object and set its payment_method_options[card][request_three_d_secure] to any.
You may not need to use the metadata + Radar solution that I proposed earlier. That solution requires additional effort but that's something allow you enable/disable 3DS request by updating Radar rules without changing your code.
OK, i have a feeling that it's a bad idea to try to do the payment on my own page.
Perhaps you could forward a feature request to the engineers working on the Billing Portal: I'd love an option to allow upgrades to happen with immediate billing, while requiring downgrades to happen at the end of the billing period (so that customers never end up with a "account balance credit" from unused proration). Or just prevent downgrades; it may be OK to simply require the subscription to be canceled in this case.
Sure I'd let the relevant team know about it.
Thank you! Sorry for the hairy question ๐