#frallain_api

1 messages ยท Page 1 of 1 (latest)

pure wingBOT
#

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

calm thistle
pure wingBOT
ebon bobcat
#

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.

clever ingot
#

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?

ebon bobcat
clever ingot
#

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!