Braintree Direct is one of the sophisticated API for handling payment transaction. It provides set of client and server SDKs to process the requests.
Photo by Towfiqu barbhuiya on Unsplash
Braintree is a full-stack payment platform. It allows you to accept online payments from customers in your application or website. The benefit of using Braintree is that it provides you with all services in one place, eliminating the need to separately set up payment gateways and merchant accounts.
Braintree is owned by PayPal. It offers many products such as Braintree Direct, Braintree Extend, Braintree Marketplace, etc. Each product offers a different set of tools and services.
Braintree Direct
Braintree Direct consists of a set of tools that accept, verify, and process different payment methods. In other words, Braintree Direct consists of Software Development Kits (SDKs) for both the clients and servers.
- The client SDK provides tools and techniques to securely collect payment information supplied by the customer.
- The server SDK consists of tools to enable secure processing of the collected payment information.
Drop-in UI
Drop-in UI is a complete and ready-made payment UI provided by Braintree that offers a quick and easy way to securely accept payments. The UI includes a card entry form and, if enabled, PayPal, Venmo, Apple Pay, and Google Pay buttons. When a user successfully completes the UI, your client code obtains a payment method nonce for use on your server.
Drop-in UI provides us with the following benefits:
- Quick and easy integrations: Quickly integrate the Drop-in UI into the checkout flow of your app or website.
- User-friendly and customizable UI: Customize the checkout form to meet your needs, and fit your brand requirements.
- Accept PayPal, cards, and more: Easily add new payment methods to your form.
Client Workflow
The workflow of the events performed by our client using the Braintree SDK is shown below:
- Token request sent to the server
- Client token received from the server
- Payment information sent to Braintree to get a payment method nonce
- Payment method nonce received from Braintree
- Payment method nonce sent to the server
Server Workflow
The workflow of the events performed by our server in making a transaction is given below:
- Receive client token request from the client
- Generate a client token
- Send the client token to the client
- Receive the payment method nonce from the client
- Send the payment method nonce to Braintree to create a transaction
Braintree is one of the simplest payment gateway to integrate, if you’re looking to integrate your application with a payment gateway, Braintree would be a ideal choice.
Note: Braintree is not sponsoring this post, It just my tech exploration!