#mochihealth
1 messages ยท Page 1 of 1 (latest)
๐ hello
This is really up to you. You can always exclude PaymentMethods without an active mandate if you want.
Maybe I'm not understanding the question?
should i be deleting these. also what are the scenarios which cause a bank pm to have an inactive mandate
You can either detach them (which effectively deletes them) or you could bring your customer back on session and collect a new mandate agreement from them.
They can become inactive if the customer tells their bank they don't want to permit debits of their account any more or if they have a debit fail for certain failure reasons.
how can i detach them
and how can i brink them back on session to reactivate the mandate
if i have a custome stripe implementation that uses stripe elements
You create a new mandate by submitting mandate_data when you confirm your PaymentIntent or SetupIntent
but right now if im folling the setup intent flow recommended by stripe for creating new payment methods how can i fit this in for revising current ones
You do the same thing but you just pass the PaymentMethod ID to your SetupIntent (https://stripe.com/docs/api/setup_intents/create#create_setup_intent-payment_method), pass confirm=true (https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm) and pass mandate_data: https://stripe.com/docs/api/setup_intents/create#create_setup_intent-mandate_data
That will set the already-created PaymentMethod up with a new mandate
Hi there ๐ jumping in as my teammate needed to step away.
Passing true for the confirm parameter causes the intent to immediately be confirmed when it is created.
so for the user flow of this. do I need to like prepopulate the current payment method in the stripe element or is this just like a button that I can add to payment methods that dont have an active mandate that they can click on to reconfirm it or something
The approach described doesn't use the Payment Element, it is all completed server-side after you've collected mandate acceptance from your customer. Is that what you were looking for, or were you looking for an approach that used Elements to create new mandates (I'm not certain if this latter is possible offhand and will need to look into that further)?
is there a flow that I can use the stripe elements to collect the new mandate with or do I need a custom front end flow for this
Since payment method details don't need to be recollected, just mandate information, I'm not sure an Element would be needed here, but do believe this might be possible via Stripe.js.
To make sure we're talking about the same thing, are you referring to ACH Debits when you reference bank accounts, or a different type of bank debit payment method?
yea ach debits
๐
Do you have a Payment Method in test mode that is in the state you're describing (has an invalidated mandate) that you would be able to test with? I'm not entirely certain what you're after is possible client-side and will need to do some testing. If you already have a Payment Method in that state you'll likely be able to test faster than I can.
yea i have one\
do you want it?
I'm just not sure what the normal flow is for pm with invalid mandate. do they normally get deleted and then you would need to just set up an entirely new one or do they get reconfirmed
also for my subscription flow when a payment fails does it make sense to mark it as uncollectible or leave it as is. the flow right now is that a new pi would be created when the customer wants to resubscribe
I think a new Setup Intent being confirmed with the existing Payment Method is the way to handle this.
Can you try taking that Payment Method you have and:
- Create a Setup Intent, passing the ID of that Payment Method in the
payment_methodfield. - Try to confirm that Setup Intent client side via confirmSetup from Stripe.js, passing the
clientSecretfrom the Setup Intent.
https://stripe.com/docs/js/setup_intents/confirm_setup
let me see
i get the erro on step 1
Ah, dang, was hoping that would allow for the collection of mandate acceptance again. So I think what you'll need to do instead, is what my teammate mentioned earlier, you'll need to collect the necessary details in your own form to create a new Mandate, and then provide those details in mandate_data.
Pausing because of your newer message, can you share the ID of the request that returned that error?
req_Zd1cHpqqcQJpOG
Ah, I see, can you try that request again without using confirm. There are two different approaches to confirmation, client-side or server-side. When you pass confirm as true in creation requests, server-side confirmation is what is occurring. Since we want to try to use Stripe.js to do the confirmation, we want to try client-side confirmation here.
ok thanks let me try that
the request works but the payment element doesnt prepopulate with any info or anything so I'm not sure where to go from there
Hello! I'm taking over and catching up...
When you already have a Payment Method you want to use you don't use the Payment Element at all; the Payment Element is only for collecting new payment details, not using existing ones.
Looks like you're using ACH, so you probably want to call this on the frontend: https://stripe.com/docs/js/setup_intents/confirm_us_bank_account_setup
but what exactly am i displaying on the frontend for the customer to see
Whatever you want. A button, info about the Payment Method, it's up to you.
also what happens when you detach a payment method that is the defualt one on a subscription
If there's no other default set (like on the Customer) future payments will fail.
gotcha
thanks
let me try the confirmation one before you close this thread out
am i supposed to display a mandate to the customer or something
That should be handled when you call the confirm method I linked to above.
Are you not seeing that?
nothing is displayed to the user its just an pi call and it just renews the mandate for the pm. there was no ui that popped up for this
unless I did something wrong
Oh, wait, that makes sense; you already have the Payment Method.
Wait, let's back up a bit.
How did you create that Payment Method in the first place?
with the setupintent in developent mode so that it fails in the payment stage
that invalidates the mandata
mandate
Not sure I understand?
so I want to create a way for the user on the frontend to revalidate the existing pm with a new mandate so that it will be good
Okay. Did that not happen with what you just tried?
it happened
Okay.
but my question is do I need to display a mandate to the customer when I do that
is there something that is required to show them from like a regulatory side
Not that I know of. If there is I believe stripe.confirmUsBankAccountPayment will display it for you. See here for further details: https://stripe.com/docs/payments/ach-debit/set-up-payment?platform=web#web-collect-mandate-and-submit
You do need to display it in some cases as outlined there I mean, but not always.
also should I even allow the user to validate the bank again since it failed to begin with
should I just detach the payment method from the customer
and make them add a new one
That's up to you. You can try to validate it again, or you can ask them to supply new info.
also after I validated and paid again and it failed again since im using the failed test account it didnt invalidate the mandate again
is that supposed to happen
what are the scenarios that would cause a pm to be invalidated
Are you talking about ACH Payment Methods specifically?
yea
I think it's things like the account holder revoking the mandate or the account being closed.
^
what do you mean
Which of these test accounts are you using? https://stripe.com/docs/testing#test-account-numbers
pm_usBankAccount_accountClosed
Yeah, that's expected then. The test account is closed.
no but it didnt re invalidate the payment method after another failure
only invalidated it the first time
What do you mean by invalidated?
sorry like had the mandate revoked so that it couldnt be used for payments
also in every scenerio would I want to allow the user to renew the mandate or are there some scenerios where I would want to do nothing or detach the payment method
Sorry, I'm having trouble following. Can you give me the request IDs showing the steps you're taking, from beginning to end? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_dnydr0q0JUhKMH
but first req_z4uMp6H2luJTWu
to renew the mandate
I understand this is a lot so thank you
So in that last request you created a Setup Intent but then did nothing with it.
The Setup Intent's status is requires_confirmation.
So it didn't do anything yet, it won't do anything until you confirm it.
but thats from calling the confirm bank account route
As far as I can tell you didn't call that.
Not with this Setup Intent anyway.
Maybe you called it on a different one?
You called it on a different Setup Intent here, for example: https://dashboard.stripe.com/test/logs/req_0fBVIpmpDMu28H
But there's no request like that for this other Setup Intent.
oh sorry I called that to get the secret to pass to the confirm bank account
strange I dont see those logs on the customer
What do you mean?
that you can see logs for a specific customer
but i guess this one isnt stored on the customer
but anyway
I confirmed it
and then used it again
and the payment failed
but the mandate is still good?
Can you share the request IDs?
req_2QPcDh8B9qq7C9
Do you have the request ID for the Setup Intent confirmation?
didnt you just pull it up?
In any case, though, this seems expected to me. The account can be set up for future use, but because it's a special test account you get back declines saying the account doesn't exist.
You sent the request ID for the Subscription creation.
Let's back up a bit. What's your ultimate goal here?
so when a payment fails with a bank account I'm ultimately usure whether to allow the user to renew the mandate again so they can use it again on their next payment or just detach the payment mehtod and make them input a new one. do you have any recommendations?
My recommendation would be to look at the reason why the payment failed and take the most appropriate action based on that specific reason. Most of the time that's probably going to be to detach that Payment Method and get new payment details from your customer.
where can i see that
and what are the potential reasons
is there a list of enums
also I saw that an option when a subscription fails to update is to mark it as uncollectible in stripe settings. is that the recommended configuration?
and would that void the invoice or no?
You can see details about payment failures on the associated Charge objects: https://stripe.com/docs/api/charges/object#charge_object-failure_code
Regarding the uncollectable vs. void vs. leave as-is, we do not have a recommended setting. Whichever works best for your use case is the one you should pick.
And no, uncollectable is not the same as void, they're separate statuses.
thanks