繁体   English   中英

Paypal REST API:无法将目标网页设置为结算

[英]Paypal REST API: Unable to set landing page to billing

我正在使用Paypal REST API和PHP SDK为慈善机构建立一个捐赠功能。 我一直在尝试将着陆页类型设置为“结算”,但似乎没有任何改变。 这是我用于定义Web体验配置文件的代码(根据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);

徽标图像在结果页面上显示正常,因此我知道ID有效。 我也尝试按照我在网上找到的建议清除cookie,但这没有效果。 提前感谢任何建议。

在PayPal的新结帐方式中,如下所示,LandingPage设置无法使用。 这是PayPal方面的一个已知问题。 很抱歉给您带来不便。 但在旧式,LandingPage可以工作。 在此输入图像描述

暂无
暂无

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

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