Use the credit card values below to trigger different responses from the gateway.
No credit card errors
The following credit card values will not trigger specific credit card errors, but this does not mean that your test transaction will be successful. Values passed with the transaction (e.g. amount) can be used to trigger other types of gateway responses. See Test Amounts for more details.
Test Value | Card Type |
---|---|
378282246310005 |
American Express |
371449635398431 |
American Express |
36259600000004 |
Diners Club |
6011111111111117 |
Discover |
3530111333300000 |
JCB |
6304000000000000 |
Maestro |
5555555555554444 |
Mastercard |
2223000048400011 |
Mastercard |
4111111111111111 |
Visa |
4005519200000004 |
Visa |
4009348888881881 |
Visa |
4012000033330026 |
Visa |
4012000077777777 |
Visa |
4012888888881881 |
Visa |
4217651111111119 |
Visa |
4500600000000061 |
Visa |
Unsuccessful credit card verification
The following credit card numbers will simulate an unsuccessful card verification response.
Test Value | Card Type | Verification Response |
---|---|---|
4000111111111115 |
Visa | processor declined |
5105105105105100 |
Mastercard | processor declined |
378734493671000 |
American Express | processor declined |
6011000990139424 |
Discover | processor declined |
38520000009814 |
Diners Club | processor declined |
3566002020360505 |
JCB | failed (3000) |
Card type indicators
The following card numbers can be used to simulate various types of cards. Using any of the card numbers below will force the corresponding card type indicator to return "Yes" and the others to return "No" or "Unknown":
Test Value | Card Type Indicator Response |
---|---|
4500600000000061 |
prepaid = "Yes" |
4009040000000009 |
commercial = "Yes" |
4005519200000004 |
Durbin regulated = "Yes" |
4012000033330026 |
healthcare = "Yes" |
4012000033330125 |
debit = "Yes" |
4012000033330224 |
payroll = "Yes" |
4012000033330422 |
all values = "No" |
4012000033330323 |
all values = "Unknown" |
Disputes
Creating a disputed test transaction
You can use the following test card number to create sale transactions in the sandbox that are instantly disputed:
Test Value | Card Type | Description |
---|---|---|
4023898493988028 |
Visa | Creates a settled sale transaction that has a dispute with an open status |
In addition to creating a test dispute, using this test card to create sandbox transactions will allow you to:
- Receive a dispute email notification
- Receive a Dispute Opened webhook (if set up)
- Search for or find the dispute in the Control Panel or via the API
- Respond to the dispute in the Control Panel or via the API with specific evidence that will update the dispute status to
won
orlost
When creating a disputed test transaction, you can also set the transaction amount to control the dispute reason_code
:
Amount | Dispute Reason Code |
---|---|
83.00 | 83 Visa Fraud |
10.40 | 1040 Visa Fraud |
13.10 | 1310 Visa Fraud |
70.30 | 7030 Discover Fraud |
Managing test disputes
To simulate winning or losing a dispute in the Control Panel:
- Log into the sandbox Control Panel
- Navigate to Disputes
- Click Dispute on the chargeback you would like to dispute
- Under the Additional Dispute Evidence field, enter the following text:
compelling_evidence
to simulate a won disputelosing_evidence
to simulate a lost dispute
- Click Submit Dispute
To simulate winning or losing a dispute via the API:
- Find the dispute
- Add text evidence using one of the following strings:
compelling_evidence
to simulate a won disputelosing_evidence
to simulate a lost dispute
Other card information
Test Value | Card Information |
---|---|
4012000033330620 |
country of issuance = "USA" |
4012000033330729 |
country of issuance = "CAN" |
4012000033330521 |
issuing bank ="NETWORK ONLY" |
Go live
Create an API user
Production API credentials, including your API keys, must be entered into your server-side code to connect API calls to the Braintree gateway. While each user in your gateway has their own unique set of API keys, only one set can be included in your integration.
We do not recommend including an individual user's API credentials. If you ever need to delete or suspend that user, this could break your connection to Braintree and result in failed transactions.
Instead, create a new user specifically designated as the API user, whose API keys can be used for your integration. This user should be set up with an email address that is not associated with a single employee and should have Account Admin permissions in order to avoid issues such as an authorization error.
Get production credentials
Log into your production account as the API user to obtain your API credentials. You'll need the:
- Production merchant ID
- Production public key
- Production private key
Keep in mind that public and private keys are both environment- and user-specific.
Update production account settings
Make sure your production account settings mirror the ones in your tested sandbox configuration. Be sure to recreate any recurring billing plans or settings if you plan to use recurring billing in production.
Update live server configuration
In your server code, update your configuration to production values:
gateway = Braintree::Gateway.new(
:environment => :production,
:merchant_id => "use_your_merchant_id",
:public_key => "use_your_public_key",
:private_key => "use_your_private_key",
)
Once you have updated these values and configured your preferred processing settings, the live production environment will function similarly to the sandbox environment you've been using for development. Learn more about the differences between production and the sandbox.
On the client side, no configuration updates are needed when you make the switch to production – your client obtains its client token from your server, which is all the configuration it needs.
Test transactions in production
It is important to test your production account by creating a couple of low-value sale transactions for each of the payment method types you plan to accept. Be sure to submit the transactions for settlement, and then confirm that the funds have deposited into your bank account. This typically happens a few days after they have settled.
See also
- Accepted payment methods
- Accepted currencies
- Credit card response object
- Payment method request
- Payment method response object