Any time you work with a test card, use test API keys in all API calls. This is true whether you’re serving a payment form to test interactively or writing test code.
一般的な誤り
実際のカード詳細は使用しないでください。実際の決済手段の情報を使用して本番環境でテストすることは、Stripe 利用規約で禁止されています。テスト API キーと以下のカード番号を使用してください。
対話式でテストする
When testing interactively, use a card number, such as 4242 4242 4242 4242. Enter the card number in the Dashboard or in any payment form.
When writing test code, use a PaymentMethod such as pm_card_visa instead of a card number. We don’t recommend using card numbers directly in API calls or server-side code, even in test mode. If you do use them, your code might not be PCI-compliant when you go live. By default, a PaymentMethod isn’t attached to a Customer.
Most integrations don’t use Tokens anymore, but we make test Tokens such as tok_visa available if you need them.
When you’re ready to take your integration live, replace your test publishable and secret API keys with live ones. You can’t process live payments if your integration is still using your test API keys.
ブランド別のカード
To simulate a successful payment for a specific card brand, use test cards from the following list.
注意
Cross-border fees are assessed based on the country of the card issuer. Cards where the issuer country isn’t the US (such as JCB and UnionPay) might be subject to a cross-border fee, even in test mode.
ブランド
番号
セキュリティコード
日付
Visa
任意の 3 桁の数字
任意の将来の日付
Visa (デビット)
任意の 3 桁の数字
任意の将来の日付
Mastercard
任意の 3 桁の数字
任意の将来の日付
Mastercard (2 シリーズ)
任意の 3 桁の数字
任意の将来の日付
Mastercard (デビット)
任意の 3 桁の数字
任意の将来の日付
Mastercard (プリペイド)
任意の 3 桁の数字
任意の将来の日付
アメリカン・エキスプレス
任意の 4 桁の数字
任意の将来の日付
アメリカン・エキスプレス
任意の 4 桁の数字
任意の将来の日付
ディスカバー
任意の 3 桁の数字
任意の将来の日付
ディスカバー
任意の 3 桁の数字
任意の将来の日付
ディスカバー (デビット)
任意の 3 桁の数字
任意の将来の日付
ダイナースクラブ
任意の 3 桁の数字
任意の将来の日付
ダイナースクラブ (14 桁のカード)
任意の 3 桁の数字
任意の将来の日付
BCcard と DinaCard
任意の 3 桁の数字
任意の将来の日付
JCB
任意の 3 桁の数字
任意の将来の日付
銀聯
任意の 3 桁の数字
任意の将来の日付
銀聯 (デビット)
任意の 3 桁の数字
任意の将来の日付
UnionPay (19 桁のカード)
任意の 3 桁の数字
任意の将来の日付
大半の Cartes Bancaires および eftpos のカードは Visa または Mastercard とブランド提携しています。次の表のテストカードは、ブランド提携カードによる支払いの成功をシミュレーションします。
To test subscriptions that require mandates and pre-debit notifications, see India recurring payments.
オーストラリア (AU)
Visa
中国 (CN)
Visa
香港 (HK)
Visa
インド (IN)
Visa
日本 (JP)
Visa
日本 (JP)
JCB
マレーシア (my)
Visa
ニュージーランド (NZ)
Visa
シンガポール (SG)
Visa
台湾 (TW)
Visa
タイ (TH)
Visa (クレジット)
タイ (TH)
Visa (デビット)
拒否された支払い
To test your integration’s error-handling logic by simulating payments that the issuer declines for various reasons, use test cards from this section. Using one of these cards results in a card error with the given error code and decline code.
Each card simulates specific risk factors. Your Radar settings determine which risk factors cause it to block a payment. Blocked payments result in card errors with an error code of fraud.
With default account settings, charge succeeds, only to be disputed as fraudulent. This type of dispute is protected after 3D Secure authentication.
未着
With default account settings, charge succeeds, only to be disputed as product not received. This type of dispute isn’t protected after 3D Secure authentication.
照会
With default account settings, charge succeeds, only to be disputed as an inquiry.
The charge succeeds. If you initiate a refund, its status begins as pending. Some time later, its status transitions to succeeded and sends a charge.refund.updatedwebhook event.
非同期の失敗
The charge succeeds. If you initiate a refund, its status begins as succeeded. Some time later, its status transitions to failed and sends a charge.refund.updatedwebhook event.
You can cancel a card refund only by using the Dashboard. In live mode, you can cancel a card refund within a short but nonspecific period of time. Test mode simulates that period by allowing you to cancel a card refund within 30 minutes.
Stripe ダッシュボードで直接作成された支払いでは 3D セキュアのリダイレクトは行われません。代わりに、自社で構築されたフロントエンドまたは API コールを使用してください。
認証と設定
To simulate payment flows that include authentication, use the test cards in this section. Some of these cards can also be set up for future payments, or have already been.
説明
番号
詳細
設定がない場合に認証
This card requires authentication for off-session payments unless you set it up for future payments. After you set it up, off-session payments no longer require authentication.
常に認証
このカードは、カードの設定にかかわらず、すべての取引で認証が必要です。
すでに設定
This card is already set up for off-session use. It requires authentication for one-time and other on-session payments. However, all off-session payments succeed as if the card has been previously set up.
残高不足
This card requires authentication for one-time payments. All payments are declined with an insufficient_funds failure code even after being successfully authenticated or previously set up.
この支払いを正常に完了させるには、3D セキュア認証を実行する必要があります。デフォルトの場合、Radar ルールによってこのカードの 3D セキュア認証がリクエストされます。
3DS が必須
拒否
3D セキュア認証が必要ですが、認証後に支払いが card_declined エラーコードで拒否されます。デフォルトの場合、Radar ルールによってこのカードの 3D セキュア認証がリクエストされます。
3DS が必須
エラー
3D セキュア認証が必要ですが、3D セキュア検索リクエストが処理エラーで失敗します。支払いは、card_declined 失敗コードで拒否されます。デフォルトの場合、Radar ルールでこのカードの 3D セキュア認証がリクエストされます。
3DS に対応
OK
3D セキュア認証を実行できますが、必須ではありません。デフォルトの場合、Radar ルールでこのカードの 3D セキュア認証はリクエストされません。
3DS に対応
エラー
3D セキュア認証を実行できますが、必須ではありません。ただし、3D セキュアを実行しようとすると、処理エラーが発生します。デフォルトの場合、Radar ルールでこのカードの 3D セキュア認証はリクエストされません。
3DS に対応
未登録
このカードでは 3D セキュアがサポートされていますが、このカードは 3D セキュアに登録されていません。Radar ルールによって 3D セキュアがリクエストされても、顧客は認証するように求められません。デフォルトの場合、Radar ルールではこのカードの 3D セキュア認証がリクエストされません。
3DS に未対応
このカードでは 3D セキュアがサポートされていないため、呼び出すことができません。PaymentIntent または SetupIntent は、認証を行わずに続行されます。
3D セキュアのモバイルでのチャレンジフロー
モバイル決済の場合、顧客が UI プロンプトに対応するチャレンジフローをいくつか提供できます。テスト目的で特定のチャレンジフローを起動するには、このセクションに記載されているテストカードを使用します。このカードは、ブラウザーベースの決済フォームまたは API コールでの使用には適しません。こうした環境では、機能はするものの、特定の動作を起動することはありません。API コールには適さないため、テスト用の PaymentMethod と Token の値は提供していません。
チャレンジフロー
番号
詳細
Stripe 以外
すべての取引で 3D セキュア 2 認証を実行する必要があります。外部 UI を使用してチャレンジフローを起動します。
1 回限りのパスコード
すべての取引で 3D セキュア 2 認証を実行する必要があります。1 回限りのパスコード UI を使用してチャレンジフローを起動します。
単一選択
すべての取引で 3D セキュア 2 認証を実行する必要があります。単一選択の UI を使用してチャレンジフローを起動します。
複数選択
すべての取引で 3D セキュア 2 認証を実行する必要があります。複数選択の UI を使用してチャレンジフローを起動します。
PIN を使用した支払い
Use the test cards in this section to simulate successful in-person payments where a PIN is involved. There are many other options for testing in-person payments, including a simulated reader and physical test cards. See Test Stripe Terminal for more information.
説明
番号
詳細
オフライン PIN
This card simulates a payment where the cardholder is prompted for and enters an offline PIN. The resulting charge has cardholder_verification_method set to offline_pin.
オフライン PIN の再試行
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_pin.
オンライン PIN
This card simulates a payment where the cardholder is prompted for and enters an online PIN. The resulting charge has cardholder_verification_method set to online_pin.
オンライン PIN の再試行
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 online PIN. The resulting charge has cardholder_verification_method set to online_pin.
If your requests in test mode begin to receive 429 HTTP errors, make them less frequently. These errors come from our rate limiter, which is stricter in test mode than in live mode.
We don’t recommend load testing your integration using the Stripe API in test mode. Because the load limiter is stricter in test mode, you might see errors that you wouldn’t see in production. See load testing for an alternative approach.
カード以外の支払い
Any time you use a test non-card payment method, use test API keys in all API calls. This is true whether you’re serving a payment form you can test interactively or writing test code.
To test your integration’s redirect-handling logic by simulating a payment that uses a redirect flow (for example, iDEAL), use a supported payment method that requires redirects.