4

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();

Then later on:

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

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.

1 Answer 1

1

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.enter image description here

1
  • 2
    Unbelievable. How can PayPal suggest using Rest APIs if there are still known issues like this!?
    – Fuvizzo
    Nov 14, 2015 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.