#jasuno-setupintent-mandate
1 messages ยท Page 1 of 1 (latest)
jasuno-setupintent-mandate
Hey @balmy crown! Can you give me a better/clearer summary of your exact question? What are you looking for, which case are you looking for a Mandate? Where did you look, what's your exact code? Do you have a concrete example SetupIntent/SetupAttempt id?
Here is a summary of the last chat i had:
I encountered an error while trying to confirm a payment method, receiving the message "A mandate is required. Please either provide the id of an existing mandate on confirmation or provide payment_method_options[acss_debit][mandate_options]." After adding a mandate and sharing the corresponding request IDs, Stripe Support joined the conversation to assist. They explained that the error occurred because the payment method already had a mandate and suggested checking the Stripe dashboard to find the existing mandate ID. I asked about fetching the mandate ID through the Stripe API, but Stripe Support clarified that it would have needed to be stored during creation and provided information on retrieving the mandate using its ID. Then I asked about the return of mandates from the "confirmAcssDebitSetup" operation, and Stripe Support clarified that the mandate details could be accessed through the "setupIntent" object.
Okay so the real information here is: You are using ACSS Debit, you collect payment method details via a SetupIntent before and now want to charge that PaymentMethod?
Can you share an exact SetupIntent id for me to look at?
Here is the requestid: req_IFOWIm2sZ2SoJX
Here is the intentId: seti_1N9VuwAq6ReFUKV894BKuJQt
Okay so that SetupIntent has a Mandate id in the mandate property
Like just call Retrieve SetupIntent and you'll see the Mandate right there
So the mandate is not set until after the setup is completed?
Correct! The Mandate is signed as part of the SetupIntent. And you need the Mandate to be properly created/accepted to use it
https://stripe.com/docs/payments/acss-debit covers a lot of this
One more thing
When making the payment i provide a mandate but getting an error
req_5KTYWfPsZ8XCRE
You can't pass a Mandate id if you already set mandate options on the PaymentIntent
I'm sorry, I'm really struggling to follow what you're trying to do here
Are you using Subscriptions? What is your overall integration in 2 sentences
Yes we are using subscriptions, I want to pay an invoice that was generated by a subscription using acss_debit
Okay so why did you do your own SetupIntent? Usually you start a Subscription and then you get the Invoice paid via ACSS Debit, you shouldn't be creating your own SetupIntent here
Because a user should be able to setup different payment methods (ACSS Debit or credit card) even if there is no subscription specially since our users (tenants) can pay into multiple subscriptions at a time. Also the way that our platform is set up is that you came pay. invoice by invoice or have a payment method setup as default
๐ Hopping in here to take a look - give me a couple minutes to catch up
I think the issue is with how you created your SetupIntent - with ACSS Debit paymentmethods that you intend to use for Invoices/Subscriptions you need to pass in payment_method_options.acss_debit.mandate_options.default_for so that we know to use that mandate by default for future billing payments
Ok what if i need to use that same acss_debit for other subscriptions
I assume that should be fine
Yup that should be fine
So I should just have to add that default_for property
correct - that's something you'd want to set specifically during SetupIntent confirmation
I had one more question but its unrelated with any of this should i start a new thread?
no you can ask here
When have a Connect account get setup with the account type express link is there a way to force the ID verification, if seems like the process now is divided in 2 when we first ask for banking info and then for ID verification
It sounds like https://stripe.com/docs/connect/additional-verifications is what you want, right?
I believe that mandatory to be able to process payouts
Yeah let me clarify - I think currently there's no way to "force" ID verification up front without first asking for banking info
But we do have something in beta (the link I sent you) that seems to match what you're looking for that you'd need to write in and ask if it could be enabled for your account
Cool let me check that out now
When should i expect the email?
Dam im still having trouble with this mandate thing, check out: req_R2lfu6rcsGhOCu and req_ILNi5wWCLDJlG7
I'm not sure when you'd expect a response, but let me look at those requests
Also here is the intent that failed:
req_j69VurBeRL32zw and here is what i canged it to: req_udTsrMavfYQcHF
Sorry for the wait - I think the issue here is that by confirming client-side stripe.js passed in new mandate_options that overwrote the default_for that you set
confirming the setupIntent?
Can you take that PaymentMethod that was created and create a SetupIntent exactly like how we do it in the sample here: https://stripe.com/docs/billing/subscriptions/acss-debit#save-payment-method-for-future-subscriptions
(basically you're going to take the SetupIntent that you just created and confirm server-side with a new SetupIntent)
Sorry i don't fully get that, so i have my setup intent that get created when they open the setup form
{
"payment_method_types": {
"0": "acss_debit",
"1": "card"
},
"payment_method_options": {
"acss_debit": {
"mandate_options": {
"default_for": {
"0": "subscription",
"1": "invoice"
}
},
"currency": "cad"
}
},
"customer": "cus_NvKK22NLpaFWFn"
}
that gets sent to the client and is used in confirmAcssDebitSetup which triggers the bank info modal
Then on the server side i do this
const { paymentMethodId, setupIntentId } = data;
const userId = context.auth?.uid;
const setupIntent = await stripe.setupIntents.retrieve(setupIntentId);
and i save that mandate from the setupintent i retrieved to my own data base
On the server side you should create a NEW Setup Intent exactly like the code sample I gave you
The issue is that it looks like you can only set default_for when confirming server-side
and so you need to create and confirm a new setup intent that sets those mandate options
your current flow is still creating mandates that can't be used with invoices and subscriptions
I think what im not getting is 2 things:
1.- The first setupIntent that was created on the server side then sent to the client to use the client secret to run stripe.js to be able to create the payment method, do we need any information from that one?
2.- The NEW setup intent what needs to be done with that one since its not being used,
this is assuming you are telling me to create 2 setup intents to create 1 acss_debit payment method
Yeah the first SetupIntent is creating the PaymentMethod and that's all you need from it
The second SetupIntent is what's actually creating the mandate that will be the default for you billing transactions
Yes, you need a mandate for each PaymentMethod that you set up
Ok i think thats where im confused
Yeah mandates are tied to a PaymentMethod, they aren't tied to a Customer - so for each PaymentMethod you setup you'll at LEAST need a mandate for each
because one intent is to create the payment method, and the other is for the mandate but what links these 2, the sample code you sent me is:
const setupIntent = await stripe.setupIntents.create({
payment_method_types: ['acss_debit'],
customer: '{{CUSTOMER_ID}}',
payment_method_options: {
acss_debit: {
currency: 'cad',
mandate_options: {
default_for: ['invoice', 'subscription'],
},
},
},
});
Which is the same structure as the intent i set up here: req_udTsrMavfYQcHF (this is the one i send to the client)
If i create a second intent the intent will never be completed since its not being used it will just be created, and the second intent has no association with the first setup intent
AH! I see what you're saying now - give me a minute
Yeah sorry i've take so much of you alls time
no worries at all - it's a really complicated flow
Yeah i tried for a while before coming here i really appreciate the help
Okay try this for me - update that customer's invoice_settings.default_payment_method to be the PaymentMethod that you created
But what if the user doesn't what it to be their default, i'm guessing thats not possible with acss_debit
oh my gosh, I know what the issue was - can't believe I missed this
The payment intent you're attempting to pay with was for a subscription that has on_behalf_of set.
drum roll
But when you created the SetupIntent you didn't specify on_behalf_of so we created the Mandate specifically for you to use on your platform account
If you want the mandate to be pulled by default for that subscription you need to also set on_behalf_of on the SetupIntent
interesting, so if i remove the on_behalf_of i should be able to use the other mandate?
yeah, i'd expect if you removed on_behalf_of it'll pull the mandate you already have set up
ok let me try that, dam i'm glad you are here because i would have never figured that out
It worked ๐๐
YOU figured it out, thanks man, acss_debit payments stay in pending in testing right i'm guessing because there is no real bank?
You should eventually transition out of pending even in test mode (we generally try and make sure to mirror the flow you'd see in livemode). You're probably hitting the three day mandate delay, which you can bypass in test mode (https://stripe.com/docs/billing/subscriptions/acss-debit#skip-mandate-delay)
Yeah instead of using test clocks to test the that three day delay you should be using that email (I think we have a known bug about delayed verification methods and test clocks)
Hey thanks for everything, I think thatโs it at least for now
happy to help! I'm going to close out this thread, but if you need anything else feel free to hop back in the main channel