#elbek-customer-defaultpm
1 messages · Page 1 of 1 (latest)
Hello
You said: ```This PaymentIntent requires a mandate, but no existing mandate was found. Collect mandate acceptance from the customer and try again, providing acceptance data in the mandate_data parameter.
Are you trying to charge this bank account using a PaymentIntent?
@keen plover tagging you here to make sure you see this thread
no, I am trying to settle the invoice using bank account as a payment method
customer has bank account linked as a payment method
then I generated an invoice for the customer
strip cannot money out of bank account and fails with this error when we trigger invoice pay
@upper surge
Can you share the request ID where you see this error?
Thanks, looking

Okay so the issue is that you set the bank account as the invoice_settings.default_payment_method
You basically don't want that here
Since that is for using PaymentMethods with our newer flow
Which requires a mandate
Try removing that and just have the bank account set as default_source
Then attempt to pay the Invoice again
Ok, so I need to make bank account as default_source for the customer?
Or another question is how do I setup bank account as default source
which api I should use?
It is already the default_source, the issue right now is that it is both
It is automatically set as the default_source when you attach it to the Customer
Thanks Bismark. I will try it. Sounds promising
👍
What should be the value for the source field?
is it payment method id? something like pm_.... ? @upper surge
No it would be your bank account ID
Like what you are already doing here: https://dashboard.stripe.com/logs/req_kgTKxLDol2F5AU
I see, makes sense. How about if we want to make cc as a default source
what would be the value for the field? @upper surge
Depends a little bit on your integration
Are you working with Card objects?
That look like card_xxxx ?
Hi, stepping in and catching up
@upper surge
Bismarck needs to step away, I'll help further here
Thanks @limber otter
the above picture is card I have for the customer
it has pm_ id
how do we get card_xxx id from it?
I do not think you'd want to the card_id here, the above payment method is different than what you shared with my teammate.
How are you creating the payment method here?
Can you share the request id where you created the payment method? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
just a second
It calls this to create a session
/v1/checkout/sessions
req=req_wI2knrgqR3XKJF
then
it attaches this payment to the customer
req=req_CHm4tMJznDNMIY
Taking a look
it uses strips element ui
from there customer fills the form to attach a pm to himself/herself
So that one worked correctly, req_x0zYKjnDWxhuoh as you used Stripe Checkout in setup mode. In this case, we collect all necessary data to charge the customer later.
my question is say if user marks the bank as a default source then later deletes the bank pm but his cc is remaining
do I need to update the customer's source to point to cc?
To add some context, sources is our legacy product. It is recommended that you use Payment Methods like you're doing on that seconds example. When the payment method is detached from the customer, https://stripe.com/docs/api/payment_methods/detach it can't be used anymore. Also, you can only have one default payment method. So, in the case that the payment method is detached, you can set another default payment method to the customer, https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method. You'd need to make this call explicitely.
I did
I set bank as a default payment method
then I got the initial error
that is how everything started
right now ba_xxx is set as invoice's default payment method
when ba_xxx is a default pm I get following error
{
"error": {
"message": "This PaymentIntent requires a mandate, but no existing mandate was found. Collect mandate acceptance from the customer and try again, providing acceptance data in the mandate_data parameter.",
"request_log_url": "https://dashboard.stripe.com/logs/req_7L0JwCbXgrsMVY?t=1707334241",
"type": "invalid_request_error"
}
}
then I was tolkd to use default source
bank_xxx is linked using plaid
How do I set bank account or card as a default payment method?
if I use this api it is causing issues as I posted above
https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@limber otter Need your help here
The initial error is because you're not using the Checkout Session in setup mode. You're creating a token here, https://dashboard.stripe.com/logs/req_vBOTu5Kh6tRU6M. In this case with sources, you need to remove that bank account from the invoice_settings.default_payment_method and just have the bank account set as default_source.
You are micing two different flows here. The above recommendation was for when you were using the Payment Method.
ok, we have multiple pay methods can be setup
it can either be bank or card
so when bank is set as default then I do use customer.default_source to set as default payment?
Yeah, so in this case, remove the ba_ from invoice_settings.default_payment_method
if customer wants to chose cc as a default pm then use invoice_settings.default_payment_method?
this part I understood
but how about if it is cc
do i use this path for making it as a default pay method?
for cc case invoice_settings.default_payment_method
Ah, on the same page now. If you're not creating the card_ with tokens, no. However, if the credit card is from a Payment Method, then yes you'd need to set that up.
Yeap, in this case, you'd want to make that the invoice_settings.default_payment_method after you removed the bank account.
Sure!
ok, it seems it is not remoing from invoice setting
can you see this req
I am sending source only
response has "invoice_settings": { "custom_fields": null, "default_payment_method": "ba_1OMRn3DVbSo80Vu45HnWwsED", "footer": null, "rendering_options": null },
what is the right request?
to remove default_payment_method from invoice setting to ba_xxx case
Your requests are not removing it, it's just passing the sorce on the update request. You'd need to unset https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method.