Integrating with Braintree by PayPal for eCommerce
Braintree by PayPal is an online payment processing platform that allows businesses to send and receive payments over the internet. It is fully integrated into Academy of Mine's checkout process. Payments made in Academy of Mine will be passed on to Braintree for collection.
Note: Academy of Mine does not directly collect payments. In order to collect payments, you will need to sign up with a third party payment gateway, such as Braintree by PayPal, then connect it with the Academy of Mine platform using the API credentials provided by the payment gateway. Before proceeding with this guide, you must sign up for a Braintree by PayPal account.
This guide will help you complete your Braintree integration, set up testing, and ultimately go live to collect real payments.
Be sure to review our overview of eCommerce Setup guides: Introduction to eCommerce
In this article
Setting Up the Braintree Integration
There are four overarching steps to setting up this integration--preparing your AOM account, adding the Braintree API credentials, testing the test keys and then adding the true production keys.
You'll need to have a Braintree account already set up, and will be going between the AOM site and Braintree. We'll go through each of these steps in detail here:
Step 1: Prepare Payment Settings in AOM
The first step is to set up the Braintree integration within Academy of Mine.
- From the Admin Dashboard, select eCommerce, then Settings. Then click the Payment tab
- Select Manage in the Braintree section to enter the Braintree Settings page.
- Enter a Title: the title you add will appear on the Payment Details section of your checkout page.
What the user sees during checkout:
Step 2: Add Your API Credentials
Note: Braintree has two sets of API keys, one for testing and one for real payments. You must use the test keys first, and once you are ready for real payments, you will swap the test keys for the live keys.
Braintree's test keys are found in the Sandbox account at sandbox.braintreegateway.com. You must use these before you swap them for the live keys.
- To begin using your Braintree integration, you'll need to add your Braintree Sandbox API credentials.
- In Braintree, you'll need to collect your Sandbox Authorization Key, Merchant ID, Public Key, and Private Key. These can be found at API > Keys
- The API Keys section will contain your Public Key, Private Key, and Merchant ID.(image altered for security purposes)
- The Tokenization Keys section will contain your Authorization Key.(image altered for security purposes)
- Back in Academy of Mine, enter those keys in the Braintree Settings page to complete the integration.(image altered for security purposes)
- Enable Braintree via the toggle. Before you begin testing in your account, you must enable Braintree. If Braintree is not enabled, your Academy of Mine account will not connect with your Braintree account.
- Click Save Changes
Step 3: Begin Testing
Note: You cannot use a live credit card during testing. You must use Braintree's test credit card numbers. View this Braintree testing guide for a list of transaction amounts and credit card numbers to complete your testing.
- Once you have successfully added your Sandbox API credentials and enabled Braintree in AOM, you are ready to attempt test payments.
- When checking out and placing an order, it is important that you use a test credit card number provided by Braintree, rather than a live credit card. If you need a hand going through checkout, take a look here.
For example, when testing a successful transaction with Visa you will use the card number 4111 1111 1111 1111, a CVC of any 3 digits, and an expiration date of any future date.
Step 4: Ready for Production
Note: when using Braintree live API keys, real cards must be used, and real payments will be processed. Braintree's live API keys are found in your Production account.
Once your tests have completed successfully and you are ready to accept real payments, follow these steps:
- Within Braintree, leave your Braintree Sandbox account and get a Production account.
- Create an API user with Production API keys.
- Get your Production API credentials. You'll need your Production Authorization Key (Tokenization Key), Production Merchant ID, Production Public Key, and Production Private Key. Add those to your Braintree integration settings within AOM (image altered for security purposes)
- Update your Production account settings to mirror your old Sandbox account settings.
- Update your live server configuration to Production values.
- In your Braintree integration settings in AOM, enable the setting for Ready for Production. This is the final safety in place to prevent a real payment. Enabling it will officially turn on real payments.
- Click Save Changes
- Optional step: test real payments in your Academy of Mine account. Create low value transactions to test, for example a simple Product for $1. Again, you must use a real payment method for these tests.
Up next, you'll learn about creating Products to sell your Courses: