You can configure Stripe to be in test mode or live mode. While Live mode is used to collect real credit card information and process real payments, test mode is useful during initial development of your site as it enables you to test everything by using a test credit card and without spending real money.
There are three main steps you need to take to in order to configure Stripe for testing within MemberMouse. The first is to indicate that you want to be in test mode, the second is to select whether you want to use Stripe Elements or Stripe.js, and the third is to obtain the test API keys from Stripe and paste them into MemberMouse.
Obtaining the Stripe API Key
- Log into Stripe.com.
- In the main Dashboard screen, you'll see a menu on the lefthand side. Select Developers > API Keys from that menu. The API page will load.
- While on the API Keys page, click on the View Test Data slider button in the upper righthand corner. This will bring up your API Test Keys.
- Copy the Test Publishable Key and Test Secret Key from the Token column.
Configuring Stripe in Test Mode
- From your WordPress Dashboard go to MemberMouse > Payment Settings and click on the Payment Methods tab.
- Under Onsite Payment Method, select Stripe. This will display the Stripe configuration options.
- Click the check box next to Enable Test Mode to indicate that you want to process credit cards and payments in test mode.
- Indicate whether or not you want to keep Stripe Elements enabled or enable Stripe.js.
With Stripe Elements, a 3D Secure checkout flow occurs. Stripe Elements uses Stripe.js for tokenization, but also embeds Stripe's credit card fields directly on the checkout page via iFrame. This is mandatory for customers in the European Economic Area (EEA) to be compliant with the Strong Customer Authentication (SCA) requirement of the PSD2. Stripe Elements is the recommended method to use.
Stripe Elements is the recommended method to use.
- Paste the Stripe Test Secret Key in the field labelled Test Secret Key.
- [Only if using Stripe Elements] Paste the Stripe Test Publishable Key in the field labelled Test Publishable Key.
- Click the Save Payment Methods button.
Your site is now ready to start accepting test credit card payments and processing them through your Stripe account.
Making Test Purchases
You can make test purchases the same as you would make live purchases. The only difference is that you'll need to use specific test card numbers defined by Stripe. You can find those test card numbers in the Stripe configuration area on the Payment Methods tab by clicking the Test Credit Card Numbers link.
You can use the following test credit card numbers when testing payments where the test cards do not require authentication from the customer's card issuer. The expiration date must be set to the present date or later:
- Visa: 4242424242424242
- Visa: 4012888888881881
- Mastercard: 5555555555554444
- Mastercard: 5105105105105100
- American Express: 378282246310005
- American Express: 371449635398431
- Discover: 6011111111111117
- Discover: 6011000990139424
- Diners Club: 30569309025904
- Diners Club: 38520000023237
- JCB: 3530111333300000
- JCB: 3566002020360505
Cards for Testing Secure Checkout Flows
The below card numbers can be used to test circumstances where authentication from the customer's card issuer is required. We have included the ones most frequently used. However, a complete list of test card numbers can be found at https://stripe.com/docs/testing#cards
Strong Customer Authentication Testing
Use the following card information to test payments affected by regional regulations such as Strong Customer Authentication (SCA).
- 4000002500003155 – This card requires authentication for one-time payments. However, if you set up this card and use the saved card for subsequent off-session payments, no further authentication is needed. In live mode, Stripe dynamically determines when a particular transaction requires authentication due to regional regulations such as Strong Customer Authentication.
3D Secure Testing
Not all cards support 3D Secure or require the customer be redirected to their card issuer's authentication page. Use the following card information to test 3D Secure payments
- 4000000000003220 – 3D Secure 2 authentication must be completed for the payment to be successful.
- 4000000000003063 – 3D Secure authentication must be completed for the payment to be successful.
- 4000000000003055 – 3D Secure authentication may still be performed, but is not required. By default, 3D Secure authentication will not be requested for this card.
- 4000008400001629 – 3D Secure authentication is required, but payments will be declined with a card_declined failure code after authentication.
Using Test Data
MemberMouse also allows you to specify test data for all common fields that need to be filled out when making a purchase. When you specify test data, MemberMouse will automatically populate the fields of checkout forms with the data you've provided which significantly speeds up your testing process. Read this article to learn how to set up and use test data.