php - Paypal REST API : Unable to set landing page to billing

标签 php rest paypal

我正在使用带有 PHP SDK 的 Paypal REST API 为慈善机构构建捐赠功能。我一直在尝试将着陆页类型设置为“结算”,但似乎没有任何改变。这是我定义网络体验配置文件的代码(根据 http://paypal.github.io/PayPal-PHP-SDK/sample/doc/payment-experience/CreateWebProfile.html ):

use PayPal\Api\FlowConfig;
use PayPal\Api\Presentation;
use PayPal\Api\InputFields;
use PayPal\Api\WebProfile;

$flow = new FlowConfig();
$flow->setLandingPageType('Billing');

$presentation = new Presentation();
$presentation->setLogoImage('xxxxxxxx')
    ->setBrandName('xxxxxxxx')
    ->setLocaleCode('GB');

$inputFields = new InputFields();
$inputFields->setNoShipping(1)
    ->setAddressOverride(0);

$webProfile = new WebProfile();
$webProfile->setName('xxxxxxxx' . uniqid())
    ->setFlowConfig($flow)
    ->setPresentation($presentation)
    ->setInputFields($inputFields);

try {
    $createProfileResponse = $webProfile->create($paypal);
} catch (\PayPal\Exception\PayPalConnectionException $ex) {
    die($ex);
}

$profileId = $createProfileResponse->getId();

然后:

$payment = new Payment();
$payment->setIntent('sale')
    ->setPayer($payer)
    ->setRedirectUrls($redirectUrls)
    ->setTransactions([$transaction])
    ->setExperienceProfileId($profileId);

Logo 图像在生成的页面上显示正常,所以我知道 ID 是有效的。我也尝试按照我在网上找到的建议清除 cookie,但没有效果。在此先感谢您的任何建议。

最佳答案

在 PayPal 的新结帐样式中,如下所示,LandingPage 设置无法使用。这是 PayPal 方面的一个已知问题。很抱歉给您带来不便。但在旧样式中,LandingPage 可以工作。 enter image description here

关于php - Paypal REST API : Unable to set landing page to billing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32358852/

相关文章:

php - 为什么要在 forge laravel 中重新安装存储库并更改 env 中的数据?

java - jersey 如何在一个资源中创建静态成员

rest - Yammer REST API - 记录的参数不起作用

android - 如何在改造中将 JSON 数组传递到 body 中

php - 如何在 Laravel Horizo​​n 中使用标签

php - 不使用 3xx 重定向代码重定向到另一个页面

javascript - MySQL SELECT 没有以正确的方式返回值,谷歌线图没有以所需的方式显示

java - 使用相同 REST 调用的不同操作

ios - 如何在同一项目中使用 CardIO 和 Paypal-iOS-sdk(重复符号)

javascript - paypal dg flow 灯箱不再有效