#fatematzuhora
1 messages · Page 1 of 1 (latest)
Now the hard part came.
- Our consumers can already upgrade/downgrade their subscriptions. Now we want at the time of upgrading/downgrading they can add a new payment method.
One solution that we implemented earlier is:
When the customer chooses the new payment method, we generate a setup intent, attach the payment method with the customer account first then upgrade/downgrade the subscription including the consumer's intended product ID + new payment method ID (we get it from the setup intent)
But this solution didn't fit with us because, with the 3DS secured card, the customers need to submit the OTP two times, the first time for attaching the card (setup intent) and the second time when our system makes a payment request for the upgrading amount.
And we don't like this solution.
On the other hand, if we create a new payment intent for adding a new payment method Stripe creates a brand new subscription and our customer loses the proration (also we've to remove the old subscription from the system and Stripe as well).
We're clear on this point that we don't want to use Setup Intent. Now the question is, is there any way to calculate the proration amount manually in this scenario? We really don't love to charge double to our customers.
But this solution didn't fit with us because, with the 3DS secured card, the customers need to submit the OTP two times, the first time for attaching the card (setup intent) and the second time when our system makes a payment request for the upgrading amount.
And we don't like this solution.
When updating the subscription,off_sessioncan be set to true that Stripe will inform customer is not in the session to perform 3DS and may greatly reduce the likelihood of performing 3DS
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But with 3DS card we need on_session right?
Because without the 2FA the payment will not complete.
It's up to the issuer to decide whether to perform 3DS, not about whether the card is 3DS enabled. When you inform that the customer is not in present to perform 3DS, then highly likely that the issuer won't request 3DS
How can I pass the off_session inside metadata?
Hi @bleak dagger I'm taking over this thread
Why do you want to pass off_session in metadata? Can you tell me what's the problem that you are trying to solve?
I'm not sure that's why asked where should I add it.
@worldly lion have been suggest me for the off_session
So, I wanted to give it a try
I believe river has already shared you the API reference: https://stripe.com/docs/api/subscriptions/update#update_subscription-off_session
Have you tried it out?
Can you give a code example?
For example I have tried
const id = 'sub_1Np1LEG0yaUrfkRbE2IpveHz'; // subscription id
const oldSubscription = await stripe.subscriptions.retrieve(id);
const updateObj = {
items: [
{
id: oldSubscription.items.data[0].id,
price: 'price_1MBq3jG0yaUrfkRbeCO3yVtE' // new product id
}
],
proration_behavior: 'always_invoice',
billing_cycle_anchor: 'now',
cancel_at_period_end: false,
payment_behavior: 'default_incomplete',
off_session: true
};
const subscription = await stripe.subscriptions.update(id, updateObj).catch((err) => console.log(err));
and I got the subscription status become past due
Because ot the 3DS secure card
Here is subscription ID: sub_1Np1LEG0yaUrfkRbE2IpveHz
You can check
Hi, anyone available?
Thanks for waiting, discord is busy today
This is going to require a bit more investigation. Sorry to redirect you, but can you write in to https://support.stripe.com/contact/email with the information that you provided. We'll respond via email/ticket after looking into it further.
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.