#carter-bryden_api-account-support
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1319759650320551946
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
carter-bryden_api-account-support
@zinc vigil :question: Have a non-technical question, account issue, or need one-on-one support? We wish we could help, but this community is focused on developers and technical discussions. Our support team will be able to assist you better than we can: https://support.stripe.com/contact
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.
Sorry, I mean through the API. I can't find a way to set the mandate maximum amount mentioned in the India recurring payments article.
At least in the checkout session create API endpoint. Is it possible?
Good question, can you link to the doc that you are looking at? Trying to find whether that is settable in Checkout
https://docs.stripe.com/india-recurring-payments?integration=subscriptions#subscription-updates
It mentions the mandate maximum amount there
As a side note:
The other thing that customers from India with this problem have noticed, is that they get a blank page when they try to update their payment method through the hosted billing portal.
When I investigated, I found it was returning a 400 error related to not being able to change a payment method with a mandate in the browser dev console. I'm not sure where to report that bug, but it seems like something Stripe will want to at least display a message for.
So unfortunately it looks like Checkout doesn't have access to this parameter. Normally this setting is payment_method_options.card.mandate_options like this field on a SetupIntent
https://docs.stripe.com/api/setup_intents/update#update_setup_intent-payment_method_options-card-mandate_options-amount_type
But for Checkout Sessions, payment_method_options.card does not have a mandate_options property for these settings
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_method_options-card
And yes definitely that seems like a bug that should be fixed with the customer portal. If you walk me through steps to reproduce that issue I am happy to escalate that to my colleagues that work on the customer portal. So you set up a subscription with an IN customer, use a link to the customer portal, and then just try to change the payment method? Or are there more steps in there
I think that's pretty much right, except it might need to fail a payment first? As far as I can tell they've only tried after a payment has failed so I don't know for sure.
One sec and I can get you the actual error
Okay, so the URL that's 400ing is https://billing.stripe.com/v1/billing_portal/sessions/bps_1QYCwyGkdRmyGPKhl3MTtb36/payment_intents/?include_only%5B%5D=id%2Cobject%2Cclient_secret%2Cstatus%2Cpayment_method_types
And the response is:
{
"error": {
"message": "Mandate or subscription exists with given reference: sub_1OoS4vGkdRmyGPKhRAjLMO4T - 1728143888",
"message_code": "india_card_mandate_options_duplicate_reference",
"request_log_url": "https://dashboard.stripe.com/logs/req_m3k6bmmrtNBnV9?t=1734727079",
"type": "invalid_request_error"
}
}
So it might actually be about having a payment method duplicated? This user seems to have added their card a couple of times, I think to pay invoices manually maybe.
And thanks for checking on the checkout session mandate parameter for me. So basically if I want to be able to set that, I'll need to manually create a subscription for now?
Through the API subscription create endpoint I mean.
Is there any chance that the checkout sessions API will have those mandate parameters added any time soon?
Unfortunately I can't guaruntee if/when those params will be added. I will make sure to file a feature request or add to an existing one for this in a moment. Looking for the best way for you to set this now
We do support them for the standalone subscriptions API, so you are right that creating subscriptions directly would be the best way to do this right now. One thing that may help you here is that after you create the subscription and it has an open invoice, invoices have a Stripe-hosted URL that you can send your users to, so you can do this change without needing to build your own custom page for payments.
https://docs.stripe.com/api/subscriptions/create#create_subscription-payment_settings-payment_method_options-card-mandate_options
https://docs.stripe.com/api/invoices/object#invoice_object-hosted_invoice_url
Though if you do want to build a custom page, we do have these docs for our flows for that
https://docs.stripe.com/billing/subscriptions/build-subscriptions?platform=web&ui=elements
https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription
So with that flow I'd need to create a subscription on my side through the API, then send them to the invoice payment page where they'd add a payment method, is that right?
Exactly
Interesting, okay that might work. I'm trying to figure out if there's some reasonable way to only do that if they'll likely need a mandate like that, but I can't think of a way short of doing it for all customers with Indian IP addresses. Which won't catch them all.
Might just need to switch off of the checkout to that for a while then
Yeah unfortunately we don't have anything build in that would help you route things like that. Happy you have a solution at least though I do understand that it isn't an ideal one