ACH Direct Debit を Charges API から新しい API に移行する
Charges API から移行する理由と方法をご紹介します。
Stripe is removing support for ACH Direct Debit using legacy integrations.
If you create legacy ACH Direct Debit payments, you must migrate to the Payment Intents API or Checkout Sessions API.
Feature comparison
Stripe’s new APIs offer features that aren’t available in legacy integrations:
| 機能 | Legacy Integrations | Payment Intents API または Checkout Sessions API |
|---|---|---|
| Checkout サポート | いいえ | はい |
| Payment Element のサポート | いいえ | はい |
| 動的な決済手段への対応 | いいえ | はい |
| 売上処理速度 | T+6 | T+4 (売上処理の高速化を使用する場合の T+2) |
| 銀行口座の即時確認 | カスタムのサードパーティーとの統合でのみ利用可能 | Financial Connections による即時認証 |
| Fraud prevention | いいえ |
|
| 対応可能な国 | アメリカ | アメリカ、EU、イギリス |
Checkout Sessions API と Payment Intents API の比較
Stripe offers two new APIs to accept ACH Direct Debits payments: Payment Intents and Checkout Sessions APIs.
Checkout Sessions API: ビルトイン機能を使って一般的なチェックアウトのワークフローをサポートします。これはカスタムコードが不要で、ほとんどの開発者に推奨されています。
Payment Intents API: 独自の決済フローを構築するための下位レベルの API。非常に多くのコードと継続的なメンテナンスが必要です。ほとんどの組み込みには Checkout Sessions をお勧めします。
その違い、そしてどちらが適切かを判断する方法について、詳しくはこちらをご覧ください。
ACH Direct Debit 統合の構築
PaymentIntents または Checkout Sessionsで ACH Direct Debit の連携を構築するには:
支払い方法の設定で ACH Direct Debit を有効にします。
新しい決済方法を収集して使用するには ACH on Payment Intents または Checkout Sessions を連携してください。
For bank accounts previously collected using the Tokens API, you can continue to use saved
BankAccountobjects asPaymentMethodobjects with the Payment Intents API. For details, see Migrate existing bank accounts.既存の銀行口座を使ったすべての支払いを、段階的に Payment Intents または Checkout Sessions API に移行してください。
Remove your legacy integration.
Behavioral differences
Some features that exist in both APIs work differently. If you rely on any of the following behaviors, update your integration accordingly.
| Behavior | Legacy Integrations | Payment Intents or Checkout Sessions API |
|---|---|---|
| Mandates | Not enforced by the API. |
|
| Balance transactions |
|
|
| 残高タイプ | Funds settle in source_. |
|
| 少額入金 |
|
|
| Emails | Stripe doesn’t send automatic emails. |
|
Webhook differences
If you previously listened to Charge events, you might need to update your integration to listen to new event types. The following table shows how webhook events differ.
| Old webhook | New webhook on Checkout | New webhook on Payment Intents | Special instructions |
|---|---|---|---|
charge. | payment_ | payment_ | In legacy integrations, charge. includes balance transaction. In new integrations, the balance transaction isn’t available until the charge. event. |
charge. | charge. | charge. | Sent when the payment is submitted to the banking partner. Includes the balance transaction. |
charge. | checkout. | payment_ | charge. Webhook も送信されるため、新しい Webhook をリッスンするように実装を更新する必要はありません。 |
charge. | Not applicable. The customer can re-attempt the payment on the same Checkout Session until it expires, at which point you receive a checkout. event. | payment_ | charge. Webhook も送信されるため、新しい Webhook をリッスンするように実装を更新する必要はありません。 |
charge. | charge. | charge. | Not applicable |
| Not applicable | mandate. | mandate. | Sent when a mandate becomes inactive. |
Identify Legacy ACH Payments
On a Charge object, the payment_ property is ach_ for the legacy integration and us_ for the newer integration.
A legacy ACH payment is created when a legacy BankAccount is the payment source. This happens when:
- You call the Create Charge API.
- A Subscription or Invoice charges a customer whose
default_is a legacy BankAccount, and nosource default_is set on the customer, subscription, or invoice.payment_ method - You call the Create PaymentIntent API with
sourceset to a legacy BankAccount.