#mcmanuel_api
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/1493682072727060550
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- mcmanuel_api, 1 hour ago, 13 messages
hi there,
can you share a request ID, where this error appears?
Hi, yes sure
req_6yWeEr2GnTYQbM
When I look into the customer's payment method it looks like it has a mandate
cus_UKrUjdry2SG7cl
Thanks for the IDs, looking in to this
Don't hesitate to ask me if you need any code samples or anything.
Of course, I think I'm clear on what happened code-wise. I am a bit confused because I do see an active mandate still exists for that PM. I think explicitly passing the mandate param with the /pay call would fix this but I'm fairly sure you should be able to make this payment without tracking that.
https://docs.stripe.com/api/invoices/pay#pay_invoice-mandate
Well I did try that on multiple occasions and got another error message. I will try to do it again and tell you what is happening
New request ID :
req_2UPkFXJbKrW0Um
New invoice :
in_1TMCPnAbK99ANxmeiEVlmZ3r
I hardcoded the mandate id, because I don't save mandate ID in database atm.
$this->stripe->invoices->pay($stripeInvoice->id, ['mandate' => 'mandate_1TMBlcAbK99ANxmedwM096BQ']);
Now I am getting this error
You cannot provide both a mandate id and mandate information to payment_method_options.
I don't set the madate anywhere else so my guess is that Stripe is already setting a mandate on the API side.
Ah I found it, there is a parameter called default_for that you need to pass in your SetupIntents that save these payment methods. I am not immediately clear on why but without setting that param at set up time, we can't automatically use the resulting mandates for invoices and/or subscriptions https://docs.stripe.com/api/setup_intents/create#create_setup_intent-payment_method_options-acss_debit-mandate_options-default_for
I had it before, but earlier today one your coworker told me to add those parameters to the mandate in the setup intent :
'payment_schedule' => 'interval',
'interval_description' => 'first of the month',
Those don't work with default_for parameter ad it results in a 500 error when trying to create the SetupIntent :
The following params are not allowed when payment_method_options[acss_debit][mandate_options][default_for] is provided: ["payment_method_options[acss_debit][mandate_options][interval_description]", "payment_method_options[acss_debit][mandate_options][payment_schedule]", "payment_method_options[acss_debit][mandate_options][custom_mandate_url]"].
I still tried it and got another error :
req_xh17P5cRyB0JiK
PM :
pm_1TMCmNAbK99ANxmegiLEaCpf
yeah, I was talking about the SetupIntent when creating a PM in another part of my code
Now my SI mandate looks like this
$setupIntentOptions['payment_method_options'] = [
'acss_debit' => [
'currency' => 'cad',
'mandate_options' => [
'transaction_type' => 'business',
'default_for' => ["subscription", "invoice"],
],
'verification_method' => 'instant',
],
];
Before it was
$setupIntentOptions['payment_method_options'] = [
'acss_debit' => [
'currency' => 'cad',
'mandate_options' => [
'transaction_type' => 'business',
'payment_schedule' => 'interval',
'interval_description' => 'first of the month',
],
'verification_method' => 'instant',
],
];
mandate_1TMBlcAbK99ANxmedwM096BQ seems to be inactive
Yeah I deleted the old PM to get make the new one using default_for like Pompey asked me
New PM is :
pm_1TMCmNAbK99ANxmegiLEaCpf
New Mandate is :
mandate_1TMCmQAbK99ANxmenO52Am61
Sorry, there are too many IDs shared so I'm probably looking at the wrong stuff.
Can you share a request ID where you used the new PM?
Ik it gets a little confusing with all the tests we made, sorry abt that
yeah sure hold on a sec
This is the latest req :
req_xh17P5cRyB0JiK
Associated with invoice :
in_1TMCmmAbK99ANxmeQRCsPb7C
Customer :
cus_UKrUjdry2SG7cl
PM :
pm_1TMCmNAbK99ANxmegiLEaCpf
mandate_1TMBlcAbK99ANxmedwM096BQ mandate is inactive as well which is what you hard coded to req_xh17P5cRyB0JiK
My bad you're absolutly right
Latest : req_7gsDMJIQnyXiEk
Ok I removed the hardcoded mandate and it seems to work now !!
Oh my god it did
Awesome ๐
NP! Sorry for the delay