Save details for future payments with ACH Direct Debit
Learn how to save payment method details for future ACH Direct Debit payments.
You can use Checkout in setup mode to collect payment method details in advance, with the final amount or payment date determined later. This is useful for:
- Saving payment methods to a wallet to streamline future purchases
- Collecting surcharges after fulfilling a service
- Starting a free trial for a subscription
Catatan
ACH Direct Debit is a delayed notification payment method, which means that funds aren’t immediately available after payment. A payment typically takes 4 business days to arrive in your account.
Sebelum Anda memulai
This guide shows you how to extend the foundational set up future payments Checkout integration to add support for ACH Direct Debit payments.
Create or retrieve a customerRecommendedServer-side
Create a Customer object when your user creates an account with your business, or retrieve an existing Customer associated with this user. Associating the ID of the Customer object with your own internal representation of a customer enables you to retrieve and use the stored payment method details later. Include an email address on the Customer to enable Financial Connections’ return user optimization.
Enable ACH Direct Debit as a payment method
When creating a new Checkout Session, you need to:
- Add
us_to the list ofbank_ account payment_.method_ types - Set the
permissionsparameter to includepayment_.method
By default, collecting bank account payment information uses Financial Connections to instantly verify your customer’s account, with a fallback option of manual account number entry and microdeposit verification. See the Financial Connections docs to learn how to configure Financial Connections and access additional account data to optimize your ACH integration. For example, you can use Financial Connections to check an account’s balance before initiating the ACH payment.
Catatan
To expand access to additional data after a customer authenticates their account, they must re-link their account with expanded permissions.
During the Checkout session, the customer sees a dialog that gives them the option to use instant verification or provide bank account details for microdeposit verification.
If the customer opts for microdeposit verification, Stripe automatically sends two small deposits to the provided bank account. These deposits can take 1-2 business days to appear on the customer’s online bank statement. When the deposits arrive, the customer receives an email with a link to confirm these amounts and verify the bank account with Stripe. After verification completes, the payment begins processing.
Coba integrasi Anda
Pelajari cara mencoba skenario dengan verifikasi instan menggunakan Financial Connections.
Kirim email transaksi di sandbox
Setelah Anda mengumpulkan detail rekening bank serta menerima mandat, kirim email konfirmasi mandat dan verifikasi deposit mikro di sandbox.
Jika domain Anda {domain} dan nama pengguna Anda {username}, gunakan format email berikut untuk mengirim email transaksi percobaan: {username}+test_email@{domain}.
Misalnya, jika domain Anda adalah example.com dengan nama pengguna info, gunakan format info+test_email@example.com untuk mencoba pembayaran ACH Direct Debit. Format ini memastikan bahwa email dirutekan dengan benar. Jika Anda tidak menyertakan akhiran +test_email, kami tidak akan mengirimkan email.
Kesalahan umum
Anda perlu mengaktifkan akun Stripe sebelum Anda dapat memicu email ini saat melakukan percobaan.
Nomor rekening percobaan
Stripe menyediakan beberapa nomor akun percobaan dan token terkait yang dapat Anda gunakan untuk memastikan integrasi Anda untuk rekening bank yang dimasukkan secara manual siap untuk produksi.
| Nomor akun | Token | Nomor perutean | Perilaku |
|---|---|---|---|
000123456789 | pm_ | 110000000 | Pembayaran berhasil. |
000111111113 | pm_ | 110000000 | Pembayaran gagal karena rekening ditutup. |
000000004954 | pm_ | 110000000 | Pembayaran diblokir oleh Radar karena risiko penipuan tinggi. |
000111111116 | pm_ | 110000000 | Pembayaran gagal karena tidak ada rekening yang ditemukan. |
000222222227 | pm_ | 110000000 | Pembayaran gagal karena dana tidak mencukupi. |
000333333335 | pm_ | 110000000 | Pembayaran gagal karena debit tidak diotorisasi. |
000444444440 | pm_ | 110000000 | Pembayaran gagal karena mata uang tidak valid. |
000666666661 | pm_ | 110000000 | Pembayaran gagal mengirim deposit mikro. |
000555555559 | pm_ | 110000000 | Pembayaran memicu sengketa. |
000000000009 | pm_ | 110000000 | Pembayaran akan tetap berada dalam status pemrosesan tanpa batas waktu. Berguna untuk menguji Kedaluwarsa Sesi CheckoutPembatalan PaymentIntent. |
000777777771 | pm_ | 110000000 | Pembayaran gagal karena jumlah pembayaran menyebabkan akun melebihi batas volume pembayaran mingguannya. |
000888888885 | 110000000 | Pembayaran gagal karena nomor akun token yang dinonaktifkan. |
Sebelum transaksi percobaan dapat diselesaikan, Anda perlu memverifikasi semua akun percobaan yang secara otomatis berhasil atau gagal pembayaran. Untuk melakukannya, gunakan jumlah deposit mikro percobaan atau kode deskriptor di bawah ini.
Uji jumlah deposit mikro dan kode deskriptor
Untuk meniru skenario yang berbeda, gunakan jumlah deposit mikro ini atau 0,01 nilai kode deskriptor.
| Nilai deposit mikro | Nilai kode deskriptor 0,01 | Skenario |
|---|---|---|
32 dan 45 | SM11AA | Mensimulasikan verifikasi akun. |
10 dan 11 | SM33CC | Mensimulasikan melebihi jumlah upaya verifikasi yang diizinkan. |
40 dan 41 | SM44DD | Mensimulasikan batas waktu deposit mikro. |
Perilaku penyelesaian percobaan
Transaksi percobaan diselesaikan secara instan dan ditambahkan ke saldo percobaan Anda yang tersedia. Perilaku ini berbeda dengan mode live, di mana transaksi dapat memakan waktu beberapa hari untuk diselesaikan di saldo yang tersedia.
Gunakan metode pembayaran
After completing the Checkout Session, you can collect the PaymentMethod ID. You can use these PaymentMethod IDs to initiate future payments without having to prompt the customer for their bank account a second time.
When creating a PaymentIntent, provide the payment_ and customer IDs to charge your customer using their saved bank account information.
OpsionalInstant only verification
By default, ACH Direct Debit payments allow your customers to use instant bank account verification or microdeposits. You can optionally require instant bank account verification only, using the payment_ parameter when you create the Checkout session.
OpsionalAccess data on a Financial Connections bank account
You can only access Financial Connections data if you request additional data permissions when you create your SetupIntent.
After your customer successfully completes the Stripe Financial Connections authentication flow, the us_ PaymentMethod returned includes a financial_connections_account ID that points to a Financial Connections Account. Use this ID to access account data.
Kesalahan umum
Bank accounts that your customers link through manual entry and microdeposits don’t have a financial_ ID on the Payment Method.
To determine the Financial Connections account ID, retrieve the SetupIntent and expand the payment_ attribute:
{ "id": "{{SETUP_INTENT_ID}}", "object": "setup_intent", // ... "payment_method": { "id": "{{PAYMENT_METHOD_ID}}", // ... "type": "us_bank_account" "us_bank_account": { "account_holder_type": "individual", "account_type": "checking", "bank_name": "TEST BANK", "financial_connections_account": "{{FINANCIAL_CONNECTIONS_ACCOUNT_ID}}", "fingerprint": "q9qchffggRjlX2tb", "last4": "6789", "routing_number": "110000000" } } // ... }
If you have access to balances data, we recommend checking balances before initiating payments with the collected Payment Method.
Learn more about using additional account data to optimize your ACH integration with Financial Connections.
OpsionalUpdating the default payment method
After the SetupIntent reaches the succeeded state, you can update your customer’s default_.