Forum

Thread tagged as: Question, Problem, Shop

So Lost on Shop App ...

So, I'm drawing a complete blank on what to do next. I've scoured the docs and google and the information (to my n00bie eyes at least) seem vague.

Here's the issue:

1) Products and all options are in the system 2) I can add products to the cart 3) I can view the cart and proceed to start the checkout process, next 4) I can choose to log in as a returning customer or continue as guest, next 5) I can input and save all the addresses and view them all ... and then kaput ... I'm stuck

I see all my addresses listed, that's great, but what next? How do I move on to ask for a shipping provider? and then move from there to the payment gateway?

I have shipping entered into the system and I plan to use PayPal Express (already got my testing keys and what not from Sandbox)

I know the answer is probably gonna be simple, but I'm totally missing it.

Blake Myers

Blake Myers 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can display the shipping method form with perch_shop_shipping_method_form(). Does that help?

yes ... that does ... so, now I have products in the cart, customer logged in, addresses set, and shipping selected ...

my next thought was then to send the customer to a page where I call the payment gateway for pay-pal

  $return_url = 'https://'.DOMAIN.'/payment';
  $cancel_url = 'https://'.DOMAIN.'/';

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

DOMAIN is defined in a functions.php and the PayPal stuff is defined in the perch/config/shop.php per the docs.

but nothing shows after I call perch_shop_checkout() from above. All other php scripts after it fail like an exit() was called or something.

debug says nothing ...

Drew McLellan

Drew McLellan 2638 points
Perch Support

You need to follow the "Payment flow" section here: https://docs.grabaperch.com/addons/shop/gateways/paypal-express/

right ... that was a page I was referencing ...

I have the settings completed (except the live credentials)

    return [
        'gateways' => [
            'paypal-express' => [
                'enabled'   => true,
                'test_mode' => true,
                'live' => [
                    'username'  => 'paypal_api_username',
                    'password'  => 'paypal_api_password',
                    'signature' => 'paypal_api_signature',
                ],
                'test' => [
                    'username'  => 'sales.xenoplexus.com',
                    'password'  => 'QT4LCJHXH57E',
                    'signature' => 'AFcWxV21C7fd0v3bYYYRCpSSRl31AGyAlY3q6dLxkwa',
                ],
            ],
        ],
    ];

I've changed the credentials, but I have the correct ones in the system

Obviously, I've completed all the PayPal steps to receive said credentials

And when I call:

if (perch_member_logged_in()) {
  // your 'success' return URL
  $return_url = 'https://becalistyle.local/payment';
  $cancel_url = 'https://becalistyle.local/';

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

nothing appears and as I mentioned above, all php scripts after it seem to exit();

Perch: 3.0.9
Production mode: Production (100)
Installed apps: content (3.0.9), assets (3.0.9), categories (3.0.9), perch_shop_orders (1.2.4), perch_shop_products (1.2.4), perch_shop (1.2.4), perch_members (1.6.2)
DB driver: PDO
DB tables: perch3_categories (10), perch3_category_counts (0), perch3_category_sets (1), perch3_content_index (0), perch3_content_items (0), perch3_content_regions (0), perch3_members (1), perch3_members_forms (1), perch3_members_member_tags (0), perch3_members_sessions (1), perch3_members_tags (0), perch3_menu_items (12), perch3_navigation (0), perch3_navigation_pages (0), perch3_page_templates (1), perch3_pages (0), perch3_resource_log (968), perch3_resource_tags (0), perch3_resources (1059), perch3_resources_to_tags (0), perch3_settings (30), perch3_shop_addresses (32), perch3_shop_admin_index (32), perch3_shop_brands (1), perch3_shop_cart (14), perch3_shop_cart_data (0), perch3_shop_cart_items (1), perch3_shop_countries (46), perch3_shop_currencies (152), perch3_shop_customers (3), perch3_shop_emails (1), perch3_shop_index (7167), perch3_shop_option_values (29), perch3_shop_options (1), perch3_shop_order_items (28), perch3_shop_order_promotions (0), perch3_shop_order_statuses (9), perch3_shop_orders (14), perch3_shop_orders_meta (1), perch3_shop_product_files (0), perch3_shop_product_option_values (65), perch3_shop_product_options (53), perch3_shop_product_tags (0), perch3_shop_products (125), perch3_shop_promotions (0), perch3_shop_sales (0), perch3_shop_search (108), perch3_shop_shipping_zone_countries (29), perch3_shop_shipping_zones (1), perch3_shop_shippings (1), perch3_shop_tax_exhibits (14), perch3_shop_tax_group_rates (28), perch3_shop_tax_groups (1), perch3_shop_tax_locations (28), perch3_shop_tax_rates (38), perch3_shop_variants (69), perch3_user_passwords (0), perch3_user_privileges (68), perch3_user_role_privileges (2), perch3_user_roles (2), perch3_users (1)
Users: 1
App runtimes:
<?php
    $apps_list = [
        'content',
        'categories',
        'perch_members',
        'perch_shop',
    ];
Editor plug-ins:
H1: 8f4d668e1c91ebaf59bc1287cd7dc318
L1: 97d1f766ac7b08a09f98dff79590a26b
F1: 3b606135b33e6a102526838f4152a807
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
installedAt: 3.0.8
update_3.0.8: done
latest_version:
on_sale_version: 3.0.9
perch_shop_update: 1.2.3
headerScheme: light
perch_members_login_page: /members/login.php?r={returnURL}
perch_shop_price_tax_mode: exc
perch_shop_site_url: https://www.becalistyle.com
perch_shop_product_url: /product/{slug}
perch_shop_default_currency: 59
perch_shop_reporting_currency: 59
perch_shop_invoice_number_format: Invoice%d
dashboard: 1
hide_pwd_reset: 0
keyboardShortcuts: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
content_skip_region_list: 1
logoPath: /perch/resources/becali.png
perch_members_update: 1.4
update_3.0.9: done
assets_restrict_buckets: 0
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_SERVER: localhost
PERCH_DB_USERNAME: stuntdawg
PERCH_DB_DATABASE: becalistyle
PERCH_DB_PREFIX: perch3_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: blake.myers@xenoplexus.com
PERCH_EMAIL_FROM_NAME: Blake Myers
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/bmyers/Sites/becalistyle/perch
PERCH_CORE: /Users/bmyers/Sites/becalistyle/perch/core
PERCH_RESFILEPATH: /Users/bmyers/Sites/becalistyle/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_DEBUG: 1
PERCH_RUNWAY:
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_ASSET_VERSION: ab805d13c20751d6975a
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/bmyers/Sites/becalistyle/perch/templates
PERCH_TEMPLATE_FILTERS:
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_XHTML_MARKUP:
PERCH_RWD: 1
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_DEFAULT_BUCKET: default
PERCH_TRANSLATION_ASSIST:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_PRIV_ASSIST:
PERCH_CUSTOM_EDITOR_CONFIGS:
PERCH_ENABLE_EXIF: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SHOP_VERSION: 1.2.4
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: markdown

and nothing seems wrong in the debug area ... I don't know what I'm missing.

Debug Message - Perch 3.0.9
[1] SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='beae10f50ad7359c1380fccd52f5909b' LIMIT 1
UPDATE perch3_users SET userHash='1a05bd717c71b536409f8ab916da3756' WHERE userID='1'
[30] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
[10] SELECT itemValue FROM perch3_menu_items WHERE itemType='app'
[1] SELECT * FROM perch3_menu_items WHERE itemActive=1 AND itemType='menu' AND parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[5] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='settings' LIMIT 1
[1] SELECT * FROM perch3_menu_items WHERE itemActive=1 AND itemType='menu' AND parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
File: /core/settings/modes/diagnostics.extended.post.php
[61] SHOW TABLES
[10] SELECT COUNT(*) FROM perch3_categories
[0] SELECT COUNT(*) FROM perch3_category_counts
[1] SELECT COUNT(*) FROM perch3_category_sets
[0] SELECT COUNT(*) FROM perch3_content_index
[0] SELECT COUNT(*) FROM perch3_content_items
[0] SELECT COUNT(*) FROM perch3_content_regions
[1] SELECT COUNT(*) FROM perch3_members
[1] SELECT COUNT(*) FROM perch3_members_forms
[0] SELECT COUNT(*) FROM perch3_members_member_tags
[1] SELECT COUNT(*) FROM perch3_members_sessions
[0] SELECT COUNT(*) FROM perch3_members_tags
[12] SELECT COUNT(*) FROM perch3_menu_items
[0] SELECT COUNT(*) FROM perch3_navigation
[0] SELECT COUNT(*) FROM perch3_navigation_pages
[1] SELECT COUNT(*) FROM perch3_page_templates
[0] SELECT COUNT(*) FROM perch3_pages
[968] SELECT COUNT(*) FROM perch3_resource_log
[0] SELECT COUNT(*) FROM perch3_resource_tags
[1059] SELECT COUNT(*) FROM perch3_resources
[0] SELECT COUNT(*) FROM perch3_resources_to_tags
[30] SELECT COUNT(*) FROM perch3_settings
[32] SELECT COUNT(*) FROM perch3_shop_addresses
[32] SELECT COUNT(*) FROM perch3_shop_admin_index
[1] SELECT COUNT(*) FROM perch3_shop_brands
[14] SELECT COUNT(*) FROM perch3_shop_cart
[0] SELECT COUNT(*) FROM perch3_shop_cart_data
[1] SELECT COUNT(*) FROM perch3_shop_cart_items
[46] SELECT COUNT(*) FROM perch3_shop_countries
[152] SELECT COUNT(*) FROM perch3_shop_currencies
[3] SELECT COUNT(*) FROM perch3_shop_customers
[1] SELECT COUNT(*) FROM perch3_shop_emails
[7167] SELECT COUNT(*) FROM perch3_shop_index
[29] SELECT COUNT(*) FROM perch3_shop_option_values
[1] SELECT COUNT(*) FROM perch3_shop_options
[28] SELECT COUNT(*) FROM perch3_shop_order_items
[0] SELECT COUNT(*) FROM perch3_shop_order_promotions
[9] SELECT COUNT(*) FROM perch3_shop_order_statuses
[14] SELECT COUNT(*) FROM perch3_shop_orders
[1] SELECT COUNT(*) FROM perch3_shop_orders_meta
[0] SELECT COUNT(*) FROM perch3_shop_product_files
[65] SELECT COUNT(*) FROM perch3_shop_product_option_values
[53] SELECT COUNT(*) FROM perch3_shop_product_options
[0] SELECT COUNT(*) FROM perch3_shop_product_tags
[125] SELECT COUNT(*) FROM perch3_shop_products
[0] SELECT COUNT(*) FROM perch3_shop_promotions
[0] SELECT COUNT(*) FROM perch3_shop_sales
[108] SELECT COUNT(*) FROM perch3_shop_search
[29] SELECT COUNT(*) FROM perch3_shop_shipping_zone_countries
[1] SELECT COUNT(*) FROM perch3_shop_shipping_zones
[1] SELECT COUNT(*) FROM perch3_shop_shippings
[14] SELECT COUNT(*) FROM perch3_shop_tax_exhibits
[28] SELECT COUNT(*) FROM perch3_shop_tax_group_rates
[1] SELECT COUNT(*) FROM perch3_shop_tax_groups
[28] SELECT COUNT(*) FROM perch3_shop_tax_locations
[38] SELECT COUNT(*) FROM perch3_shop_tax_rates
[69] SELECT COUNT(*) FROM perch3_shop_variants
[0] SELECT COUNT(*) FROM perch3_user_passwords
[68] SELECT COUNT(*) FROM perch3_user_privileges
[2] SELECT COUNT(*) FROM perch3_user_role_privileges
[2] SELECT COUNT(*) FROM perch3_user_roles
[1] SELECT COUNT(*) FROM perch3_users
[1] SELECT COUNT(*) FROM perch3_users
[30] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
Queries: 74
Memory: 4.7623
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you checked your error log?

I have a self signed Mac ssl certificate ... is that the issue?

I'm working on my Mac server at home ...

[Sat Sep 02 20:32:00.128753 2017] [:error] [pid 26903] [client 127.0.0.1:65109] PHP Fatal error:  Uncaught exception 'Guzzle\\Http\\Exception\\CurlException' with message '[curl] 35: SSL peer handshake failed, the server most likely requires a client certificate to connect [url] https://api-3t.sandbox.paypal.com/nvp' in /Users/bmyers/Sites/becalistyle/perch/addons/apps/perch_shop/lib/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php:359\nStack trace:\n#0 /Users/bmyers/Sites/becalistyle/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)\n#1 /Users/bmyers/Sites/becalistyle/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)\n#2 /Users/bmyers/Sites/becalistyle/perch/addons/apps/perch_shop/lib/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(2 in /Users/bmyers/Sites/becalistyle/perch/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

I think you'll need to make sure your SSL implementation is up to date. This is nothing to do with the HTTPS configuration of your site.

I'll log this as solved ... you answered all the questions of my original post and the HTTPS / SSL cert issue is an entirely different problem :)

PayPal Express works on the live server, just not on my home-brew server ... so it has more to do with my settings than perch.

Thanks for all the help getting me set with the over-all flow of Perch shop! Love the software ... steep learning curve though. Totally worth it in the end!