To test various scenarios, KOMOJU supports a handful of test card numbers and other payment method-specific inputs that simulate different outcomes.
Note that these only work in test mode. You're in test mode when you use the secret key of your test merchant. See Authentication.
Transactions created in Live mode are subject to settlement fees, even if created for testing purposes.
Please note that even if a refund is processed later, all transactions once marked as "Paid" will still incur payment processing fees.
If you're integrating KOMOJU using Hosted Fields or the WooCommerce plugin, you need to use 3-D Secure (3DS) aware cards, as these integrations support 3DS-aware cards only. If you see authentication failures continuously, please retry with the test cards which are clearly indicated as "3DS-aware". If you want to simulate a specific test scenario with 3DS-aware cards, please also refer to the section for Alternative Payment Methods.
Credit Card Numbers
| Card Number | Type |
|---|---|
| 3530111333300000 | JCB (3DS Not Supported) |
| 378282246310005 | American Express (3DS Not Supported) |
| 4111111111111111 | Visa (3DS Not Supported) |
| 5555555555554444 | MasterCard (3DS Not Supported) |
| 30569309025904 | Diners Club (3DS Not Supported) |
| 4100000000000100 | Visa (3DS-aware) |
| 5100000000000107 | Mastercard (3DS-aware) |
| 3528000000000106 | JCB (3DS-aware) |
| 4123111111111000 | Insufficient funds |
| 4123111111111018 | Exceeds card limit |
| 4123111111111034 | Bad verification value |
| 4123111111111042 | Card expired |
| 4123111111111059 | Cannot use card |
| 4123111111111075 | Invalid card |
WebMoney Numbers
| Card Number | Type |
|---|---|
| 1111111111111111 | WebMoney prepaid card with a 2000 yen balance |
| e111111111111112 | Invalid card number |
| e111111111111113 | Prepaid card has already been used |
| e111111111111114 | Card has been declined due to an unknown error |
Alternative Payment Methods
Some payment methods do not accept number inputs, and the card numbers above cannot be used to test 3DS. To simulate an error response for these cases in test mode, pass the following HTTP header. This example triggers an insufficient funds error:
Komoju-Scenario: insufficient_fundsYou can pass the header when creating payments, sessions, and tokens:
- When you pass it during payment creation, the payment fails immediately with the given error.
- When you pass it during session creation, every payment attempt through that session fails with the given error.
- When you pass it during token creation, every payment attempt using that token fails with the given error.
- A customer created from such a token is not affected; its transactions do not fail because of the header.