Sunteți pe pagina 1din 1

Testing | Stripe Payments https://stripe.

com/docs/testing

Testing
Learn about the different methods to test your integration before going live.

Overview
This page includes test card numbers and other information to
make sure your integration works as planned. Use it to trigger
different flows in your integration and ensure they are handled
accordingly.

Payment Intents API

When using the Payment Intents API with Stripe's client libraries and SDKs, ensure that:

Authentication flows are triggered when required (use the regulatory test card numbers and
PaymentMethods.)
No authentication (default U.S. card): 4242 4242 4242 4242 .
Authentication required: 4000 0027 6000 3184 .
The PaymentIntent is created with an idempotency key to avoid erroneously creating duplicate
PaymentIntents for the same purchase.
Errors are caught and displayed properly in the UI.

Charges API

When using the Charges API with Stripe's client libraries and SDKs, ensure that:

The card Element is passed correctly to createToken in your submit handler.


In the response handler for createToken , card errors are handled and displayed properly.
Only valid tokens are passed to your server as part of payment form submission.

Server-side code

In your server-side code, ensure that:

All requests are being made successfully. You may find it useful to view your account's events and
logs as you test your integration.
All API errors are handled properly.
Relevant webhooks are handled correctly.

When you’re ready to take your integration live, replace your test publishable and secret API keys with live ones.
Live payments cannot be processed if your integration is still using your test keys.

Test card numbers and tokens


Genuine card information cannot be used in test mode. Instead, use any of the following test card
numbers, a valid expiration date in the future, and any random CVC number, to create a successful
payment.

Card numbers Tokens PaymentMethods

NUMBER BRAND CVC DATE

1 of 1 1/10/2020, 5:08 AM

S-ar putea să vă placă și