Stripe Terminal をテストする
Terminal の組み込みを効果的にテストする方法をご紹介します。
注
Stripe Terminal をテストするプロセスの大半は、Stripe のオンライン決済のテストと類似しています。また、テスト環境では Stripe Terminal でモバイルウォレット (Apple Pay や Google Pay など) を使用することはできません。詳細については、Stripe の一般テストガイドをご覧ください。
Terminal のデプロイを成功させる最善の方法は、システムの各部分をテストすることです。Stripe は各ステージ用のテストツールを用意しています。
- リーダーを注文する前に、リーダーシミュレーターで組み込みをテストします。
- 物理テストカードでハードウェアの組み込みをテストします。
シミュレーションされたリーダー
Stripe Terminal SDK およびサーバー主導型の連携にはシミュレーションされた内蔵カードリーダーが付属しているため、物理ハードウェアに接続することなくアプリを開発してテストすることができます。連携が完了している場合も、構築中であっても、シミュレーションされたリーダーを使用してアプリ内のすべての Terminal フローをエミュレートします。
The simulated reader doesn’t provide a UI. After connecting to it in your app, you can see it working when calls to the Stripe SDK or API succeed.
SDK のシミュレーションされたリーダーは、必要に応じて自動的にカード提示をシミュレーションします。サーバー主導型のシステムでは、構築済みのシステムを更新して、カード提示をシミュレーションします。
シミュレーションされたテストカード
シミュレーションされたリーダーは、シミュレーションされたテストカードを使用するよう設定できます。これにより、POS アプリケーション内のさまざまなフローをテストできるようになります。
支払い方法を収集する前に、以下のテストカード番号またはテスト支払い方法のいずれかを使用して特定のレスポンスを生成するよう、シミュレーションされたリーダーを設定します。
標準的なテストカード
テストカード番号 | Test payment method | ブランド |
---|---|---|
visa | Visa | |
visa_ | Visa (デビット) | |
mastercard | Mastercard | |
mastercard_ | Mastercard (デビット) | |
mastercard_ | Mastercard (プリペイド) | |
amex | アメリカン・エキスプレス | |
amex2 | アメリカン・エキスプレス | |
discover | ディスカバー | |
discover2 | ディスカバー | |
diners | ダイナースクラブ | |
diners_ | ダイナースクラブ (14 桁のカード) | |
jcb | JCB | |
unionpay | 銀聯 | |
interac | Interac | |
eftpos_ | eftpos オーストラリア | |
eftpos_ | eftpos オーストラリア/Visa | |
eftpos_ | eftpos オーストラリア/Mastercard |
特定の成功のためのテストカード
テストカード番号 | Test payment method | 結果 |
---|---|---|
offline_ | Simulates the cardholder being prompted for and entering an offline PIN. The resulting charge has cardholder_verification_method set to offline_ . | |
offline_ | Simulates an SCA-triggered retry flow where a cardholder’s initial contactless charge fails and the reader then prompts the user to insert their card and enter their offline PIN. The resulting charge has cardholder_verification_method set to offline_ . | |
online_ | Simulates a cardholder being prompted for and entering an online PIN. The resulting charge has cardholder_verification_method set to online_ . | |
online_ | Simulates an SCA-triggered retry flow where a cardholder’s initial contactless charge fails and the reader then prompts the user to input their online PIN. The final charge has cardholder_verification_method set to online_ . |
特定のエラーのためのテストカード
注
Using these specific cards for saving directly without charging and SetupIntents returns a setup_intent_authentication_failure response.
テストカード番号 | Test payment method | 結果 |
---|---|---|
charge_ | 支払いは card_ コードで拒否されます。 | |
charge_ | 支払いは card_ コードで拒否されます。decline_code 属性は insufficient_ です。 | |
charge_ | 支払いは card_ コードで拒否されます。decline_code 属性は lost_ です。 | |
charge_ | 支払いは card_ コードで拒否されます。decline_code 属性は stolen_ です。 | |
charge_ | 支払いは expired_ コードで拒否されます。 | |
charge_ | 支払いは processing_ コードで拒否されます。 | |
refund_ | Charge succeeds but refunding a captured charge fails asynchronously with a failure_ of expired_ . Because refund failures are asynchronous, the refund will appear to be successful at first and will only have the failed status on subsequent fetches. We also notify you of refund failures using the refund. webhook event. This simulated error is only supported in the JavaScript SDK. |
シミュレーションされたカード提示
サーバー主導型の実装を使用する場合、リーダーでのカード保有者のタップまたはリーダーへのカードの挿入をシミュレーションするには、present_payment_method エンドポイントを使用します。
{ "id": "tmr_xxx", "object": "terminal.reader", "action": { "failure_code": null, "failure_message": null, "process_payment_intent": { "payment_intent": "pi_xxx" }, "status": "succeeded", "type": "process_payment_intent" }, … }
パラメーターを指定しない場合、シミュレーションされた支払いは、PaymentIntent の支払い方法のタイプに基づき、デフォルトで有効なテストカードになります。以下は、Terminal 支払い方法タイプ用のデフォルトのテストカードです。
支払い方法のタイプ | テストカード番号 | Test payment method |
---|---|---|
card_ | visa | |
card_ と interac_ | visa | |
interac_ | interac |
標準的なテストカードでは、テスト金額を使用して失敗シナリオをシミュレーションすることもできます
シミュレーションされたリーダーの更新
シミュレーションされた Bluetooth リーダーに接続している間に、シミュレーションされたリーダーの更新を設定できます。
テスト用の法人カード
テスト用の法人カードを使用し、Stripe Terminal リーダーで支払いをテストします。Stripe ダッシュボードの Terminal タブからリーダーおよびテスト用の法人カードを購入できます。
This physical test card supports both chip entry and contactless payments. It only works with Stripe’s pre-certified readers, and only against the Stripe API in a sandbox. If you attempt to use your physical test card in live mode, the Stripe API returns an error. Unless stated otherwise, use the PIN 1234
when prompted.
テスト用の法人カードを使用して支払いを作成する際は、末尾が以下の値になる金額を使用して特定のレスポンスを生成します。
小数 | 結果 |
---|---|
00 | 支払いは承認されます。 |
01 | 支払いは call_ コードで拒否されます。 |
02 | When using readers featuring a cardholder-facing screen, insert (or tap, if supported) the test card. If the card requires a PIN, the payment declines with offline_ and requests PIN entry if the reader supports chip entry. Enter 1234 to complete the test payment. |
03 | When using readers featuring a cardholder-facing screen, insert (or tap, if supported) the test card. If the card requires a PIN, the payment declines with online_ and requests PIN entry. Enter any 4-digit PIN to complete the test payment. |
05 | 支払いは generic_ コードで拒否されます。 |
55 | 支払いは incorrect_ コードで拒否されます。 |
65 | 支払いは withdrawal_ コードで拒否されます。 |
75 | 支払いは pin_ コードで拒否されます。 |
For example, a payment processed using a physical test card for the amount 25.00 USD succeeds; a payment processed for the amount 10.05 USD is declined.
Interac テストカード カナダのみ
To test your Interac integration, you can use the simulated interac
test card or an Interac physical test card. You can order it from the Terminal hardware shop in the Dashboard. You can’t use the Stripe-branded physical test as an Interac card.
Interac テストカードは、interac_
支払いと interac_
返金の両方で機能します。card_
支払いをテストする際に使用するのと同じテスト金額を使用できます。特に記載がない限り、要求された場合は PIN 1234
を使用してください。拒否された返金をテストするには、末尾が 01
、05
、55
、65
または 75
の金額で一部返金を作成します。
注
Interac テストカードは、非接触型決済に対応していません。
eftpos テストカード オーストラリアのみ
To test your eftpos integration, you can use the simulated eftpos
test card or an eftpos physical test card. You can order it from the Terminal hardware shop in the Dashboard. You can’t use the Stripe-branded physical test card as an eftpos
card.
card_
支払いをテストする際に使用するのと同じテスト金額を使用できます。特に記載がない限り、要求された場合は PIN 1234
を使用してください。