php – Paypal REST API:无法将登录页面设置为开票

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – Paypal REST API:无法将登录页面设置为开票脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用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可以工作

脚本宝典总结

以上是脚本宝典为你收集整理的php – Paypal REST API:无法将登录页面设置为开票全部内容,希望文章能够帮你解决php – Paypal REST API:无法将登录页面设置为开票所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。