PHP Venmo Integration with Braintree

In this article, we learn about Venmo Integration with Braintree using PHP for server-side implementation.

Introduction

Venmo is a payment method for mobile devices supported by Android and iPhone devices. But you can integrate Venmo on the web app which is only working when the website is open on mobile devices.

PHP Venmo Integration with Braintree

This guide is about how Venmo payment works with Websites or web apps with Braintree API using PHP.

Here are 3 important steps to integrate Venmo on the website using Braintree API.

3 Important Steps to Venmo Integration with Braintree

  • API configuration on the Braintree portal.
  • Client-side Implementation using JS
  • Server-side Implementation using PHP

Step-1: API Configuration on Braintree

For getting sandbox API keys first we have to create a sandbox account on Braintree Portal.

4 Simple Steps To Braintree Account Setup with API

Here the complete guide how to setup Braintree Account for getting API Key

Barintree Sandbox Register: https://www.braintreepayments.com/sandbox

After login to the portal Click below gear icon and go to the processing option.

Venmo Integration with Braintree

On the processing page you see the page like below go to the option and enable the venmo.

Venmo Integration with Braintree

After enabling the Venmo, go to the API option on top menu.

You can see this page, on this copy the Tokenization Keys

Venmo Integration with Braintree

Step-2: Client-side Implementation using JS

For implementing the client-side of the web App we use Braintree JavaScript V3 SDK, which supports Venmo as a payment option if the user has a mobile website.

Installation

To setup JavaScript SDK we use the CDN link of SDK which has version 3.

After the client JS, we load the Venmo and their data collector JS SDK. Here we how to include those JS SDK using the CDN link.

On very top you have to create an HTML button for JS Event click.

Client Initialization

To initialize the client we use Tokenization key which we take from above process.

Using that creating a Venmo component.

Collect Device Data

Device data is important and must have for complete the transaction.

After that we creating the Venmo button onClick functionality.

Complete Source code of Client-side Venmo Implementation

venmo_pay.php

Step-3: Server-side Implementation using PHP

First we include the Braintree PHP library for implementing server-side transaction.

Here is the github link of complete code with the Braintree PHP library included.

https://github.com/bikashkrpanda/PHP-venmo-integration-with-braintree

Complete Source code of Server-side implementation

venmo_server.php

Here the complete solution of the Venmo integration with PHP Braintree.

If you facing any issue, comment below I will try to resolve the issue.

Also check:

Happy Coding..!

Was this article helpful?
YesNo

By Bikash

My name is Bikash Kr. Panda. I own and operate PHPCODER.TECH. I am a web Programmer by profession and working on more than 50 projects to date. Currently I am working on the web-based project and all the CMS and frameworks which are based on PHP.

6 thoughts on “PHP Venmo Integration with Braintree”
  1. hello,
    i applied your code on my website, but it show “Browser does not support Venmo”.
    i am getting stuck for last 4 hours.
    venmo is working on web application or not. please tell me.

    1. Hi,
      Venmo payment is only supported for mobile devices..
      One way to test it…Before redirection process put inputs statically after that open url on mobile view using inspect Developer tool than hit that URL you get your output

  2. Hi,

    I am getting an error VENMO_NOT_ENABLED when I run braintree.venmo.create in the frontend. I have enabled venmo in sandbox console processing menu.

    Here is the error I get:
    {
    code: “VENMO_NOT_ENABLED”
    details: undefined
    message: “Venmo is not enabled for this merchant.”
    name: “BraintreeError”
    type: “MERCHANT”
    }

    Have you encountered this error before?

    Thank you,
    Miguel

      1. On the processing options, I have enabled venmo and now I get an options button that leads me to a list of merchant profiles. I have one merchant profile, which came in as default.

Leave a Reply

Your email address will not be published. Required fields are marked *