#montero_invoice-pay

1 messages ยท Page 1 of 1 (latest)

rare daggerBOT
hollow edgeBOT
#

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.

rare daggerBOT
#

๐Ÿ‘‹ 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. Thank you for your patience!

โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.

๐Ÿ”— 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/1214598914628517949

๐Ÿ“ Have more to share? You can add more detail below, including code, screenshots, videos, etc.

autumn heron
#

Hey, just for some more info, this is how I'm creating the invoice initially for the customer.

What I'm trying to do now is that the user clicks a "Pay Invoice" button, and we trigger something in the back-end so the invoice is paid with the payment method they initially entered.

I know that they should be able to pay through the invoice url too, but I want to facilitate the process so we use their current payment method.

hollow edgeBOT
grim tapir
#

Hi ๐Ÿ‘‹ how are you creating the customer's Payment Method that you're trying to use for this?

autumn heron
#

Hey, sec let me find the code

#

I'm collecting the bank information in the front-end.

Then, in the back-end I'm attaching that payment method to the customer

#

Here as you can see, it's working properly

grim tapir
#

Hm, do you have the ID of a Payment Method from your testing that you can share?

autumn heron
#

Sure, sec

#

pm_1Oktd6EJRALi1vex0rwrF5WP

#

This is the error message I'm getting. Something about a mandate. When running this code.

grim tapir
autumn heron
#

It is not clear to me the mandate part -- I'm showing a mandate in the front-end that I've made manually. Is there a way to show it programatically using a Stripe specific function, or something?

grim tapir
#

I don't think I'm grasping what you mean. A Mandate was created on 2/17, then some action was taken that caused it to expire (not sure exactly what offhand) on 2/26. That Mandate moving to an inactive state is why payments can't proceed.

I don't think the endpoint to pay an Invoice will let you do so, but if you still have the details of the mandate, can you try confirming the underlying Payment Intent and populate mandate_data with those details:
https://docs.stripe.com/api/payment_intents/confirm#confirm_payment_intent-mandate_data

autumn heron
#

Oh -- another question.

I've already tested this same code, and if I run the pay invoice function right after creating the invoice, it works properly.

Could that be the reason? Waiting too long?

My intention is to send an invoice to the client, and give them 15 days to pay it

grim tapir
autumn heron
#

But why when I tried to pay it manually in Stripe Dashboard by pressing "Retry Payment", it worked?

grim tapir
#

What did, do you have specific IDs?

autumn heron
#

Invoice is in_1OqzsSEJRALi1vexF5UGIMZN

#

I think these two parameters were missing

grim tapir
#

That used a different payment method, one which had an active mandate.

autumn heron
#

But why did it use a different payment method? Shoudn't it use the customer default pm?

hollow edgeBOT
grim tapir
#

I don't know, I don't know exactly what you did. My guess is the dashboard UI you used allowed you to select a Payment Method, and a different one was selected than was used before.

echo orchid
#

montero_invoice-pay

autumn heron
#

Okay I see. Looks like the customer has multple payment methods attached. The default one happens to be inactive. To be honest I don't know why it has multiple and why the default one has an expired mandate