Credit Cards

Testing and Go Live

The sandbox environment only accepts specific test credit card numbers. Use the credit card values below to trigger different responses from the gateway.
Note
When testing card verifications and transactions, keep in mind:
  • Transaction success is determined by the test amount you use. For example, when testing decline scenarios.
  • Verification success is determined by the test card number you use. For example, when testing Vault and recurring billing scenarios.
Learn more about the difference between transactions and verifications.

Valid card numbersAnchorIcon

These credit card numbers will not trigger specific credit card errors.
Note
Using these numbers does not necessarily mean that a transaction will be successful in the sandbox. Other values that impact transaction success include:
Test ValueCard Type
378282246310005American Express
371449635398431American Express
36259600000004Diners Club*
6011000991300009Discover
3530111333300000JCB
6304000000000000Maestro
5555555555554444Mastercard
2223000048400011Mastercard
4111111111111111Visa
4005519200000004Visa
4009348888881881Visa
4012000033330026Visa
4012000077777777Visa
4012888888881881Visa
4217651111111119Visa
4500600000000061Visa
6243030000000001UnionPay
6221261111117766UnionPay
6223164991230014UnionPay
*Diners Club cards are processed as Discover cards.

Card numbers for unsuccessful verificationAnchorIcon

The following credit card numbers will simulate an unsuccessful card verification response .
Note
Verifying a card is different than creating a transaction. To trigger an unsuccessful transaction, adjust the amount of the transaction .
Test ValueCard TypeVerification Response
4000111111111115Visaprocessor declined
5105105105105100Mastercardprocessor declined
378734493671000American Expressprocessor declined
6011000990139424Discoverprocessor declined
38520000009814Diners Club*processor declined
3566002020360505JCBfailed (3000)
*Diners Club cards are processed as Discover cards.

Card numbers with type indicatorsAnchorIcon

The following card numbers can be used to simulate various types of cards, such as prepaid, commercial , or healthcare . 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 ValueCard Type Indicator Response
4500600000000061prepaid = "Yes"
4012004338508385prepaid = "Yes", debit = "Yes"
4009040000000009commercial = "Yes"
4005519200000004Durbin regulated = "Yes"
4012000033330026healthcare = "Yes"
4012000033330125debit = "Yes"
4012000033330224payroll = "Yes"
4012000033330422all values = "No"
4012000033330323all values = "Unknown"

Card numbers with other informationAnchorIcon

Test ValueCard TypeCard Information
4012000033330620Visacountry of issuance = "USA"
4012000033330729Visacountry of issuance = "CAN"
4023490000000008Visacountry of issuance = "IRL"
4444333322221111Visacountry of issuance = "GBR"
5555444433331111Mastercardcountry of issuance = "GBR"
374512431123241Amexcountry of issuance = "GBR"
375529658790105Amexcountry of issuance = "IRL"
5101108206957373Mastercardcountry of issuance = "IRL"
4012000033330521Visaissuing bank ="NETWORK ONLY"

Go liveAnchorIcon

Important
Your sandbox account is not linked to your production account in any way. Nothing created in the sandbox will transfer to production. This includes processing options and recurring billing settings. Your login information, merchant ID, and API keys will also be different.

Create an API userAnchorIcon

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 credentialsAnchorIcon

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 settingsAnchorIcon

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 configurationAnchorIcon

In your server code, update your configuration to production values:
  1. Java
BraintreeGateway gateway = new BraintreeGateway(
  Environment.PRODUCTION,
  "YOUR_PRODUCTION_MERCHANT_ID",
  "YOUR_PRODUCTION_PUBLIC_KEY",
  "YOUR_PRODUCTION_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 productionAnchorIcon

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.
Important
Real payment methods must be used in the production environment. Test values from the sandbox testing page will not work. This means that every test transaction that you allow to settle in your production account will debit funds from the associated payment method and fees will be assessed. Be sure to test with reasonable amounts and only run a limited number of transactions.

See AlsoAnchorIcon

We currently use cookies to improve and customize your experience on our site. If you accept, we’ll also use marketing cookies to show you personalized ads. Manage your cookies and learn more.