Payment gateway is imperative in e-commerce as it helps to transfer the information of a transaction between payment portal and the front-end processor or bank.It ensures that transactions are carried out in a secure manner. It ensures that transactions Payment gateway allows your online store to accept credit card payments from customers. Picking the right gateway can help save you money and keep your business running smoothly.Picking the right gateway can help save your money and keep your business running smoothly. Once you’ve chosen your payment gateway, integrating it into your online store software is plain sailing. Here we have used Braintree Sandbox for Integrating Payment Gateway in WaveMaker.


Braintree is a full-stack payments platform that makes it easy to accept payments in your app or website. Their service replaces the traditional model of sourcing a payment gateway and merchant account from different providers. From single-touch payments to mobile SDKs(Software Development Kit) and foreign currency acceptance, Braintree provides everything we need to initiate acceptance of payments today. From startups in garages, to not-for-profits, to some of the largest online retailers, all kinds of organizations use Braintree to accept payments in mobile apps and websites. Merchants can use Braintree to accept PayPal, Apple Pay, Android Pay, Venmo, and most credit and debit cards, including Visa, Mastercard, American Express, Discover, JCB, and Diner’s Club.


Steps for Integrating Braintree Payment Gateway in WaveMaker:

  1. Need to create a Braintree Sandbox account.Once its done, Merchant_Id, Public Key and Private Key will be generated for our account.
  2. Two SDKs are required for implementation – Client SDK & Server SDK. The client SDKs enable you to securely collect payment information from your customers. The server SDKs enable you to act on the collected payment information. Here in Wavemaker, we are using JavaScript for Client SDK and Server SDK is done using JAVA.                  To import Braintree Payment Gateway in our project we need to Install and configure :-   a) Download Java library( JAR file to integrate with the Braintree gateway) and include its source in index.html OR b)Edit the  pom.xml file and add following dependencies:
  3. At first front-end requests a client token from server to initialize client SDK. Add java script coding for connecting UI and Braintree.

    4.Server  generates a token and sends it back to client. Once the client SDK is initialized and the customer has submitted payment information, the SDK communicates that information and returns a payment method nonce*.

    *Note :-A payment method nonce is a secure, one-time-use reference to payment information. It’s the key element that allows your server to communicate sensitive payment information to Braintree without ever touching the raw data.

    5.You then send payment method nonce* to server.Your server code receives the payment method nonce* from client and uses server SDK to create a transaction.Java Service Code for generating client token and transaction as shown below :

Payment UI Screen

 Braintree Sandbox After Transactions