10. Creating Credit Cards for a Client


As mentioned earlier, you must have a Braintree Gateway in order to safely and securely store and charge credit/debit cards. Before attempting to utilize the Credit Card features please ensure that Ticket Evolution has completed your Braintree Gateway setup.

Testing Credit Cards in Sandbox

Test Card Numbers

The Ticket Evolution API Sandbox connects to Braintree’s Sandbox environment so that you can test creating credit cards and purchases without having to use a real credit card or worry about incurring any charges. The Braintree Sandbox only accepts test credit card numbers and they provide a list of different cards that do and do not results in errors.

Link: Braintree Sandbox test credit card numbers

Test Amounts

The Braintree Sandbox utilizes different test amounts to allow you to test various scenarios such as successful and unsuccessful charges. Please review their list of test amounts to ensure you are submitting the correct order total to match your desired test situation.

Link: Braintree Sandbox test amounts

Test CVV/CID Numbers

The Braintree Sandbox utilizes different CVV/CID values in order to test different scenarios.

Link: Braintree Sandbox test CVV/CID numbers

Testing the Address Verification System

Lastly, you can test different error and success situations with the Address Verification System (AVS) by using different street addresses and zip codes for the billing address of a card.

Link: Braintree Sandbox test AVS test values

Creating a Credit Card

If your Client is using a new credit card that is not yet stored in the Braintree Vault it is recommended that you create the credit card before submitting the order. This allows you to programmatically review the response to ensure that the card is valid and that the CVV/CID response and AVS response are in line with your settings. To ensure that only valid cards are stored in your Secure Vault, a $1.00 authorization will be made and then immediately voided, as is standard practice.

Since we have already created a Client, as well as some addresses and phone numbers for that Client in the previous step we will utilize those as the billing address and phone number for the credit card we will create. We will use client_id 168188, address_id 645334, and phone_number_id 294725.