Paypal REST API:无法将着陆页设置为结算 [英] Paypal REST API: Unable to set landing page to billing

查看:94
本文介绍了Paypal REST API:无法将着陆页设置为结算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Paypal REST API和PHP SDK为慈善机构建立捐赠功能.我一直在尝试将着陆页类型设置为结算",但似乎没有任何变化.这是我用于定义Web体验配置文件的代码(按照

I'm building a donate function for a charity using the Paypal REST API with the PHP SDK. I've been attempting to set the landing page type to 'Billing' but nothing seems to change. This is my code for defining the web experience profile (as per 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,但这没有任何效果.预先感谢您的任何建议.

The logo image comes up fine on the resulting page, so I know the ID is valid. I've also tried clearing cookies as per a suggestion I found online, but that had no effect. Thanks in advance for any advice.

推荐答案

在贝宝(PayPal)的新签出样式中,如下所示,LandingPage设置无法使用.这是PayPal方面的已知问题.不便之处,敬请原谅.但是以旧样式,LandingPage可以使用.

In PayPal's new checkout style, as below, LandingPage setting can't work. It's a known issue in PayPal's side. Sorry about the inconvenience. But in old style, LandingPage can work.

这篇关于Paypal REST API:无法将着陆页设置为结算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆