Forum

Thread tagged as: Question, Problem, Shop

Blank Checkout with Paypal Gateway integration

I get a blank page at my checkout url

I'm following this guide

https://docs.grabaperch.com/addons/shop/gateways/paypal-express/

I've set up a paypal sandbox account and entered the credentials into config > shop.php ..


<?php return [ 'gateways' => [ 'paypal-express' => [ 'enabled' => true, 'test_mode' => true, 'live' => [ 'username' => 'paypal_api_username', 'password' => 'paypal_api_password', 'signature' => 'paypal_api_signature', ], 'test' => [ 'username' => 'paul_api1.thedesignbank.co.uk', 'password' => 'BLAHBLAH8QTMHN48', 'signature' => 'BLAHBLAH1C7fd0v3bYYYRCpSSRl31APdVVoAUZxn3DaMAZUlPRNzsaOZ5', ], ], ], ]; ?>

On the checkout page nothing seems to show. I try..

 <?php perch_shop_checkout() ?>

or

 <?php perch_shop_checkout([
      'return_url' => 'https://www.mysite.co.uk/payment.php',
      'cancel_url' => 'https://www.mysite.co.uk/cancel.php'
  ]);?>

neither show anything. I can show other perch content on this page so don't think there is an obvious problem with the page.

John Robinson

John Robinson 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

If you are getting a "blank page" then you have a server error. We include a link to this support document when you create a thread as if you have a server error we need to know what it is to help:

https://solutions.grabaperch.com/development/why-am-i-getting-a-blank-page

We also need your Diagnostics Report.

Sorry I said blank page, i'm talking absolute rubbish. I should have said it reaches the

<?php perch_shop_checkout() ?>

and stops rendering the rest of the page beyond this.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is there anything logged though?

My suspicion is that it's because you're passing the options array but not the name of the gateway you're using. If you look at the example on the page you're following, it has paypal-express as the first argument:

perch_shop_checkout('paypal-express', [
    'return_url' => $return_url,
    'cancel_url' => $cancel_url,
  ]);

Hi, I have had the same issue, I got past that but then still the paypal-express config doesn't seem to trigger anything.

Firstly, the default shop.php config file has a missing "?>" to close off the php tag. Drew, you may wish to check the code that we download for that one.

I fixed this in my copy and then the page continued to render the content underneath (the footer in our case).

With this part in however there was still nothing coming through between header and footer triggered by the paypal gateway option.

Hope this makes sense?

I too would appreciate some advice here.

Happy to create a separate thread, but thought it best sits here with John's issue.

Hi, Worked out why I was getting the blank page here, I didn't have some of the delivery charges set up. Turned on debug and saw that was where the script was stopping.

John maybe you have data issue also?