PayPal访客结账已停止在移动设备上工作

How and where can I start debugging Guest Checkout with PayPal?

I had the site running fine for over a year and now suddenly the Guest Checkout on the mobile website stopped working. I'm using PayPal PHP SDK and nothing have been changed in the code. The guest checkout it's just not showing on mobile devices but works fine on desktop.

I have searched the documentation and the forum I saw couple of similar questions but no answer to them.

Things mentioned:

  • Clear browser cache, not the case random users complaining, but have tried it myself and still no joy.
  • Your business needs to be set up to accept credit/debit cards, it is as said it worked smoothly over a year, now all of the sudden it doesn't work.
  • Checked logs on server but there is no error log at all.
  • I tried to see developers support on PayPal but more or less it only points to "Ask the community" and no real way of contacting technical support.

Update relevant part of code used:

    use PayPal\Api\Amount;
    use PayPal\Api\Details;
    use PayPal\Api\Item;
    use PayPal\Api\ItemList;
    use PayPal\Api\Payer;
    use PayPal\Api\Payment;
    use PayPal\Api\RedirectUrls;
    use PayPal\Api\Transaction;
    use PayPal\Api\ShippingAddress;

    $apiContext = new \PayPal\Rest\ApiContext(
    new \PayPal\Auth\OAuthTokenCredential(
    'XXX',     // ClientID
    'YYY'      // ClientSecret
    )
    );

    $payer = new Payer();
    $payer->setPaymentMethod("paypal");

    // ### Itemized information
    // (Optional) Lets you specify item wise
    // information
    $item1 = new Item();
    $item1->setName($name)
        ->setCurrency($currency)
        ->setQuantity($quantity)
        ->setPrice($price)
        ->setDescription($description)
        ->setSku($productid);
    $myitem=array($item1);

    $itemList->setItems($myitem);
    $details = new Details();
    $details->setShipping($shipping)
        ->setTax($tax)
        ->setSubtotal($subtotal);

    $amount = new Amount();
    $amount->setCurrency($currency)
        ->setTotal($totalprice)
        ->setDetails($details);

    $transaction = new Transaction();
    $transaction->setAmount($amount)
        ->setItemList($itemList)
        ->setDescription($description);

    $baseUrl = "https://........";
    $redirectUrls = new RedirectUrls();
    $redirectUrls->setReturnUrl("$baseUrl/execute.php")
        ->setCancelUrl("$baseUrl/cancel_execute.php?id=$productid");

    $payment = new Payment();
    $payment->setIntent("sale")
        ->setPayer($payer)
        ->setRedirectUrls($redirectUrls)
        ->setTransactions(array($transaction));

    try {
        $payment->create($apiContext);
    } catch (PayPal\Exception\PPConnectionException $ex) {
        echo "Exception: " . $ex->getMessage() . PHP_EOL;
        //echo "<pre>";
        //var_dump($ex->getData()); 
        exit(1);
    }


    foreach($payment->getLinks() as $link) {
        if($link->getRel() == 'approval_url') {
            $redirectUrl = $link->getHref();
            break;
        }
    }

    $payment_id = $payment->getId();

Ok so here is the update, after 2 days of hell and countless backward and forward with PayPal, I spoke with different persons on different channels and I got the following answers:

1) This never worked on mobile because it is insecure, it does work on iPad. - What a joke, it worked for over a year and actually it doesn't work on iPad at the moment.

2) Your account is not set up to accept Credit Card payment. - GGGRRRRR I know it isn't I was doing PayPal type sale, which should allow a guest checkout!

3) This is from their ticketing system (Sorry what in English please??? )

I have enabled this option for you. Please note that direct payments by credit card will not work 100% of the cases, and if you do some tests maybe does not work.

The process that allows or not to pay as a guest is a process is beyond our control, we can only Maximize the allowance.

4) If a customer tried to use the card to many times it won't allow it to use it. - But they had NO CHANCE of even trying to use it because they are only presented with a sign up page

5) There is no guest option - LOL!!!!!!!!!

6) Try clearing the cache - LOL!!!!!!!

Solution? I ended up paying for "PayPal Pro" rewriting my checkout process and now I'm processing Credit Cards directly, currently in Sandbox and waiting for PayPal to vet my webpage that it does satisfy their needs and give me the green light for the pro account (which should be no later than Monday).

Did the problem actually got sorted? - NO

If anybody stumbles across this post and know a way on how to get Guest checkout to work, please do not hesitate to share, other than that my personal conclusion is that after this weekend I will seek to use another (possibly cheaper) payment processing gateway and only keep PayPal as a secondary option is somebody wants to sign out using PayPal Express.