#frallain_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1308805161421897829
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! in general it would work if you build the test mode integration and enter the bank details that way in your browser (https://docs.stripe.com/payments/ach-direct-debit/accept-a-payment?web-or-mobile=web&payments-ui-type=direct-api), since that's how it would work in livemode. Not sure if there's an easier way for backend-only tests, let me think about it..
Hi there ๐ I'm jumping in as my teammate needs to step away soon. Is the flow you're showing in your initial message (creating a Payment Method object directly and then attaching it to a Customer) how you plan to have your live flow work as well? Or is that just being done for testing purposes?
If the former, I'd be hesitant to recommend that approach and would typically suggest using a Setup Intent flow instead:
https://docs.stripe.com/payments/save-and-reuse
If it's just for testing, then you likely just need to add a microdeposit verification request in between those two requests. I'm having a bit of trouble finding that quickly and need to dig for that a bit more.
OK, with
setup_intent = stripe.SetupIntent.create(
payment_method_types=["us_bank_account"],
customer=stripe_customer["id"],
payment_method=pm["id"]
)
stripe.SetupIntent.confirm(
setup_intent["id"],
payment_method=pm["id"],
mandate_data={"customer_acceptance": {"type": "offline"}},
)
I can see the ACH directy debit pm at https://dashboard.stripe.com/test/customers/cus_RFkspQFlw7NorT but it is pending -> is there a way to have directly as active?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Perfect, then you can use this endpoint to handle the microdeposit verification:
https://docs.stripe.com/api/setup_intents/verify_microdeposits
It works! Nice !! the whole flow :
stripe_customer = stripe.Customer.create(
email="ach_direct_debit_customer@test.fixture", coupon=customer_coupon_id, metadata=metadata, **additional_kwargs
)
pm = stripe.PaymentMethod.create(
type=StripePaymentMethodType.ACH_DIRECT_DEBIT,
billing_details={"name": "John Doe"},
us_bank_account={
"account_holder_type": "individual",
"account_number": "000123456789", # successful payments
"routing_number": "110000000",
},
)
setup_intent = stripe.SetupIntent.create(
payment_method_types=["us_bank_account"],
customer=stripe_customer["id"],
payment_method=pm["id"]
)
stripe.SetupIntent.confirm(
setup_intent["id"],
payment_method=pm["id"],
mandate_data={"customer_acceptance": {"type": "offline"}},
)
stripe.SetupIntent.verify_microdeposits(
setup_intent["id"],
amounts=[32, 45],
)
thank you very much!