#_api

1 messages ยท Page 1 of 1 (latest)

woeful mortarBOT
#

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

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

pseudo bobcatBOT
#

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.

  • _api, 21 hours ago, 29 messages
  • _api, 1 day ago, 42 messages
fiery adder
#

Hello

#

Can you clarify a bit? You are asking how to handle an ACSS Debit payment for different Connected Accounts?

#

As you are using OBO?

lime yew
#

yes, I have a process in place where users transfer money to vendors, a merchant account for a vendor and a bank account set with a setup intent by a user, it has the vendor's account Id in the OBO field and when a vendor changes merchant account to a new one the payment fails because the OBO is different than the one inserted before

fiery adder
#

Yeah you just need to create a new mandate for the new merchant

lime yew
#

the link I attached shows migration that worked for me, I was in chat with one of the reps here and he gave me a way to rewrap a setup intent so it will have the new account as OBO and ill be able to charge it without remandating

fiery adder
#

Hmm no you can't charge without a mandate

#

That's not possible

#

But all you really need to do is pass mandate_data when you confirm the PaymentIntent so that a new mandate is created

lime yew
#
  payment_method_types: ['us_bank_account'],
  customer: '{{CUSTOMER_ID}}',
  confirm: true,
  payment_method: 'pm_1234',
  mandate_data: {
    customer_acceptance: {
      type: 'offline',
      accepted_at: 1692821946,
    },
  },
});```
#

thats what he gave me and it works for ACH

#

the pm is the old one and the accepted at is also the same as the old mandate

fiery adder
#

Sure

#

That is a SetupIntent

#

So that also creates a new mandate but that mandate also won't be OBO the Connected Account

#

You either have to use a SetupIntent to create a new mandate OBO the Connected Account you are trying to charge and then pass that Mandate ID to the PaymentIntent, or you just create the Mandate when you create the PaymentIntent

lime yew
#

yeah he told me to add the new obo

fiery adder
#

Okay yeah that's fine then

lime yew
#

I want to make it so that users dont have to re-insert their bank account information

fiery adder
#

Why doesn't that work for ACSS?

lime yew
#

is throws an error

#

A mandate is required. Please either provide the id of an existing mandate on confirmation, or provide payment_method_options[acss_debit][mandate_options].

fiery adder
#

Did you pass in the Mandate ID.... ?

#

From the SetupIntent

lime yew
#

I didn't, but then again I didnt need to when I tried ACH

fiery adder
lime yew
#
        payment_method_types: ["acss_debit"],
        customer: oldSetupIntent.customer as string,
        confirm: true,
        payment_method: "pm_1PgQ8aGES5MQAgehn7NlyqMZ",
        on_behalf_of: merchantAccount.stripeInfo.accountId,
        mandate_data: {
          customer_acceptance: {
            type: "offline",
            accepted_at: oldMandate.customer_acceptance.accepted_at
          }
        }
      });```
basically the the OBO is the id of the new account
fiery adder
#

Yep

lime yew
#

the link you sent me is for payment intent creation

fiery adder
#

Right... that is the next step

#

After you create the SetupIntent

lime yew
#

I do provide mandate id to a payment intent

fiery adder
lime yew
#

I provide the mandate Id that is attached to the seti i just created

fiery adder
#

And that fails?

lime yew
#

yes

fiery adder
#

Okay can you provide the request ID for that?

lime yew
#

it fails before the payment intent creation

fiery adder
#

Ah sorry I see the issue

lime yew
#

it fails in the seti

#

creation

fiery adder
#

ACSS mandates require more info than ACH

lime yew
#

but will it require an end user to do actions?

fiery adder
#

No

#

You just describe whatever was agreed upon between you and your customer

#

For instance something like:

 mandate_options: {
        payment_schedule: 'interval',
        interval_description: 'First day of every month',
        transaction_type: 'personal',
      },
lime yew
#

is this info contained inside the mandate object?

fiery adder
#

Or whatever enums are most applicable between you and your customer

fiery adder
#

So you can retrieve your old mandates to check on that

lime yew
#

I see that it also requires custom_url and default_for fields

#

are these required also? and if they are what do I provide to them?

fiery adder
#

No don't believe those are required

#

default_for is only relevant for Subscriptions

#

So if you aren't working with Subscriptions then you can ignore that

#

And custom_mandate_url is only for Custom Mandates

lime yew
#

ok, please give me a second, I want to try it

fiery adder
#

Sure

lime yew
#

it throws "Offline mandate customer acceptance data is not supported by acss_debit payment method type." message in the seti creation

#

perhaps this is a dead end?

fiery adder
#

Ah didn't realize that -- but really they accepted the initial one online, right?

lime yew
#

yeah

#

they have to, dont they?

fiery adder
#

Yeah, so that is what I'm saying -- if they agreed during that time for that PaymentMethod to be charged for any of your Connected Accounts then you should be able to relay the same online acceptance data.

lime yew
#

what do you mean any of my connected accounts?

fiery adder
#

Using OBO makes your Connected Account the merchant of record

lime yew
#

what about accounts that were added after the creation of the mandate?

fiery adder
#

That is up to you and your customer

#

Basically you have to determine if they are okay with you charging their PaymentMethod for the Connected Account you are setting as OBO -- that is what having a Mandate indicates.

lime yew
#

so they do need to remandate their bank account

#

the users I mean

#

I can't do it programatically

fiery adder
#

No, I just told you how to do it programatically

#

You pass the same data from the initially collected mandate

#

Assuming they agree to you doing this

lime yew
#

currently im in test env and I dont believe the test iframe that "collects" the bank data and does the mandate asks about it, so it will always fail in test?

fiery adder
#

I'm not sure what you mean by that, sorry. Can you be more specific?

lime yew
#

you said that users give permission by agreeing to charging to different connected accounts

#

how can I replicate this behavior in test?

#

currently it always fails, and I dont remember anything about the stripe iframe asking me about giving permissions

woeful mortarBOT
fiery adder
#

A Mandate is "permission"

#

You are taking that too literally

#

What I'm saying is that if you are going to create a new Mandate here while your customer is not actually in your flow then that customer needs to be okay with you doing that

lime yew
#

I still don't really understand and the API doesn't elaborate on this too much, the error message said "offline mandate" isn't supported in acss debit, what I need is for the seti to be created successfully and charging it after with a payment intent. what do I need to do to make it happen? I gave you a code snippet of the seti creation and the data I provided it, the data seems correct yet it fails. If there is a mandate in the old seti doesnt it mean the user already gave me permission thus its suppose to work?

fiery adder
#

I still don't really understand and the API doesn't elaborate on this too much, the error message said "offline mandate" isn't supported in acss debit, what I need is for the seti to be created successfully and charging it after with a payment intent. what do I need to do to make it happen?
You need to pass mandate_data.customer_acceptance.type: 'online' and the correspoinding online hash: https://docs.stripe.com/api/setup_intents/create#create_setup_intent-mandate_data-customer_acceptance-type

If there is a mandate in the old seti doesnt it mean the user already gave me permission thus its suppose to work?
I can't tell you that -- that is up to the agreement between you and your customer. I'd say it is probably safe to assume that? But that isn't something I can answer for you.

lime yew
#

the hash is also inside the mandate object?

lime yew
#

ok I think it works now

#

Thank you very much for your help and patience ๐Ÿ™

fiery adder
#

Sure!