Forum

Thread tagged as: Problem, Shop

Paypal Express Checkout

Hi,

I am trying to implement the Paypal Express checkout in Runway Shop, but am getting stuck. I have set up the Sandbox Merchant Account and entered the credentials in Test. My payment page (where users get sent after logging in) currently just looks like this:

<?php

if (perch_member_logged_in()) {

  // your 'success' return URL
  $return_url = 'https://mysite.com/payment';
  $cancel_url = 'https://mysite.com/';

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

Is this supposed to trigger a redirect to Paypal? As at the moment it just stays on payment. I am probably missing something fundamental!

Thanks

Mike

Mike Harrison

Mike Harrison 37 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that should send you to PayPal as long as you've not output any HTML to that point.

Hmm nope it is just sitting there - that code is my entire page so no HTML above it. Not a PHP error as the debug is visible, nothing in the error log. I am on MAMP, do I need to be on a non-local server?

Just run through the process again and got a 500 error on the payment page, so progress?!? Error log shows:

[10-May-2016 11:45:25 UTC] PHP Fatal error:  Uncaught exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 35: Unsupported SSL protocol version [url] https://api-3t.sandbox.paypal.com/nvp' in /Volumes/Data/g Websites/New Development/Newgate/CLOCKS FINAL 2/admin/addons/apps/perch_shop/lib/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php:359
Stack trace:
#0 /Volumes/Data/g Websites/New Development/Newgate/CLOCKS FINAL 2/admin/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 /Volumes/Data/g Websites/New Development/Newgate/CLOCKS FINAL 2/admin/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 /Volumes/Data/g Websites/New Development/Newgate/CLOCKS FINAL 2/admin/addons/apps/pe in /Volumes/Data/g Websites/New Development/Newgate/CLOCKS FINAL 2/admin/addons/apps/perch_shop/lib/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php on line 359
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can we see your diagnostic report? Looks like this is a server config issue.

Sure, extended report:

PERCH INFORMATION

Perch Runway: 2.8.29
Production mode: Development (10)
Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29), perch_forms (1.8.3), perch_mailchimp (2.0.1), perch_shop_orders (1.0), perch_shop_products (1.0), perch_shop (1.0.1), perch_members (1.5)
DB driver: PDO
DB tables: clocks_backup_plans (1), clocks_backup_resources (330), clocks_backup_runs (67), clocks_categories (7), clocks_category_counts (0), clocks_category_sets (2), clocks_collection_index (0), clocks_collection_items (0), clocks_collection_revisions (0), clocks_collections (0), clocks_content_index (5078), clocks_content_items (163), clocks_content_regions (30), clocks_forms (1), clocks_forms_responses (105), clocks_mailchimp_campaigns (0), clocks_mailchimp_history (97), clocks_mailchimp_log (0), clocks_mailchimp_stats (1), clocks_mailchimp_subscribers (491), clocks_members (980), clocks_members_forms (4), clocks_members_member_tags (98), clocks_members_sessions (9), clocks_members_tags (2), clocks_navigation (0), clocks_navigation_pages (0), clocks_page_routes (4), clocks_page_templates (64), clocks_pages (62), clocks_resource_log (2279), clocks_resource_tags (0), clocks_resources (3750), clocks_resources_to_tags (0), clocks_scheduled_tasks (66), clocks_settings (41), clocks_shop_addresses (1818), clocks_shop_admin_index (116), clocks_shop_brands (1), clocks_shop_cart (413985), clocks_shop_cart_data (3638), clocks_shop_cart_items (3063), clocks_shop_countries (248), clocks_shop_currencies (152), clocks_shop_customers (838), clocks_shop_emails (2), clocks_shop_index (20394), clocks_shop_option_values (0), clocks_shop_options (0), clocks_shop_order_items (1652), clocks_shop_order_promotions (0), clocks_shop_order_statuses (10), clocks_shop_orders (773), clocks_shop_orders_meta (1), clocks_shop_product_files (0), clocks_shop_product_option_values (0), clocks_shop_product_options (0), clocks_shop_product_tags (0), clocks_shop_products (295), clocks_shop_promotions (2), clocks_shop_search (328), clocks_shop_shipping_zone_countries (12), clocks_shop_shipping_zones (2), clocks_shop_shippings (4), clocks_shop_tax_exhibits (2617), clocks_shop_tax_group_rates (2), clocks_shop_tax_groups (1), clocks_shop_tax_locations (2), clocks_shop_tax_rates (2), clocks_shop_variants (0), clocks_user_passwords (3), clocks_user_privileges (35), clocks_user_role_privileges (12), clocks_user_roles (1), clocks_users (10)
Users: 10
App runtimes:
<?php
    $apps_list = array(
        'content',
        'categories',
        'perch_forms',
        'perch_members',
        'perch_shop',
        'perch_mailchimp'
    );
Scheduled tasks for perch_mailchimp: update_list_stats (60 mins)
Scheduled tasks for Backup: plan_1 (10 mins)
Editor plug-ins: markitup
H1: 9263d2af5773c215c4144ed3b3d2729b
L1: 8db4d3366081207744442721cf335c1b
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #000000
content_singlePageEdit: 1
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.19: done
headerScheme: dark
update_runway_2.8.19: done
latest_version: 2.8.15
on_sale_version: 2.8.29
hide_pwd_reset: 1
dashboard: 0
content_hideNonEditableRegions: 1
content_frontend_edit: 0
perch_shop_price_tax_mode: inc
perch_shop_site_url: https://www.newgateclocks.com
perch_shop_default_currency: 47
perch_members_login_page: /trade?r={returnURL}
perch_shop_update: g33
perch_members_update: 1.4
perch_mailchimp_secret: 991187f885f3d4b6d06dbf642b1ada73
perch_mailchimp_update: 2.0
perch_mailchimp_api_key: 96f550754104cd3a3041562bf6adf0e4-us12
perch_mailchimp_list_id: d7d3a95a63
perch_mailchimp_campaign_url: /mailchimp/campaign.php?s={campaignSlug}
siteURL: https://newgateclocks.com
update_runway_2.8.21: done
logoPath: /admin/resources/1452605170_newgate-header-logo copy.png
update_runway_2.8.23: done
update_runway_2.8.24: done
update_runway_2.8.25: done
perch_shop_trade_price_tax_mode: exc
perch_shop_product_url: /shop/products/{slug}
update_runway_2.8.26: done
helpURL:
perch_shop_reporting_currency: 47
perch_shop_invoice_number_format: #%d
update_runway_2.8.28: done
update_runway_2.8.29: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_SITEPATH: /home/newgateclocks/public_html
PERCH_SCHEDULE_SECRET: bpfqEnYJVBFT6qGS
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: newgate
PERCH_DB_PREFIX: clocks_
PERCH_EMAIL_FROM: admin@newgateclocks.com
PERCH_EMAIL_FROM_NAME: Newgate Clocks
PERCH_LOGINPATH: /admin
PERCH_PATH: /Volumes/Data/g Websites/New Development/Newgate/CLOCKS FINAL 2/admin
PERCH_CORE: /Volumes/Data/g Websites/New Development/Newgate/CLOCKS FINAL 2/admin/core
PERCH_RESFILEPATH: /Volumes/Data/g Websites/New Development/Newgate/CLOCKS FINAL 2/admin/resources
PERCH_RESPATH: /admin/resources
PERCH_HTML5: 1
PERCH_TZ: UTC
PERCH_SSL: 1
PERCH_DEBUG: 1
PERCH_PRODUCTION_MODE: 10
PERCH_EMAIL_METHOD: smtp
PERCH_EMAIL_HOST: mailtrap.io
PERCH_EMAIL_SECURE: tls
PERCH_EMAIL_AUTH: 1
PERCH_EMAIL_PORT: 2525
PERCH_EMAIL_USERNAME: 42004aa368a4f9d32
PERCH_RUNWAY: 1
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Volumes/Data/g Websites/New Development/Newgate/CLOCKS FINAL 2/admin/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS

PHP: 5.6.10
Zend: 2.6.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $
MySQL server: 5.5.42
Free disk space: 563.43 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, mysqli, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysql, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, gettext, mcrypt, yaz, pgsql, pdo_pgsql
GD: Yes
ImageMagick: No
PHP max upload size: 128M
PHP max form post size: 128M
PHP memory limit: 512M
Total max uploadable file size: 128M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
proto: https
HTTPS: on
SSL_TLS_SNI: newgateclocks.dev
SSL_SERVER_S_DN_C: GB
SSL_SERVER_S_DN_ST: Shropshire
SSL_SERVER_S_DN_L: Oswestry
SSL_SERVER_S_DN_O: Newgate Clocks Ltd
SSL_SERVER_S_DN_CN: newgateclocks.dev
SSL_SERVER_S_DN_Email: mike.harrison@newgateclocks.com
SSL_SERVER_I_DN_C: GB
SSL_SERVER_I_DN_ST: Shropshire
SSL_SERVER_I_DN_L: Oswestry
SSL_SERVER_I_DN_O: Newgate Clocks Ltd
SSL_SERVER_I_DN_CN: newgateclocks.dev
SSL_SERVER_I_DN_Email: mike.harrison@newgateclocks.com
SSL_VERSION_INTERFACE: mod_ssl/2.2.29
SSL_VERSION_LIBRARY: OpenSSL/0.9.8zh
SSL_PROTOCOL: TLSv1
SSL_SECURE_RENEG: true
SSL_COMPRESS_METHOD: NULL
SSL_CIPHER: AES256-SHA
SSL_CIPHER_EXPORT: false
SSL_CIPHER_USEKEYSIZE: 256
SSL_CIPHER_ALGKEYSIZE: 256
SSL_CLIENT_VERIFY: NONE
SSL_SERVER_M_VERSION: 1
SSL_SERVER_M_SERIAL: 91B08CE1A5404B38
SSL_SERVER_V_START: Jan 26 11:15:28 2016 GMT
SSL_SERVER_V_END: Jan 23 11:15:28 2026 GMT
SSL_SERVER_S_DN: /C=GB/ST=Shropshire/L=Oswestry/O=Newgate Clocks Ltd/CN=newgateclocks.dev/emailAddress=mike.harrison@newgateclocks.com
SSL_SERVER_I_DN: /C=GB/ST=Shropshire/L=Oswestry/O=Newgate Clocks Ltd/CN=newgateclocks.dev/emailAddress=mike.harrison@newgateclocks.com
SSL_SERVER_A_KEY: rsaEncryption
SSL_SERVER_A_SIG: sha1WithRSAEncryption
SSL_SESSION_ID: C7969724BEF45031D80C8A3485464F2DF7EC6B51CBC9C54449AA07FD7D3432E7
HTTP_HOST: newgateclocks.dev
HTTP_CONNECTION: keep-alive
HTTP_PRAGMA: no-cache
HTTP_CACHE_CONTROL: no-cache
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36
HTTP_REFERER: https://newgateclocks.dev/admin/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,fr;q=0.6,it;q=0.4
HTTP_COOKIE: _ga=GA1.2.730195557.1453807009; cmsa=1; p_m=; __utma=216502153.730195557.1453807009.1462868400.1462888803.86; __utmb=216502153.45.10.1462888803; __utmc=216502153; __utmz=216502153.1459935749.70.2.utmcsr=newgatewatches.dev|utmccn=(referral)|utmcmd=referral|utmcct=/checkout; PHPSESSID=5b564cf384b01bb8079721e28eca431c
PATH: /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE: Apache
SERVER_NAME: newgateclocks.dev
SERVER_ADDR: ::1
SERVER_PORT: 443
REMOTE_ADDR: ::1
DOCUMENT_ROOT: /Volumes/Data/g Websites/New Development/Newgate/CLOCKS FINAL 2
SERVER_ADMIN: you@example.com
SCRIPT_FILENAME: /Volumes/Data/g Websites/New Development/Newgate/CLOCKS FINAL 2/admin/core/settings/diagnostics/index.php
REMOTE_PORT: 51028
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /admin/core/settings/diagnostics/?extended
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
PHP_SELF: /admin/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1462892194.92
REQUEST_TIME: 1462892194
argc: 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you create a blank PHP file on your server containing just the following, then view it in a browser and let me know what it outputs?

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://tlstest.paypal.com/"); 
var_dump(curl_exec($ch));

It says

bool(false)
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, that explains the problem. I'll see if I can figure out a solution.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Did you ever figure out what was causing this?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Gareth - if you are having an issue yourself raise your own thread including details plus your template and Diagnostics Report.

Thanks!

Hi Drew,

Just wondered if was there any progress with this? And is there anything I can do?

Cheers

Mike

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you asked your host about their TLS support? That PayPal document I posted should be useful.

I'm not convinced there's anything effective I can do that wouldn't just result in everything breaking for you in 2017 when PayPal roll this change to their live servers.

Ok thanks I will check with them and see what they say

Sorry for reviving an old thread, however I just followed these steps in order to upgrade the cURL library on MAMP and this has fixed the error using Paypal Express, at least for me. May be helpful to others: https://github.com/lunr/mamp-curl-tls