1

I am using Stripe as payment processor for my Flutter app. I have made the card part working. Now I am trying to allow customers to add ACH Direct Debit as payment method and ran into some difficulties.

There are bits and pieces of information here and there. But I could not find a clear explanation of the workflow in the front end and the back end. I was trying to follow the workflow for adding a card. But Stripe.instance.presentPaymentSheet() fails with not informative exception (It only says it failed because of some unexpected error.) I also searched and found some articles saying I should use Stripe.collectBankAccount() or Stripe.collectFinancialConnectionAccounts(), which I tried with no success.

The general workflow is as follows:

  1. On the server side, create a setup intent for ACH (Firebase Cloud Function using TypeScript)
    const intent = await stripe.setupIntents.create({
      customer: stripeCustomer.id,
      payment_method_types: [
        'us_bank_account',
      ],
      payment_method_options: {
        us_bank_account: {
          financial_connections: {
            permissions: ['payment_method'],
          },
        },
      },      
    });
    
    // get customer ephemeral key
    const customerEphemeralKey = await stripe.ephemeralKeys.create({
      customer: stripeCustomer.id,
    }, {
      apiVersion: stripeConfig.stripeApiVersion,
    });
    
    return {
      status: "success",
      statusCode: 200,
      clientSecret: intent.client_secret,
      customerId: stripeCustomer.id,
      customerEphemeralKeySecret: customerEphemeralKey.secret,
    };
  1. On the client side, present some kind of UI for the user to provide the bank information (Flutter). Here is where I failed. I tried Stripe.instance.presentPaymentSheet(), Stripe.instance.collectBankAccount(), and Stripe.instance.collectFinancialConnectionsAccounts(). None of them worked.

Any insight/tips on how to make ACH work on Flutter with Stripe will be highly appreciated.

Thanks!

1
  • Hi @BlackJerry, were you able to find a solution for this? Does Stripe.instance.presentPaymentSheet() work when the payment method ID or SetupIntent is for a us_bank_account bank account instead of a card? Commented Jun 1 at 0:41

1 Answer 1

1

You'll want to visit https://dashboard.stripe.com/test/logs and see if there are any errors related to SetupIntent confirmation. Another thing that you'll want to confirm is that your Stripe account is created in a supported country, and your flutter project has included the financial-connection dependency in both Android and iOS.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.