コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
売上
プラットフォームおよびマーケットプレイス
資金管理
開発者向けのツール
概要
Stripe Payments について
構築済みのシステムをアップグレード
支払いの分析
オンライン決済
概要ユースケースを見つけるManaged Payments
Payment Links を使用する
決済ページを構築
高度なシステムを構築
アプリ内実装を構築
決済手段
決済手段を追加
    概要
    支払い方法の導入オプション
    ダッシュボードで支払い方法を管理
    決済手段のタイプ
    カード
    Stripe 残高で支払う
    仮想通貨
    銀行口座引き落とし
    銀行へのリダイレクト
    銀行振込
    クレジットトランスファー (Sources)
    後払い
    リアルタイム決済
      Pay by Bank
      PayNow
      PayTo
        決済を受け付ける
        今後の決済のために同意書を保存
        支払いの事前設定
      Pix
      PromptPay
      Swish
    店舗支払い
    ウォレット
    国ごとに現地の支払い方法を有効化
    カスタムの決済手段
決済手段を管理
Link による購入の迅速化
支払いインターフェイス
Payment Links
Checkout
Web Elements
アプリ内 Elements
決済シナリオ
カスタムの決済フロー
柔軟なアクワイアリング
オーケストレーション
店頭支払い
端末
他の Stripe プロダクト
Financial Connections
仮想通貨
Climate
ホーム支払いAdd payment methodsReal-time paymentsPayTo

注

このページはまだ日本語ではご利用いただけません。より多くの言語で文書が閲覧できるように現在取り組んでいます。準備が整い次第、翻訳版を提供いたしますので、もう少しお待ちください。

PayTo 支払い招待のみ

PayTo による支払い方法を受け付ける方法をご紹介します。

ページをコピー

PayTo は、オーストラリアで使われているリアルタイムの支払い方法です。1 回限りの支払いと継続支払いを受け付けることができます。 PayTo で支払う場合、顧客はモバイルバンキングアプリを使用して認証および承認します。

支払いが成功したか失敗したかに関する遅延通知を受け取ります。通常、支払いの最終ステータスの通知は、契約の承認から 30 秒以内に送信されます。

Stripe を設定する
サーバー側

まず、Stripe アカウントが必要です。今すぐご登録ください。

アプリケーションから Stripe API にアクセスするには、Stripe の公式ライブラリを使用してください。

Command Line
Ruby
# Available as a gem sudo gem install stripe
Gemfile
Ruby
# If you use bundler, you can add this line to your Gemfile gem 'stripe'

PaymentIntent を作成する
サーバー側

A PaymentIntent is an object that represents your intent to collect a payment from a customer and tracks the payment process. To create a PaymentIntent that accepts a PayTo payment method, specify the amount to collect, aud as the currency, and payto in the payment_method_types list. If you maintain a list of payment method types that you pass when creating a PaymentIntent, add payto to it.

Command Line
cURL
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount=1000 \ -d currency=aud \ -d "payment_method_types[]"=payto

client secret を取得する

PaymentIntent には、client secret が含まれています。これは、支払いプロセスを安全に完了するためにクライアント側で使用されます。client secret をクライアント側に渡す際は、いくつかの方法を使用できます。

ブラウザーの fetch 関数を使用して、サーバーのエンドポイントから client secret を取得します。この方法は、クライアント側が 1 ページのアプリケーションで、特に React などの最新のフロントエンドフレームワークで構築されている場合に最適です。client secret を処理するサーバーのエンドポイントを作成します。

main.rb
Ruby
get '/secret' do intent = # ... Create or retrieve the PaymentIntent {client_secret: intent.client_secret}.to_json end

その後、クライアント側で JavaScript を使用して client secret を取得します。

(async () => { const response = await fetch('/secret'); const {client_secret: clientSecret} = await response.json(); // Render the form using the clientSecret })();

支払い方法の詳細を収集して支払いを送信する
クライアント側

支払いを確定するときに、client secret を渡します。

注意

client secret は PaymentIntent へのアクセスを許可するため、慎重に取り扱う必要があります。記録したり、URL に埋め込んだり、当該の顧客以外に公開されることがないようにしてください。

stripe.confirmPayToPayment を使用して、顧客の支払いの承認を開始します。

顧客は支払いリクエストに関する通知を受け取り、バンキングアプリでリクエストを承認または拒否します。

script.js
// Inititates the payment request notification to the customer stripe.confirmPayToPayment( '{{PAYMENT_INTENT_CLIENT_SECRET}}', { payment_method: { billing_details: { // Name is required for all PayTo payments name: 'Jenny Rosen', // Email is required only for PayID payments, for refund processing email: 'jenny@example.com' }, payto: { // Either provide a PayID (typically an email or phone number) pay_id: 'jenny@example.com' // ...or provide bank account details account_number: '000123456', bsb_number: '000000' } } } ).then(function(result) { if (result.error) { // Inform the customer that there was an error. console.log(result.error.message); } });

By default, Stripe.js polls for updates to the PaymentIntent. The promise returned by confirmPayToPayment resolves when the PaymentIntent reaches the succeeded state, or when the payment fails and the PaymentIntent returns to the requires_payment_method state. See the PaymentIntent lifecycle for details on how these transitions happen.

自身でポーリングするには、handleActions: false を設定して自動ポーリングを無効にします。

script.js
stripe.confirmPayToPayment( '{{PAYMENT_INTENT_CLIENT_SECRET}}', { payment_method: { payto: { account_number: '000123456', bsb_number: '000000' } } } { handleActions: false } // <---- Like this )

In this case, call the PaymentIntents API to fetch status of the PaymentIntent yourself.

実装内容をテストする

以下のさまざまなテスト用 PayID と銀行口座情報を使用して、テスト API キーで PayTo の実装内容をテストします。各セットによって、本番環境でシステムが直面する各種シナリオが再現されています。

PayID説明
{any_prefix}+succeed@{any_domain}PaymentIntent のステータスは、20 秒後に requires_action から processing に移行し、さらに 2 秒後に succeeded に移行します。
{any_prefix}+decline@{any_domain}PaymentIntent のステータスは、20 秒後に requires_action から requires_payment_method に移行します。Stripe は、payment_method_provider_decline エラーコードと invalid_authorization 支払い拒否コードを返します。
{any_prefix}+expire@{any_domain}PaymentIntent のステータスは、1 分後に requires_action から requires_payment_method に移行します。Stripe は、payment_method_provider_timeout エラーコードと generic_decline 支払い拒否コードを返します。
{any_prefix}+insufficient_funds@{any_domain}PaymentIntent のステータスは、20 秒後に requires_action から processing に移行し、さらに 2 秒後に requires_payment_method に移行します。Stripe は、payment_method_provider_decline エラーコードと insufficient_funds 支払い拒否コードを返します。
{any_prefix}+agreement_type_not_supported@{any_domain}PaymentIntent のステータスは、20 秒後に requires_action から requires_payment_method に移行します。Stripe は payment_method_provider_decline エラーコードを返します。同意書のステータスは inactive になります。

オプション支払い後のイベントを処理する

このページはお役に立ちましたか。
はいいいえ
お困りのことがございましたら 、サポートにお問い合わせください。
早期アクセスプログラムにご参加ください。
変更ログをご覧ください。
ご不明な点がございましたら、お問い合わせください。
LLM ですか?llms.txt を読んでください。
Powered by Markdoc