Sehrish
Sehrish

Reputation: 13

Braintree PayPal Integration

Do Braintree API support PayPal integration for web/desktop application? Or it is just for mobile apps/websites? If Braintree API support PayPal integration for desktop application, then what steps should be follow if I am using PHP as programming language? P.S. I have already googled it and found no answer.

Upvotes: 0

Views: 5966

Answers (2)

mickeyreiss
mickeyreiss

Reputation: 490

Yes, Braintree supports PayPal in web browsers served from a PHP backend.

First you'll need to install the PHP SDK: That class is not built in and must be downloaded and required before it is available. Have you downloaded the latest PHP SDK?

This is an example of the code you need to initialize the SDK but with dummy values:

<?php

require_once 'PATH_TO_BRAINTREE/lib/Braintree.php';

Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('your_merchant_id');
Braintree_Configuration::publicKey('your_public_key');
Braintree_Configuration::privateKey('your_private_key');

Next, you'll need to setup the client. See https://developers.braintreepayments.com/javascript+php/sdk/server/setup for download instructions.

This tutorial demonstrates exactly how to get started with the coding.

Once you have completed this integration against Braintree's sandbox, you will need to sign up for a production account.

Upvotes: 1

Drew Angell
Drew Angell

Reputation: 26056

Here's a general PHP SDK for Braintree's API. It seems to be a pretty complete SDK with good samples and everything put together for you.

As a side note, I'm curious why you're planning on using Braintree instead of PayPal directly..?? I still prefer hitting PayPal's existing API because they're so mature and have so many features. This PHP library for PayPal makes all of the calls very simple, too.

Braintree is unique in what they're doing with their SDK's, but as you've noticed, they really seem to be focused more on mobile. They came into PayPal with lots of big companies already using it, which is why PayPal acquired them, but they don't offer anything PayPal doesn't already offer, and in my experience it's still cheaper to just use PayPal directly.

I may be missing out on something I haven't understood, though, so if you have any specific reasons you'd like to go with Braintree I'd love to know!

Upvotes: 0

Related Questions