#daniel_ach-mandate
1 messages ยท Page 1 of 1 (latest)
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.
- daniel-nissenbaum_api, 2 hours ago, 22 messages
๐ 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/1237102186626809985
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Default payment method is already set
What does that mean? What is set and where?
await this.stripe.customers.update(customerId, {
invoice_settings: {
default_payment_method: paymentMethodId,
},
})
like with that code
You seem to use legacy ACH Debit via ba_123
do you have a proper Mandate collected for that object?
yes, it was just collected before we used stripe
the users i'm migrating have active subscriptions with us but with our custom payment solution
its about 100 users that im trying to migrate
yes, it was just collected before we used stripe
okay so you don't have one on Stripe right? That's the problem if so
hmm I think i see
so i first run this: stripe subscriptions create --customer=cus_Q3aaEsTn4MmW8V -d "items[0][price]"=price_1NC4wPJmq474uon8gtcPKlDJ -d "trial_end"=1745812799
that creates the subscription right
and then what would i run after that?
It's kinda completely unrelated
where are those ba_123 coming from in the first place?
we used plaid for those
daniel_ach-mandate
because users already link their bank account to fund thier investing accounts in our app (thats our product)
Okay then use what's on https://docs.stripe.com/payments/ach-debit/migrating-from-another-processor#ach-data-migration instead but don't pass payment_method_data, pass payment_method: 'ba_123' instead on that SetupIntent creation/confirmation
The idea is to make sure you have a validate Mandate for that BankAccount before you charge it
im a little confused, i must make a setup intent?
also must i reach out to stripe support?
All you have to do, as a developer, is force create a Mandate by using a SetupIntent because you already have legacy BankAccount objects in your account.
You don't need to reach out to stripe support for this, but you have to run a "migration" on your end to force create a Mandate for each record
What programming language do you use for your real code/scripts?
stripe setup_intents create
-d "payment_method_types[0]"=us_bank_account
--customer={{CUSTOMER_ID}}
--confirm=true
-d "payment_method_options[us_bank_account][verification_method]"=skip
-d "payment_method_data[type]"=us_bank_account
-d "payment_method_data[billing_details][name]"={{ACCOUNT_HOLDER_NAME}}
-d "payment_method_data[billing_details][routing_number]"={{ROUTING_NUMBER}}
-d "payment_method_data[billing_details][account_number]"={{ACCOUNT_NUMBER}}
-d "payment_method_data[billing_details][account_holder_type]"=individual
-d "mandate_data[customer_acceptance][type]"=offline
-d "mandate_data[customer_acceptance][accepted_at]"=1692821946
So i must run this when i create the bank account? And must do this before i run the command to create the subscription?
we code in Node JS
Im using a mix of things to get this migration done
yeah I mean I never use the CLI for things like this. I highly recommend writing real end to end scripts to test all of this cleanly. And no I tried to explain you should not pass payment_method_data
payment_method_types: ['us_bank_account'],
customer: 'cus_123',
confirm: true,
payment_method: 'ba_123',
mandate_data: {
customer_acceptance: {
type: 'offline',
accepted_at: <time when they accepted>,
},
},
});```
like this ^
const bankAccount = await this.stripe.customers.createSource(stripeCustomer.id, {
source: stripeBankAccountToken.stripe_bank_account_token,
})
OK, so this ^ is how i create the payment source right now
oh boy
so i should keep calling that, but then also call stripe.setupIntents.create passing in the payment_method id returned from the bankAccount?
I thought you said you had some historical records to migrate, not that you were still using this ๐
haha afaik thats the only way to use Plaid with stripe still
That was coded with lots of help from this chat hahah ๐
Cool then that's fine (though really you should switch to FinancialConnections)
but yes you need that SetupIntent to get a Mandate in that case
its not really an option since our broker dealer uses plaid to fund the account (using financial connections)
so we never want to make the user link the bank account twice
๐
ok so just to clarify the order of things here:
- Create source (payment method) from our existing plaid access token -. This returns the paymentMethodId
const bankAccount = await this.stripe.customers.createSource(stripeCustomer.id, {
source: stripeBankAccountToken.stripe_bank_account_token,
})
- Create setupIntent
const setupIntent = await this.stripe.setupIntents.create({
payment_method_types: ["us_bank_account"],
customer: customerId,
confirm: true,
payment_method: paymentMethodId,
mandate_data: {
customer_acceptance: {
type: "offline",
accepted_at: accepted_at,
},
},
})
- Create set defaultPaymentMethod on user
await this.stripe.customers.update(customerId, {
invoice_settings: {
default_payment_method: paymentMethodId,
},
})
- Create the subscription with the trial_end date in the future (to match with our old subscription systems renewal date)
stripe subscriptions create --customer=cus_Q3aaEsTn4MmW8V -d "items[0][price]"=price_1NC4wPJmq474uon8gtcPKlDJ -d "trial_end"=1745812799
yep