我正在使用带有 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,但没有效果。在此先感谢您的任何建议。
最佳答案
关于php - Paypal REST API : Unable to set landing page to billing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32358852/