小编Thi*_*ães的帖子

PayPal 智能支付按钮与服务器端 REST API 的集成

我知道有一些关于 PayPal 集成的问题,但我正在尝试使用智能按钮和 REST API 实施 PayPal 快速结账,但没有成功。

我想做的是:

  1. 创建付款授权(使用payidorderid

  2. 将此发送payid给客户端(javascript)以进行批准。

  3. 付款后重定向到确认页面。

我已经使用以下代码创建了付款授权:

<?php

// 1. Autoload the SDK Package. This will include all the files and classes to your autoloader
// Used for composer based installation
require __DIR__  . '/PayPal-PHP-SDK/autoload.php';
// Use below for direct download installation
// require __DIR__  . '/PayPal-PHP-SDK/autoload.php';


// After Step 1
$apiContext = new \PayPal\Rest\ApiContext(
        new \PayPal\Auth\OAuthTokenCredential(
            'client id',     // ClientID
            'cliente secret'      // ClientSecret
        )
);

// …
Run Code Online (Sandbox Code Playgroud)

api rest integration paypal

6
推荐指数
1
解决办法
3339
查看次数

标签 统计

api ×1

integration ×1

paypal ×1

rest ×1