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.

note

Verifying a card is different than creating a transaction. To trigger an unsuccessful transaction, adjust the amount of the transaction.

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

While anyone can simulate a dispute in the sandbox Control Panel, the way you manage chargebacks in production depends on your account setup. Not all accounts will have disputes available in the Control Panel in production.

The following card number can be used to simlute an open dispute:

Test Value Result
4023898493988028 creates a settled sale transaction with an open dispute

You can simulate winning or losing a dispute in the Control Panel:

  1. Log into the sandbox Control Panel
  2. Navigate to Disputes
  3. Click Dispute on the chargeback you would like to dispute
  4. Under the Additional Dispute Evidence field enter:
    • compelling_evidence to simulate a won dispute
    • losing_evidence to simulate a lost dispute
  5. Click Submit Dispute

Other card information

Test Value Card Information
4012000033330620 country of issuance = "USA"
4012000033330521 issuing bank ="NETWORK ONLY"

Go live

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 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 recommend creating a new user specifically designated as the API user, whose API keys can be used for your integration. This user 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:

Ruby
Click to copy
Copied
Braintree::Configuration.environment = :production
Braintree::Configuration.merchant_id = "YOUR_PRODUCTION_MERCHANT_ID"
Braintree::Configuration.public_key = "YOUR_PRODUCTION_PUBLIC_KEY"
Braintree::Configuration.private_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.

note

If you have an iOS integration, verify that your released code does not use an offline client token by ensuring that you do not import BTClient+Offline.h. Once this is confirmed, you can publish to the App Store.

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.

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 also

Still have questions?

If you can’t find an answer, contact our Support team.