简体   繁体   English

Braintree PayPal集成

[英]Braintree PayPal Integration

Do Braintree API support PayPal integration for web/desktop application? Braintree API是否支持Web /桌面应用程序的PayPal集成? 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? 如果Braintree API支持桌面应用程序的PayPal集成,那么如果我使用PHP作为编程语言,应该遵循哪些步骤? PS I have already googled it and found no answer. PS我已经谷歌搜索,没有找到答案。

Yes, Braintree supports PayPal in web browsers served from a PHP backend. 是的,Braintree在PHP后端提供的Web浏览器中支持PayPal。

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. 首先,您需要安装PHP SDK:该类不是内置的,必须下载并需要该类才可用。 Have you downloaded the latest PHP SDK? 您是否下载了最新的PHP SDK?

This is an example of the code you need to initialize the SDK but with dummy values: 这是初始化SDK所需的代码示例,但带有伪值:

<?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. 有关下载说明,请参见https://developers.braintreepayments.com/javascript+php/sdk/server/setup

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 . 完成与Braintree的沙箱的集成后,您将需要注册一个生产帐户

Here's a general PHP SDK for Braintree's API . 这是Braintree API通用PHP SDK It seems to be a pretty complete SDK with good samples and everything put together for you. 这似乎是一个非常完整的SDK,其中包含良好的示例,并且为您提供了所有内容。

As a side note, I'm curious why you're planning on using Braintree instead of PayPal directly..?? 作为附带说明,我很好奇您为什么打算直​​接使用Braintree代替PayPal。 I still prefer hitting PayPal's existing API because they're so mature and have so many features. 我仍然更喜欢使用PayPal的现有API,因为它们是如此成熟并且具有众多功能。 This PHP library for PayPal makes all of the calls very simple, too. 这个用于PayPal的PHP库也使所有调用非常简单。

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. Braintree在他们使用SDK的过程中是独一无二的,但是正如您所注意到的,他们似乎更专注于移动领域。 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. 他们进入Pay​​Pal时,已经有许多大公司在使用它,这就是为什么PayPal收购了它们的原因,但是他们不提供PayPal尚未提供的任何东西,而根据我的经验,直接使用PayPal仍然便宜。

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! 但是,我可能会错过一些我不了解的东西,因此,如果您有任何特定原因想要与Braintree合作,我想知道!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM