#mcmanuel_api

1 messages ยท Page 1 of 1 (latest)

noble lanternBOT
#

๐Ÿ‘‹ 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.

glossy plaza
#

hi there,
can you share a request ID, where this error appears?

meager helm
#

Hi, yes sure
req_6yWeEr2GnTYQbM

#

When I look into the customer's payment method it looks like it has a mandate
cus_UKrUjdry2SG7cl

noble lanternBOT
faint quail
#

Thanks for the IDs, looking in to this

meager helm
#

Don't hesitate to ask me if you need any code samples or anything.

faint quail
#

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

meager helm
#

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.

faint quail
meager helm
#

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

noble lanternBOT
supple thorn
#

Hello
Taking a look ๐Ÿ‘‹

#

that API request has a 400, not a 500 response right?

meager helm
#

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',
],
];

supple thorn
#

mandate_1TMBlcAbK99ANxmedwM096BQ seems to be inactive

meager helm
#

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

supple thorn
#

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?

meager helm
#

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

supple thorn
#

mandate_1TMBlcAbK99ANxmedwM096BQ mandate is inactive as well which is what you hard coded to req_xh17P5cRyB0JiK

meager helm
#

My bad you're absolutly right

supple thorn
#

mandate_1TMCmQAbK99ANxmenO52Am61 is the correct mandate

#

for the new PM

meager helm
#

Latest : req_7gsDMJIQnyXiEk

#

Ok I removed the hardcoded mandate and it seems to work now !!

#

Oh my god it did

supple thorn
#

Awesome ๐Ÿ™‚

meager helm
#

Well, thanks a LOT to you all

#

Been struggling a lot.

supple thorn
#

NP! Sorry for the delay