#sr_setupintent-mandate

1 messages ยท Page 1 of 1 (latest)

fresh aspenBOT
#

๐Ÿ‘‹ 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.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

  • sr_api, 20 minutes ago, 13 messages
  • sr_api, 1 day ago, 36 messages
warped mauve
#

sr_setupintent-mandate

#

@fervent locust you gave one request id that is about the Pay Invoice API but separately shared code that seems completely unrelated about the Create SetupIntent API.
Do you have a more actionable summary for me to help you?

fervent locust
#
  1. Initial SetupIntent Creation: I create a SEPA Direct Debit payment method for a customer using a SetupIntent like so:
    const setupIntent = await stripe.setupIntents.create({ customer: customer.id, payment_method_types: ["card", "sepa_debit"], });

  2. Error when Paying Invoice: When I attempt to pay an invoice using the SEPA Direct Debit payment method created from the above SetupIntent, I receive the following error:
    "Mandate is missing for this payment method."

  3. Attempted Fix - Creating a New SetupIntent with Mandate: To resolve this, I tried creating another SetupIntent for the same customer and explicitly added mandate_data

  4. Still Facing the Same Error: Despite creating a new SetupIntent and including mandate_data, I still get the same error about a missing mandate when attempting to pay an invoice using the SEPA Direct Debit payment method.

#

The Attempted Fix was to always create two setupIntents for a customer.
The first to add the payment and the second to add the mandate_data for the payment_method/customer

warped mauve
fervent locust
#

So I need to manually fill the mandate field?

warped mauve
#

Yes

fervent locust
#

Here's my proposed updated process. Could you please confirm if this is correct?

  1. First SetupIntent to Create SEPA Direct Debit Payment Method
  2. Second SetupIntent to Attach the Mandate
    After successfully collecting the payment method, I create another SetupIntent to generate and attach the mandate for future payments.
  3. Paying the Invoice with SEPA Direct Debit and Mandate:
    When paying an invoice, I use both the saved payment method and the mandate created in the second SetupIntent to ensure the mandate is attached to the invoice
warped mauve
#

I don't understand what you are describing. Why would you have 2 separate SetupIntents?

fervent locust
#

I need the first setupIntent so that the user can add a paymentMethod.
As I can only create a mandate with a setupIntent where there is already a paymentmethod, I assume that I need a second setupIntent, where I can already provide the payment_method: paymentMethodId

#

What I want to achieve is to just have a customer with a sepa_debit payment method that can be charged when I later create an invoice

warped mauve
#

As I can only create a mandate with a setupIntent where there is already a paymentmethod,
that's not true. That's why I am confused

#

How are you doing the first SetupIntent? Like how are you confirming that SetupIntent exactly? Can you give me a concrete SetupIntent id seti_123 for that first one so I can have a look?

fervent locust
#

I create this setup intent with

const setupIntent = await stripe.setupIntents.create({ customer: customer.id, payment_method_types: ["card", "sepa_debit"], });

POST /v1/setup_intents req_gRgfZIYw2tau5o
Here, "mandate" is null

Id of the created setupIntent:
seti_1QD7ghH4lFm8CIFnXk6aG45X

warped mauve
#

That API Request is the creation though so it's normal that Mandate is null at that point. The Mandate is created after the SetupIntent is successfully confirmed.
If you look at the SetupIntent after confirmation then you can see it has mandate: 'mandate_123' already

fervent locust
#

Good catch!

Ok, will then try to add this mandate to the invoice ๐Ÿ‘๐Ÿป

warped mauve
#

Awesome!

#

It's a bit annoying because some payment methods "automatically select the Mandate", others have the concept of default_for such as ACSS but SEPA doesn't seem to have that and it becomes a bit messy. I recommend always being explicit if you can

fervent locust
#

Ok great wrap up and thank you for your patience and help ๐Ÿ™‚