PayPal REST API: Cannot configure landing page for billing

I am creating a donation function for charity using the Paypal REST API with the PHP SDK. I am trying to set the landing page type to Billing, but nothing changes. This is my code for defining a web experience profile (according to http://paypal.imtqy.com/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();

Then later:

$payment = new Payment();
$payment->setIntent('sale')
    ->setPayer($payer)
    ->setRedirectUrls($redirectUrls)
    ->setTransactions([$transaction])
    ->setExperienceProfileId($profileId);

The logo image appears on the final page, so I know that the identifier is valid. I also tried clearing the cookies according to the suggestion I found on the Internet, but that did not affect. Thanks in advance for any advice.

+4
1

PayPal, , LandingPage . PayPal. . LandingPage . enter image description here

+1

Source: https://habr.com/ru/post/1605597/


All Articles