简体   繁体   English

PHP Paypal SDK 带支付数据传输

[英]PHP Paypal SDK with Payment Data Transfer

In Paypal developer account I have configured Payment Data Transfer settings and acquired Identity Token.在 Paypal 开发者帐户中,我配置了支付数据传输设置并获取了身份令牌。 (Return URL is also added) I am using PayPal PHP SDK. Which class and where in PHP code I can pass Identity Token? (还添加了返回 URL)我正在使用 PayPal PHP SDK。哪个 class 以及 PHP 代码中的哪个位置我可以传递身份令牌?

In PayPal PHP SDK, you can pass the Identity Token in the PayPal\Rest\ApiContext class. You would initialize an instance of the class and then set the identity token as follows: use PayPal\Rest\ApiContext;在 PayPal PHP SDK 中,您可以在 PayPal\Rest\ApiContext class 中传递身份令牌。您将初始化 class 的实例,然后按如下方式设置身份令牌: use PayPal\Rest\ApiContext;

$apiContext = new ApiContext();
$apiContext->setConfig(
    array(
        'mode' => 'sandbox',
        'log.LogEnabled' => true,
        'log.FileName' => 'PayPal.log',
        'log.LogLevel' => 'DEBUG',
        'validation.level' => 'log',
        'cache.enabled' => true,
        'token.userName' => '<PayPal-Client-Id>',
        'token.password' => '<PayPal-Client-Secret>',
        'token.sandbox' => '<Identity-Token>'
    )
);

Please replace "PayPal-Client-Id", "PayPal-Client-Secret", and "Identity-Token" with the appropriate values for your PayPal account.请将“PayPal-Client-Id”、“PayPal-Client-Secret”和“Identity-Token”替换为适合您的 PayPal 帐户的值。

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

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