Checkout issue
I'm struggling with getting PayPal to checkout. On my local server, I'm seeing a Fatal error:
Fatal error: Uncaught exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 35: Unsupported SSL protocol version [url] https://api-3t.paypal.com/nvp' in /PATH_TO/local/perch/addons/apps/perch_shop/lib/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php:359 Stack trace: #0 /PATH_TO/local/perch/addons/apps/perch_shop/lib/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(292): Guzzle\Http\Curl\CurlMulti->isCurlException(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Curl\CurlHandle), Array) #1 /PATH_TO/local/perch/addons/apps/perch_shop/lib/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(257): Guzzle\Http\Curl\CurlMulti->processResponse(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Curl\CurlHandle), Array) #2 /PATH_TO/local/perch/addons/apps/perch_shop/lib/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(240 in /PATH_TO/local/perch/addons/apps/perch_shop/lib/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php on line 359
I'm guessing there's something about the local setup that means this won't work.
When I try to checkout on the dev server, I'm redirected to the cancellation URL each time. I've tried with two different sets of test API credentials, as well as some live credentials (changing test_mode to false), and each time I'm redirected back to my cancellation URL. Manual checkout seems to direct me to my success URL at least.
Here's my diagnostic:
Perch: 2.8.29, PHP: 5.6.17-0+deb8u1, MySQL: 5.5.46, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29), perch_blog (5.0), perch_events (1.9.2), perch_forms (1.8.3), perch_shop_orders (1.0), perch_shop_products (1.0), perch_shop (1.0.1), perch_members (1.5), perch_twitter (3.5.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', 'perch_members', 'perch_shop', 'perch_events', 'perch_twitter', );
PERCH_LOGINPATH: /perch
PERCH_PATH: PATH_TO/web/content/perch
PERCH_CORE: PATH_TO/web/content/perch/core
PERCH_RESFILEPATH: PATH_TO/web/content/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 8M, Max POST 8M, Memory: 128M, Total max file upload: 8M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: dev.DOMAIN.org.uk
DOCUMENT_ROOT: PATH_TO/web/content
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Can you show us your checkout code and the debug from the checkout page?
Sure thing.
Here's the checkout page:
I only want to do a checkout if there's a value in the $_POST array (to avoid multiple checkouts on a page refresh), otherwise I'm redirecting to the checkout page.
I don't know how I can show you DEBUG info from the checkout page - it either throws a fatal error on my local setup, or redirects straight on to the cancellation page on my dev server.
Here's my shop.php config file (minus the credentials). Anything awry here?
Before you call
perch_shop_checkout()
, add this:That will stop the redirect occurring and should enable you to see the debug.
Thanks, Drew - yes, that's worked. Here's the debug:
Looks like possible curl issues on your server. Which version are you running? Are your root certificates up to date?
It is managed hosting with Rackspace Cloud. I am told that curl version is 7.38.0 and re the root certificates "we follow the debian repository for valid certificates" so they say they're up to date.
Ok. This isn't an issue I've seen before, and it looks to be environment related. I don't have a solution to suggest for you at the moment.
OK. Should it work on my MAMP Pro setup which also shows an error despite being a different environment?
As a further thought, I have another site on the same hosting (Rackspace Cloud Sites) which is running Expression Engine/Cartthrob - this is able to connect to PayPal without a problem. Having chatted to Rackspace Support they say that it's trying to do the curl but being denied permission. I can send you FTPs to my dev server if it helps.
If it can't be resolved, do you have a suggested course of action? Different hosting? Different Payment Gateway?
Thanks so much for your help.
Which version of the PayPal API is it using? We're using the newest version, which has more modern SSL requirements.
I think version 65.1 - that's the version indicated in the PayPal Express code.
Ok, that's not something I recognise - I'll have to do some research.
I may be wrong about that Cartthrob version number. I have tried a number of different API credentials, including those that work on the other site, and still hitting up against the same issue. Thanks, Drew.
Sorry to chase - I just want to be clear on the situation. I have a site that is not far off ready to launch apart from a non-functioning checkout. The client really wants to use PayPal, and my Rackspace Cloud Sites Hosting works well for all my other sites and is something I'm already paying for. Just would be helpful to know what you suggest.
Appreciate you are busy, but I'm kind of stuck. Happy for you to have FTP access or provide anything else I can to help you resolve.
You're basically asking me why your hosting can't talk to the PayPal API. Obviously I'll try to help but being in control of neither your hosting nor the PayPal API I might not be the best placed person to investigate it.
Presumably you're not on
dev.DOMAIN.org.uk
and you've edited the output. Is there anything else you've edited?Yes, I edited that and also replaced part of the full server path with PATH_TO, really just for privacy.
I can appreciate you've no control over my hosting or PayPal API. I don't think it's something I have the PHP chops to fix, and I don't think I'll get help from Rackspace (who'll say it's beyond the scope of what they can support) or PayPal. So I guess I was hoping you could point me in the right direction.
I've googled the error and found this page below. Does it apply to your circumstance too?
https://help.tictail.com/hc/en-us/articles/205660201-Paypal-error-You-do-not-have-permissions-to-make-this-API-call-
I saw that - fairly sure it doesn't apply in this instance. I've tried it with a PayPal account that is able to take payments from the Expression Engine site I mentioned..
Do you find that Perch Shop can check out from a local server or does it need to be web accessible? I would think it would still redirect to PayPal successfully? (The fact that my local server also throws the error makes me think it may not be hosting related, but I've configured something incorrectly.).
It should (and does) work fine locally - you don't need to be on a live server or set up a tunnel to get any callbacks.
Is the error the same locally?
I just got a "fatal error" on my local server. I don't think I tried it with halting redirects, so can do that tomorrow. My local server is just a standard MAMP Pro.