After you install the WP Payment Gateway Bundle plugin, you will need to configure some Braintree Gateway specific settings in the plugin which you will need to obtain from your Braintree merchant account.
You can find the Braintree specific settings required by the plugin under the “Gateway Settings” tab when you go to the payment gateway bundle plugin’s settings menu. The following screenshot shows how you can access the settings page of this addon:
In order to configure the Braintree Subscription portion of the payment gateway bundle you will need to obtain the required details from your Braintree merchant account by following the steps outlined below:
Step 1: Log into your Braintree merchant account and click My User under Account.
Step 2: Go to the API Keys, Tokenization Keys, Encryption Keys section and click View Authorizations. Copy and paste your account credentials into a notepad for later use.
Step 3: Now from your WordPress administration panel, go to Braintree Subscription Settings (under Payment Gateway Bundle->Gateway Settings).
Step 4: Enter your Merchant ID.
Step 5: Enter your Public key.
Step 6: Enter Private key.
Step 7: Copy the Braintree Webhook URL for your site and specify it in your merchant account (Settings > Webhooks).
You can choose to receive notifications for all the subscription events. However, the plugin will currently handle these events – Cancelled, Charged Successfully and Expired.
Step 8: Hit the “Update” button to save your Braintree account credentials in the Payment Gateway Bundle settings.
Create a Subscription Plan
In order to accept recurring payments for your eStore subscription product, you will need to create a plan in your Braintree account. If you have 10 eStore subscription products that you wish sell with Braintree, you will need to create 10 separate plans in your Braintree merchant account. Each plan interface is very similar to the subscription settings section of an eStore product. For example: Recurring Billing Price, Recurring Billing Cycle etc.
When a new subscription is created on your site, Braintree will charge/rebill the customer based on these configurations (not your eStore subscription product). Your eStore subscription product will just be a template for the plan that you create in your Braintree account. Unfortunately, Braintree API doesn’t allow an external script to create this plan (you will need to do this manually). That means the payment gateway bundle addon needs to assume the ID of the plan that you are going to create for an eStore product.
How to Name a Plan ID
The Plan name can be anything you like. However, The Plan ID needs to be unique in your account and something that can be synchronized with the eStore product in question. In order to integrate an eStore product with a plan created in your Braintree account, your Plan ID should be:
Here, SiteAddress is the URL specified in your WordPress dashboard (Settings > General > Site Address) and EstoreProductID is the eStore product ID (example: 1). Since you can only use limited special characters in the plan ID you will need to remove http:// or https:// from SiteAddress and replace all dots with hyphens.
Plan ID Example
1. if your SiteAddress is http://example.com and you are creating a plan for eStore product 2, your plan ID should be:
2. if your SiteAddress is http://www.example.com and you are creating a plan for eStore product 7, your plan ID should be:
3. if your SiteAddress is http://www.my-site.com and you are creating a plan for eStore product 10, your plan ID should be:
When a new subscription is created, Braintree plan allows you to bill the customer in a future date (instead of charging immediately). Unfortunately, we can’t support this feature since our eStore product was designed to charge the customer immediately.
Shortcode for Subscription Button
You need to embed the following shortcode in a WordPress Post/Page to accept recurring payments via Braintree:
[wp_pg_eStore_subscription_button id="1" gateway="braintree_subsc"]
(Replace 1 with your actual eStore product ID)
Customizing the Look of the Braintree Subscription Button
WP eStore plugin allows you to customize all of your subscription buttons by using a custom button image of your choice. If you want to customize the look of your Braintree subscription button then read this post.
Using Braintree Subscription Button with Fancy Display Template
You can use the following shortcode to use a fancy display template with the Braintree subscription button:
[wp_eStore_fancy_display id="50" type="3" style="1" gateway="braintree_subsc"]
WP eStore product ID of the item is 50 in the above example. You will need to change that value to your actual product ID.