TRADOM PaymentDocs

状態リファレンス

Hosted CheckoutとPaymentIntentの状態遷移

Hosted CheckoutとPaymentIntent APIは別の状態modelを持ちます。両方の状態名を混在させないでください。

Hosted Checkout

kyc_pending
  ├─ 審査NG → kyc_declined
  └─ 審査OK → checkout_opened
                  ↓
             asset_selected
                  ↓
             awaiting_deposit
               ├─ 期限切れ → expired
               └─ 入金検知 → deposit_detected
                                ↓
                           deposit_confirmed
                                ↓
                    bridging(該当レールのみ)
                                ↓
                  converting → transferring
                                ↓
                            completed

後続処理が失敗/キャンセル → failed

confirmed は「全額の入金を確認した」互換booleanで、不足入金では false になります(underpaid: true)。canonicalな状態は state.state を使います。入金額の一致状況は状態とは別の state.matchStatus で表されます。

  • exact: 想定額と一致
  • underpaid: 不足。自動返金または運用対応へ進む
  • overpaid: 超過。差額返金へ進む

PaymentIntent

create
  ↓
requires_payment_method
  ↓ confirm
requires_action
  ├─ cancel → canceled
  └─ deposit記録 → succeeded
                      ↓ refundを起票
                  succeededのまま

processing と failed は公開型に含まれますが、現行のsimulate経路は requires_action から直接 succeeded へ進みます。返金してもPaymentIntentの status は succeeded のままで、amountRefunded と refunds.data が更新されます。

PaymentIntentのsimulate着金は、指定した正の amount が請求額と異なっていても現行実装では succeeded になります。EC Gatewayの不足/超過ロジックとは別物です。

実装上の判断

  • 買い手のredirectだけで支払い済みにしない
  • EC Gatewayは confirmed または明示的なcanonical stateで照合する
  • PaymentIntentは status と nextAction を組み合わせて画面を決める
  • 返金・精算は支払い完了とは別の非同期処理として扱う

このページの内容