Forum

Thread tagged as: Problem, PayPal

PayPal App problem

A client has just emailed to tell me their PayPal shop isn't working. It seems Perch isn't passing the values from the button through to PayPal or something. Here's what I'm getting from PayPal: https://www.dropbox.com/s/1w07e5lzdm0hvvs/Screen%20Shot%202016-12-05%20at%2010.48.20%20am.png?dl=0

And here's my diagnostic info:

SUMMARY INFORMATION

Perch: 2.8.32, PHP: 5.6.27, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_blog (5.0), perch_forms (1.8.3), perch_shop_paypal (1.2.3), perch_backup (1.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'perch_blog', 'perch_shop_paypal', ); ?>
PERCH_LOGINPATH: /cms
PERCH_PATH: /Users/TemperTemper/Sites/Muscle Sense/cms
PERCH_CORE: /Users/TemperTemper/Sites/Muscle Sense/cms/core
PERCH_RESFILEPATH: /Users/TemperTemper/Sites/Muscle Sense/cms/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: musclesense.local
DOCUMENT_ROOT: /Users/TemperTemper/Sites/Muscle Sense
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php

I haven't changed anything in the app since it last worked, and the form is populating ok from the CMS:

<form id="form1__xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
      <input name="business" value="malin@musclesense.co.uk" type="hidden">
      <input name="currency_code" value="GBP" type="hidden">
      <input name="cmd" value="_cart" type="hidden">
      <input name="add" value="1" type="hidden">
      <input name="item_name" value="60 minutes massage" type="hidden">
      <input name="item_number" value="msgv60" type="hidden">
      <input name="amount" value="55.00" type="hidden">
      <input name="return" value="https://musclesense.co.uk/vouchers/confirmation" type="hidden">
      <input name="add" value="Buy now with PayPal" type="submit">
    </form>

The PayPal app is still available in the Addons section of the site so I'm assuming it hasn't been deprecated just yet.

Thanks for taking a look :)

Martin.

Martin Underhill

Martin Underhill 5 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You'll see the note on that page about the app being replaced with Perch Shop.

If nothing's changed and the form is being populated as it should, I'm not sure what I can suggest.

Oh no… Looks like it could be migration time then if there's a critical error :(

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is there a critical error?

It's not returning any errors that I can find, just not sending anything to PayPal. It's a standard out of the box install so it should still work. I've been looking for an excuse to try out Shop in production anyway, but as ever these things always seem to happen at just the wrong moment… Post new baby, pre Christmas ;D

Is it worth us try to get to the bottom of it on here or should I just bite the bullet and write off the old app?

Drew McLellan

Drew McLellan 2638 points
Perch Support

If the code was working and now isn't, you'll need to look at what's changed. If the code hasn't changed then this probably isn't the place to look for the answer.

Ah, I think it's got something to do with a move to https – PayPal has been set up to expect the callback script to be at the non https location. Just waiting on the client sending me their new PayPal logins so I can amend this and hopefully get things working again :)

So it wasn't the https thing as I'd taken care of that with redirects anyway. I fixed it by changing this line <input name="cmd" value="_cart" type="hidden"> to <input name="cmd" value="_xclick" type="hidden">. Seems it used to be more forgiving if it couldn't find a cart, falling back to the normal button behaviour, but at some point it has changed.

I found the _xclick value on this page: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/formbasics/