[英]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,但这没有效果。 提前感谢任何建议。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.