#joexn - bacs and cards

1 messages ยท Page 1 of 1 (latest)

buoyant wolf
#

Hello, that should be possible but you may need to make two API calls. What kind of errors are you getting now?

shrewd abyss
#

I can do it with two calls, but I'm wondering if I can specify multiple type in one call. It doesn't seem to accept an array but logically, I thought it would have.

buoyant wolf
#

Unfortunately it does not accept multiple types at the moment. I can put in a feature request for that but can't promise that that would get added

shrewd abyss
#

That would be good and thanks for confirming. I hoping it does get looked into, most calls accept arrays for various things so it would make sense.

buoyant wolf
#

Yeah I definitely get how that would be useful. Will file the request.

#

Anything else about this that you are currently looking in to?

shrewd abyss
#

There was one other issue with the bacs_debit payment method - live chat couldn't help so someone from support sent me an email but my reply wasn't answered.

Essentially I've got two direct debits on a customer which are with the same bank (second was created to test)... the first one doesn't let me create a payment_intent because it says something about not having a mandate but the second one (the new one) does work fine.

#

The error is 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.

#

But theres no way for me to tell that this doesn't have a "mandate" from what I can see. It was created online via our Stripe checkout integration.

Our second test one, which we added last week works fine. I can't see a difference between the two payment_methods on the customer so I would like to know why one works and one doesn't

buoyant wolf
#

Can you send me the ID for each payment method? I can check in to them.

#

Also do you have the request ID (req_123....) from a time when you tried to create a payment intent but got that error?

shrewd abyss
#

Should I send them here or via DM? If thats possible?

#

I don't know how Discord works

buoyant wolf
#

IDs are safe to send in the public chat

#

No one but you can do anything with those IDs

shrewd abyss
#

The payment_intent is: pi_3LSnTPAPYpSJ8pLB32nevVPa for the one I just made that failed.

The payment method (that doesn't work) is: pm_1J18ebAPYpSJ8pLBSnnFASV7

The payment method (that does work) is: pm_1LR29YAPYpSJ8pLBTWKfSHV6

Please note these are all on live mode at the moment as we tried billing this client an realised it doesn't] work.

buoyant wolf
#

Thank you for the IDs, checking in to them

buoyant wolf
#

Apologies for the delay, still looking in to this. I can see that there is a mandate for both payment methods but am unclear on why what worked for one wouldn't work for the other

#

Do you have the ID of the payment that succeeded with the PM that is working?

shrewd abyss
#

Yes, pi_3LR2C9APYpSJ8pLB0cRsV99E

#

Thank you

buoyant wolf
#

Thanks again, checking in to those

#

It looks like the mandate for the second account is not active anymore though I am not sure why. Checking with my colleagues and will get back to you with what we can find

buoyant wolf
#

Okay, so there are two ways that you can keep track of whether your mandates are still valid. Either you can listen for mandate.updated events for and store the status from that in your system, or you can look up the SetupIntent that was used to create the mandate via your payment method's ID and check the status of the mandate that is returned on that SetupIntent
https://dashboard.stripe.com/events/evt_1JBDY2APYpSJ8pLBqQ9UQ9pr

shrewd abyss
#

Thanks โ€“ question though, why did it expire? And why does Stripe not remove the payment_intent if it has expired? It's my understanding that you can't regenerate a mandate once it's cancelled.

glossy nova
#

what does "not remove the payment_intent" mean?

#

if you look at the event my colleague shared it has the exact information about why it got revoked

shrewd abyss
#

Sorry - I meant remove the bacs payment method as it has expired and yes, he said "It looks like the mandate for the second account is not active anymore though I am not sure why" โ€” do you know why yet? Is there an expiration on bacs debits as we didn't cancel it from the bank side?

#

It doesn't seem like it says much to me

glossy nova
#

so yeah no reason to delete the PM, like you can totally re-collect a Mandate with an existing PM using SetupIntent

#

if we detached you'd have to re-collect bank account and all that so it's a hassle and we give you the option to do whichever you prefer

#

And that mandate was revoked so it usually means the bank told us to stop debiting it likely because the customer asked their bank

shrewd abyss
#

I did try to add mandate acceptance but it said that my account is limited and couldn't perform that action

#

Ah thank you for letting me know โ€“ it's actually our business bank account so I'm guessing the bank might have expired it due to the lack of payments.

glossy nova
#

And weird what error did you get when you tried? Maybe it's because BACS is stricter than most and requires you to re-collect everything but that seems like a weird limitation. You could also ask for access to that feature

shrewd abyss
#

I did - but didn't get a response from support.

When I got this error (due to trying to take payment from the payment_method with no mandate):
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

I tried passing mandate_data to the new payment_intent but it said this:

Your account is not configured to allow passing mandate_data directly when confirming PaymentIntents for Bacs Direct Debits. Please see https://stripe.com/docs/payments/payment-methods/bacs-debit for more information or contact bacs-debits@stripe.com.

#

They emailed me on 30 July 2022 at 5:09 AM and I replied at 12:33PM but haven't heard anything since.

#

This is the full API call, with the error. I assumed that I could have just reactivated it like the first error message says but appears to be an account issue.

#

Also, is there an easier way to see if a mandate is active directly from the payment_method object? I'm surprised the Stripe dashboard doesn't show active mandates - GoCardless does and it was really useful - could that be passed on for a possible feature request?

glossy nova
#

yeah I think it's because BACS is really strict with mandate collection and such and you likely have to re-collect payment details at the same time as the new mandate ๐Ÿ˜ฆ

#

And no there isn't an easier way right now, usually you track mandates in your own database since they are really specific to what you are doing. BACS and ACSS both have really strict scheme rules on when you can debit, for what, how often, banks can revoke mandates, etc.

shrewd abyss
#

That's a shame - I'm guessing there is a BACS rule that means banks need to revoke mandates if they're "stale" too - as we definitely didn't cancel the mandate.

We currently store the payment_method in our database, we don't store any actual mandate reference or such... I'm guessing we should be doing this? If so, is it possible to take payment using the mandate reference?

glossy nova
#

yeah I would recommend storing the mandate id in your database with the PaymentMethod id

#

and no, mandate reference are just a record, you can't pass that in the API

shrewd abyss
#

Ok, but can I lookup using the mandate reference to check status? How would I see it's status proactively using the payment_method ID?

#

I've run https://api.stripe.com/v1/setup_intents?payment_method=pm_1LSmb0APYpSJ8pLBCxlgJkrl and can now see the seti_1LSmaBAPYpSJ8pLB6sJrRwbz

#

So just query that endpoint and I'll see the status I assume?

glossy nova
#

there's no look up

#

so really you would cache that information and that's easier

#

But yes what you have works for BACS since you would get a new PaymentMethod for a new Mandate (which is not true for other payment methods)

shrewd abyss
#

Ok, so it works this way:

List customer direct debits:
https://api.stripe.com/v1/customers/cus_***********/payment_methods?type=bacs_debit

Get setup_intent based on payment_method:
https://api.stripe.com/v1/setup_intents?payment_method=pm_*********

Get mandate data from setup_intent mandate reference:
https://api.stripe.com/v1/mandates/mandate_**********

To which it returns:

"payment_method_details": {
        "bacs_debit": {
            "network_status": "revoked",
            "reference": "*********",
            "url": "********"
        },
        "type": "bacs_debit"
    },
#

That is complicated if I don't store the mandate_ref originally! I definitely think this could be improved and mandate status could be shown on the dashboard otherwise there is no way to see mandate status if you don't use the API and use Stripe directly (like our accounts team)

glossy nova
#

Yeah agreed on improving the Dashboard. But you can have many Mandates for one PaymentMethod (except BACS Debit)

#

and so it would make the Dashboard mostly unreadable in most cases. It's just a strange limitation (due to the network scheme) for BACS

shrewd abyss
#

Even a 'mandates' page would be better, just somewhere to see the status of them.

glossy nova
#

I thought there was one

#

looking

shrewd abyss
#

This is one of our GoCardless customer bank account pages. Lists the bank and then mandates under with a detailed status and history once clicked on

#

Was really useful to be able to see the mandates on the web

glossy nova
#

yeah I'm surprised there isn't one, I'll flag internally

shrewd abyss
#

Thanks, because there is no way for anyone to know that one of these is dead and will need fully resetting up on the customer page

glossy nova
#

yep totally agree it's not great

shrewd abyss
#

Slight issue as well, if the mandate is dead - how can we remove this from the customer page using the web?

glossy nova
#

you can't, you'll need to use the API today

shrewd abyss
#

BACS direct debits need a lot of work in my opinion. Don't get me wrong, we're really happy with Stripe and glad you do support BACS now as we can have all payments with yourselves but being able to see this on GoCardless compared to seeing nothing and not even being able to delete the payment method is really bad all of our staff who don't use our Intranet and use Stripe web.

#

Could this be raised? It's really limiting at the moment

#

But thank you for all your help today. You've really cleared things up - very glad I found the link to the discord on the support page!

glossy nova
#

I don't disagree with your feedback. I have raised some of those myself over the years ๐Ÿ˜ฆ

#

The best option is to talk to our support team and raise it there

#

but I'll flag internally again!

shrewd abyss
#

Thanks for your help, so one last thing to confirm:

If Stripe lets us know that (for example) mandate mandate_1J18ecAPYpSJ8pLBHBkzIyF5 has been revoked via a webhook, the only way to remove that from the customer is to do an immediate call to https://api.stripe.com/v1/payment_methods/pm_***********/detach to remove the payment method from the customer? As there is no way to do it on stripe.com?

glossy nova
#

yes