Forum

Thread tagged as: Problem, Shop

PayPal Express Error when on Checkout

Hi there,

I'm having problems with checking out with the paypal express payment gateway integrated. I was wondering if you could help. The main error I see is No country set for address

Here is my DEBUG

Debug Message
[31] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC, p.pagePath ASC
Matched page: /shop/checkout, so not using routes.
Using master page: /templates/pages/shop/checkout.php
[1] SELECT * FROM perch2_members_sessions WHERE sessionID='110949633c275cbb4e41c27e313d8ba2e4d08990' AND sessionHttpFootprint='a38673fec9a8955dc9f50097d7cddf9b141fa821' AND sessionExpires>'2016-11-03 10:20:41' LIMIT 1
User is logged in
[1] SELECT * FROM perch2_pages WHERE pagePath='/shop/checkout' LIMIT 1
[1] SELECT * FROM perch2_shop_cart WHERE cartID=209
[1] SELECT * FROM perch2_shop_cart WHERE cartID=209
Holding redirects
Checking out with paypal-express
Member ID: 10
[1] SELECT * FROM perch2_shop_customers WHERE memberID=10
[1] SELECT billingAddress, shippingAddress FROM perch2_shop_cart WHERE billingAddress IS NOT NULL AND cartID=209
[1] SELECT * FROM perch2_shop_addresses WHERE customerID='10' AND orderID IS NULL AND addressSlug='default'
[1] SELECT * FROM perch2_shop_addresses WHERE customerID='10' AND orderID IS NULL AND addressSlug='default'
------------------------------ Calculating cart ------------------------------
[1] SELECT * FROM perch2_shop_cart WHERE cartID=209
[1] SELECT * FROM perch2_shop_cart WHERE cartID=209
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationID=1 AND locationDeleted IS NULL LIMIT 1
[1] SELECT locationID FROM perch2_shop_tax_locations WHERE locationIsHome=1 LIMIT 1
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationID=1 AND locationDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_customers WHERE memberID=10
[1] SELECT * FROM perch2_shop_currencies WHERE currencyID=47 LIMIT 1
[1] SELECT COUNT(productID) AS product_count, SUM(itemQty) AS item_count FROM perch2_shop_cart_items WHERE cartID=209
[47] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Tax mode: exc
[1] SELECT * FROM perch2_shop_cart_items WHERE cartID=209 ORDER BY itemID ASC
[1] SELECT * FROM perch2_shop_products WHERE productID=89 AND productDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_products WHERE productID=64 AND productDeleted IS NULL LIMIT 1
[5] SELECT productID, productVariantDesc, stock_level FROM perch2_shop_products WHERE parentID=64 AND productDeleted IS NULL ORDER BY productOrder ASC
[1] SELECT o.* FROM perch2_shop_options o, perch2_shop_product_options po WHERE o.optionID=po.optionID AND po.productID=64 AND o.optionDeleted IS NULL ORDER BY optionPrecendence ASC
[6] SELECT valueID AS id, valueTitle AS title, valueSKUCode AS skucode FROM perch2_shop_option_values WHERE optionID=3 AND valueDeleted IS NULL ORDER BY valueOrder ASC
[5] SELECT pov.prodoptID, pov.optionID, pov.valueID, o.optionTitle, ov.* FROM perch2_shop_product_option_values pov, perch2_shop_options o, perch2_shop_option_values ov WHERE pov.productID='64' AND pov.optionID=o.optionID AND pov.valueID=ov.valueID AND o.optionDeleted IS NULL AND ov.valueDeleted IS NULL AND o.optionID='3' ORDER BY o.optionPrecendence ASC, ov.valueOrder ASC
[1] SELECT * FROM perch2_shop_products WHERE productID=64 AND productDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_products WHERE productID=64 AND productDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_tax_groups WHERE groupID=1 AND groupDeleted IS NULL LIMIT 1
[0] SELECT r.rateValue FROM perch2_shop_tax_group_rates gr, perch2_shop_tax_rates r WHERE gr.rateID=r.rateID AND gr.groupID=1 AND gr.locationID=1
[1] SELECT * FROM perch2_shop_products WHERE productID=64 AND productDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_products WHERE productID=64 AND productDeleted IS NULL LIMIT 1
[5] SELECT productID, productVariantDesc, stock_level FROM perch2_shop_products WHERE parentID=64 AND productDeleted IS NULL ORDER BY productOrder ASC
[1] SELECT o.* FROM perch2_shop_options o, perch2_shop_product_options po WHERE o.optionID=po.optionID AND po.productID=64 AND o.optionDeleted IS NULL ORDER BY optionPrecendence ASC
[6] SELECT valueID AS id, valueTitle AS title, valueSKUCode AS skucode FROM perch2_shop_option_values WHERE optionID=3 AND valueDeleted IS NULL ORDER BY valueOrder ASC
[5] SELECT pov.prodoptID, pov.optionID, pov.valueID, o.optionTitle, ov.* FROM perch2_shop_product_option_values pov, perch2_shop_options o, perch2_shop_option_values ov WHERE pov.productID='64' AND pov.optionID=o.optionID AND pov.valueID=ov.valueID AND o.optionDeleted IS NULL AND ov.valueDeleted IS NULL AND o.optionID='3' ORDER BY o.optionPrecendence ASC, ov.valueOrder ASC
[1] SELECT * FROM perch2_shop_promotions WHERE promoFrom<='2016-11-03 10:20:00' AND promoTo>'2016-11-03 10:20:00' AND promoActive=1 AND promoDeleted IS NULL ORDER BY promoOrder ASC
Promo (Group Booking 20% Discount) skipped: discount code not applied.
[1] SELECT * FROM perch2_shop_cart WHERE cartID=209
[1] SELECT * FROM perch2_shop_cart WHERE cartID=209
INSERT INTO perch2_shop_orders(orderStatus,orderGateway,orderTotal,currencyID,orderItemsSubtotal,orderItemsTax,orderItemsTotal,orderShippingSubtotal,orderShippingDiscounts,orderShippingTax,orderShippingTaxDiscounts,orderShippingTotal,orderDiscountsTotal,orderTaxDiscountsTotal,orderSubtotal,orderTaxTotal,orderItemsRefunded,orderTaxRefunded,orderShippingRefunded,orderTotalRefunded,orderTaxID,orderShippingWeight,orderCreated,orderPricing,orderDynamicFields,customerID,shippingID,orderShippingTaxRate,orderBillingAddress,orderShippingAddress) VALUES('created','paypal-express','312.00','47','312.00','0.00',312,'0.00','0.00','0.00','0.00','0.00','0.00','0.00',312,'0.00',0,0,0,0,NULL,'0.00','2016-11-03 10:20:41','standard','[]','10',NULL,0,'49','49')
[1] SELECT * FROM perch2_shop_orders WHERE orderID='25' LIMIT 1
No ids to log.
UPDATE perch2_shop_orders SET orderStatus='created', orderGateway='paypal-express', orderTotal='312.00', currencyID='47', orderItemsSubtotal='312.00', orderItemsTax='0.00', orderItemsTotal=312, orderShippingSubtotal='0.00', orderShippingDiscounts='0.00', orderShippingTax='0.00', orderShippingTaxDiscounts='0.00', orderShippingTotal='0.00', orderDiscountsTotal='0.00', orderTaxDiscountsTotal='0.00', orderSubtotal=312, orderTaxTotal='0.00', orderItemsRefunded=0, orderTaxRefunded=0, orderShippingRefunded=0, orderTotalRefunded=0, orderTaxID=NULL, orderShippingWeight='0.00', orderCreated='2016-11-03 10:20:41', orderPricing='standard', orderDynamicFields='[]', customerID='10', shippingID=NULL, orderShippingTaxRate=0, orderBillingAddress='49', orderShippingAddress='49', orderUpdated='2016-11-03 10:20:41' WHERE orderID='25'
No ids to log.
[1] SELECT * FROM perch2_shop_addresses WHERE addressID=49
INSERT INTO perch2_shop_addresses(addressTitle,addressSlug,addressFirstName,addressLastName,addressCompany,addressLine1,addressDynamicFields,addressCreated,addressUpdated,addressDeleted,customerID,countryID,regionID,orderID) VALUES('default','default','Chris','Gorrod','Fishtank Creative Ltd','29 Pinfold Lane','{\"first_name\":\"Chris\",\"last_name\":\"Gorrod\",\"address_1\":\"29 Pinfold Lane\",\"address_2\":\"Mirfield\",\"postcode\":\"WF14 9HZ\",\"country\":\"236\",\"company\":\"Fishtank Creative Ltd\",\"city\":\"Huddersfield\",\"county\":\"West Yorkshire\",\"customer\":\"10\"}','2016-11-03 10:00:51','2016-11-03 10:00:51',NULL,'10','236',NULL,25)
UPDATE perch2_shop_orders SET orderBillingAddress='55', orderShippingAddress='55', orderUpdated='2016-11-03 10:20:41' WHERE orderID='25'
No ids to log.
INSERT INTO perch2_shop_order_items(itemType,orderID,productID,itemPrice,itemTax,itemTotal,itemQty,itemTaxRate,itemDiscount,itemTaxDiscount) VALUES('product','25','89','156.00','0.00','156.00','2',0,0,0)
[1] SELECT * FROM perch2_shop_order_items WHERE itemID='26' LIMIT 1
No ids to log.
UPDATE perch2_shop_order_items SET itemType='product', orderID='25', productID='89', itemPrice='156.00', itemTax='0.00', itemTotal='156.00', itemQty='2', itemTaxRate=0, itemDiscount=0, itemTaxDiscount=0 WHERE itemID='26'
No ids to log.
UPDATE perch2_shop_cart_data SET orderID='25' WHERE cartID='209'
INSERT INTO perch2_shop_tax_exhibits(orderID,exhibitType,exhibitDetail,exhibitSource,locationID,countryID,exhibitDate) VALUES(25,'IP_ADDRESS','86.2.230.214','Environment',NULL,NULL,'2016-11-03 10:20:41')
[1] SELECT * FROM perch2_shop_tax_exhibits WHERE exhibitID='59' LIMIT 1
No ids to log.
UPDATE perch2_shop_tax_exhibits SET orderID=25, exhibitType='IP_ADDRESS', exhibitDetail='86.2.230.214', exhibitSource='Environment', locationID=NULL, countryID=NULL, exhibitDate='2016-11-03 10:20:41' WHERE exhibitID='59'
No ids to log.
[1] SELECT * FROM perch2_shop_order_statuses WHERE statusKey='created' AND statusActive=1 AND statusDeleted IS NULL
[nil] SELECT * FROM perch2_shop_emails WHERE emailStatus=1 AND emailActive=1
[1] SELECT * FROM perch2_shop_currencies WHERE currencyID='47' LIMIT 1
[1] SELECT * FROM perch2_shop_customers WHERE customerID='10' AND customerDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_addresses WHERE addressID=55 AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_addresses WHERE addressID=55 AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
Payment failed
Omnipay\PayPal\Message\ExpressAuthorizeResponse Object
(
    [liveCheckoutEndpoint:protected] => https://www.paypal.com/cgi-bin/webscr
    [testCheckoutEndpoint:protected] => https://www.sandbox.paypal.com/cgi-bin/webscr
    [request:protected] => Omnipay\PayPal\Message\ExpressAuthorizeRequest Object
        (
            [liveEndpoint:protected] => https://api-3t.paypal.com/nvp
            [testEndpoint:protected] => https://api-3t.sandbox.paypal.com/nvp
            [parameters:protected] => Symfony\Component\HttpFoundation\ParameterBag Object
                (
                    [parameters:protected] => Array
                        (
                            [username] => info_api1.thebigblueswim.com
                            [password] => C45XT4PYVJA84TSK
                            [signature] => AFcWxV21C7fd0v3bYYYRCpSSRl31AnnnE8PGLjLwvzeD.lQYGghtkNap
                            [testMode] => 1
                            [solutionType] => Sole
                            [landingPage] => Billing
                            [brandName] => 
                            [headerImageUrl] => 
                            [logoImageUrl] => 
                            [borderColor] => 
                            [returnUrl] => /shop/result
                            [cancelUrl] => /bookings
                            [amount] => 312.00
                            [currency] => GBP
                            [transactionId] => 25
                            [clientIp] => 86.2.230.214
                            [description] => Order #25
                            [card] => Omnipay\Common\CreditCard Object
                                (
                                    [supported_cards:protected] => Array
                                        (
                                            [visa] => /^4\d{12}(\d{3})?$/
                                            [mastercard] => /^(5[1-5]\d{4}|677189)\d{10}$|^(222[1-9]|2[3-6]\d{2}|27[0-1]\d|2720)\d{12}$/
                                            [discover] => /^(6011|65\d{2}|64[4-9]\d)\d{12}|(62\d{14})$/
                                            [amex] => /^3[47]\d{13}$/
                                            [diners_club] => /^3(0[0-5]|[68]\d)\d{11}$/
                                            [jcb] => /^35(28|29|[3-8]\d)\d{12}$/
                                            [switch] => /^6759\d{12}(\d{2,3})?$/
                                            [solo] => /^6767\d{12}(\d{2,3})?$/
                                            [dankort] => /^5019\d{12}$/
                                            [maestro] => /^(5[06-8]|6\d)\d{10,17}$/
                                            [forbrugsforeningen] => /^600722\d{10}$/
                                            [laser] => /^(6304|6706|6709|6771(?!89))\d{8}(\d{4}|\d{6,7})?$/
                                        )

                                    [parameters:protected] => Symfony\Component\HttpFoundation\ParameterBag Object
                                        (
                                            [parameters:protected] => Array
                                                (
                                                    [billingFirstName] => Chris
                                                    [shippingFirstName] => Chris
                                                    [billingLastName] => Gorrod
                                                    [shippingLastName] => Gorrod
                                                    [billingAddress1] => 29 Pinfold Lane
                                                    [billingAddress2] => Mirfield
                                                    [billingCity] => Huddersfield
                                                    [billingPostcode] => WF14 9HZ
                                                    [billingState] => West Yorkshire
                                                    [billingCountry] => GB
                                                    [shippingAddress1] => 29 Pinfold Lane
                                                    [shippingAddress2] => Mirfield
                                                    [shippingCity] => Huddersfield
                                                    [shippingPostcode] => WF14 9HZ
                                                    [shippingState] => West Yorkshire
                                                    [shippingCountry] => GB
                                                    [billingCompany] => 
                                                    [shippingCompany] => 
                                                    [email] => chris@teamfc.co.uk
                                                )

                                        )

                                )

                            [transactionReference] => 25
                        )

                )

            [httpClient:protected] => Guzzle\Http\Client Object
                (
                    [defaultHeaders:protected] => Guzzle\Common\Collection Object
                        (
                            [data:protected] => Array
                                (
                                )

                        )

                    [userAgent:protected] => Guzzle/3.9.3 curl/7.36.0 PHP/5.4.45
                    [config:Guzzle\Http\Client:private] => Guzzle\Common\Collection Object
                        (
                            [data:protected] => Array
                                (
                                    [curl.options] => Array
                                        (
                                            [78] => 60
                                            [10065] => /home/thebigbl/public_html/newsite/admin/addons/apps/perch_shop/lib/vendor/guzzle/guzzle/src/Guzzle/Http/Resources/cacert.pem
                                            [64] => 1
                                            [81] => 2
                                        )

                                )

                        )

                    [baseUrl:Guzzle\Http\Client:private] => 
                    [curlMulti:Guzzle\Http\Client:private] => Guzzle\Http\Curl\CurlMultiProxy Object
                        (
                            [handles:protected] => Array
                                (
                                    [0] => Guzzle\Http\Curl\CurlMulti Object
                                        (
                                            [multiHandle:protected] => Resource id #203
                                            [requests:protected] => Array
                                                (
                                                )

                                            [handles:protected] => SplObjectStorage Object
                                                (
                                                    [storage:SplObjectStorage:private] => Array
                                                        (
                                                        )

                                                )

                                            [resourceHash:protected] => Array
                                                (
                                                )

                                            [exceptions:protected] => Array
                                                (
                                                )

                                            [successful:protected] => Array
                                                (
                                                )

                                            [multiErrors:protected] => Array
                                                (
                                                    [1] => Array
                                                        (
                                                            [0] => CURLM_BAD_HANDLE
                                                            [1] => The passed-in handle is not a valid CURLM handle.
                                                        )

                                                    [2] => Array
                                                        (
                                                            [0] => CURLM_BAD_EASY_HANDLE
                                                            [1] => An easy handle was not good/valid. It could mean that it isn't an easy handle at all, or possibly that the handle already is in used by this or another multi handle.
                                                        )

                                                    [3] => Array
                                                        (
                                                            [0] => CURLM_OUT_OF_MEMORY
                                                            [1] => You are doomed.
                                                        )

                                                    [4] => Array
                                                        (
                                                            [0] => CURLM_INTERNAL_ERROR
                                                            [1] => This can only be returned if libcurl bugs. Please report it to us!
                                                        )

                                                )

                                            [selectTimeout:protected] => 1
                                            [eventDispatcher:protected] => Symfony\Component\EventDispatcher\EventDispatcher Object
                                                (
                                                    [listeners:Symfony\Component\EventDispatcher\EventDispatcher:private] => Array
                                                        (
                                                        )

                                                    [sorted:Symfony\Component\EventDispatcher\EventDispatcher:private] => Array
                                                        (
                                                        )

                                                )

                                        )

                                )

                            [groups:protected] => Array
                                (
                                )

                            [queued:protected] => Array
                                (
                                )

                            [maxHandles:protected] => 3
                            [selectTimeout:protected] => 1
                            [eventDispatcher:protected] => Symfony\Component\EventDispatcher\EventDispatcher Object
                                (
                                    [listeners:Symfony\Component\EventDispatcher\EventDispatcher:private] => Array
                                        (
                                        )

                                    [sorted:Symfony\Component\EventDispatcher\EventDispatcher:private] => Array
                                        (
                                        )

                                )

                        )

                    [uriTemplate:Guzzle\Http\Client:private] => Guzzle\Parser\UriTemplate\UriTemplate Object
                        (
                            [template:Guzzle\Parser\UriTemplate\UriTemplate:private] => 
                            [variables:Guzzle\Parser\UriTemplate\UriTemplate:private] => 
                            [regex:Guzzle\Parser\UriTemplate\UriTemplate:private] => /\{([^\}]+)\}/
                        )

                    [requestFactory:protected] => Guzzle\Http\Message\RequestFactory Object
                        (
                            [methods:protected] => Array
                                (
                                    [getInstance] => 0
                                    [__construct] => 1
                                    [fromMessage] => 2
                                    [fromParts] => 3
                                    [create] => 4
                                    [cloneRequestWithMethod] => 5
                                    [applyOptions] => 6
                                    [visit_headers] => 7
                                    [visit_body] => 8
                                    [visit_allow_redirects] => 9
                                    [visit_auth] => 10
                                    [visit_query] => 11
                                    [visit_cookies] => 12
                                    [visit_events] => 13
                                    [visit_plugins] => 14
                                    [visit_exceptions] => 15
                                    [visit_save_to] => 16
                                    [visit_params] => 17
                                    [visit_timeout] => 18
                                    [visit_connect_timeout] => 19
                                    [visit_debug] => 20
                                    [visit_verify] => 21
                                    [visit_proxy] => 22
                                    [visit_cert] => 23
                                    [visit_ssl_key] => 24
                                )

                            [requestClass:protected] => Guzzle\Http\Message\Request
                            [entityEnclosingRequestClass:protected] => Guzzle\Http\Message\EntityEnclosingRequest
                        )

                    [eventDispatcher:protected] => Symfony\Component\EventDispatcher\EventDispatcher Object
                        (
                            [listeners:Symfony\Component\EventDispatcher\EventDispatcher:private] => Array
                                (
                                    [request.sent] => Array
                                        (
                                            [100] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [0] => Guzzle\Http\RedirectPlugin Object
                                                                (
                                                                    [defaultMaxRedirects:protected] => 5
                                                                )

                                                            [1] => onRequestSent
                                                        )

                                                )

                                        )

                                    [request.clone] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [0] => Guzzle\Http\RedirectPlugin Object
                                                                (
                                                                    [defaultMaxRedirects:protected] => 5
                                                                )

                                                            [1] => cleanupRequest
                                                        )

                                                )

                                        )

                                    [request.before_send] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [0] => Guzzle\Http\RedirectPlugin Object
                                                                (
                                                                    [defaultMaxRedirects:protected] => 5
                                                                )

                                                            [1] => cleanupRequest
                                                        )

                                                )

                                        )

                                )

                            [sorted:Symfony\Component\EventDispatcher\EventDispatcher:private] => Array
                                (
                                )

                        )

                )

            [httpRequest:protected] => Symfony\Component\HttpFoundation\Request Object
                (
                    [attributes] => Symfony\Component\HttpFoundation\ParameterBag Object
                        (
                            [parameters:protected] => Array
                                (
                                )

                        )

                    [request] => Symfony\Component\HttpFoundation\ParameterBag Object
                        (
                            [parameters:protected] => Array
                                (
                                )

                        )

                    [query] => Symfony\Component\HttpFoundation\ParameterBag Object
                        (
                            [parameters:protected] => Array
                                (
                                )

                        )

                    [server] => Symfony\Component\HttpFoundation\ServerBag Object
                        (
                            [parameters:protected] => Array
                                (
                                    [CONTEXT_DOCUMENT_ROOT] => /home/thebigbl/public_html/newsite
                                    [CONTEXT_PREFIX] => 
                                    [DOCUMENT_ROOT] => /home/thebigbl/public_html/newsite
                                    [GATEWAY_INTERFACE] => CGI/1.1
                                    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
                                    [HTTP_ACCEPT_ENCODING] => gzip, deflate, sdch
                                    [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.8,fr;q=0.6
                                    [HTTP_CONNECTION] => keep-alive
                                    [HTTP_COOKIE] => __utma=179088353.1280137802.1478085833.1478085833.1478085833.1; __utmz=179088353.1478085833.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); p_m=110949633c275cbb4e41c27e313d8ba2e4d08990; _gat=1; _ga=GA1.2.1280137802.1478085833; cmsa=1; PHPSESSID=ugo77ns791digmnvqt0ja00c65
                                    [HTTP_HOST] => newsite.thebigblueswim.com
                                    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1
                                    [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.35 Safari/537.36
                                    [PATH] => /bin:/usr/bin
                                    [PHPRC] => /home/thebigbl/public_html
                                    [QUERY_STRING] => 
                                    [REDIRECT_STATUS] => 200
                                    [REDIRECT_UNIQUE_ID] => WBsPeVd1-OsABqTx1aIAAAAN
                                    [REDIRECT_URL] => /shop/checkout
                                    [REMOTE_ADDR] => 86.2.230.214
                                    [REMOTE_PORT] => 61150
                                    [REQUEST_METHOD] => GET
                                    [REQUEST_SCHEME] => http
                                    [REQUEST_URI] => /shop/checkout
                                    [SCRIPT_FILENAME] => /home/thebigbl/public_html/newsite/admin/core/runway/start.php
                                    [SCRIPT_NAME] => /admin/core/runway/start.php
                                    [SERVER_ADDR] => 87.117.252.235
                                    [SERVER_ADMIN] => webmaster@newsite.thebigblueswim.com
                                    [SERVER_NAME] => newsite.thebigblueswim.com
                                    [SERVER_PORT] => 80
                                    [SERVER_PROTOCOL] => HTTP/1.1
                                    [SERVER_SIGNATURE] => 
                                    [SERVER_SOFTWARE] => Apache
                                    [UNIQUE_ID] => WBsPeVd1-OsABqTx1aIAAAAN
                                    [PHP_SELF] => /admin/core/runway/start.php
                                    [REQUEST_TIME_FLOAT] => 1478168441.3291
                                    [REQUEST_TIME] => 1478168441
                                )

                        )

                    [files] => Symfony\Component\HttpFoundation\FileBag Object
                        (
                            [parameters:protected] => Array
                                (
                                )

                        )

                    [cookies] => Symfony\Component\HttpFoundation\ParameterBag Object
                        (
                            [parameters:protected] => Array
                                (
                                    [__utma] => 179088353.1280137802.1478085833.1478085833.1478085833.1
                                    [__utmz] => 179088353.1478085833.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
                                    [p_m] => 110949633c275cbb4e41c27e313d8ba2e4d08990
                                    [_gat] => 1
                                    [_ga] => GA1.2.1280137802.1478085833
                                    [cmsa] => 1
                                    [PHPSESSID] => ugo77ns791digmnvqt0ja00c65
                                )

                        )

                    [headers] => Symfony\Component\HttpFoundation\HeaderBag Object
                        (
                            [headers:protected] => Array
                                (
                                    [accept] => Array
                                        (
                                            [0] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
                                        )

                                    [accept-encoding] => Array
                                        (
                                            [0] => gzip, deflate, sdch
                                        )

                                    [accept-language] => Array
                                        (
                                            [0] => en-US,en;q=0.8,fr;q=0.6
                                        )

                                    [connection] => Array
                                        (
                                            [0] => keep-alive
                                        )

                                    [cookie] => Array
                                        (
                                            [0] => __utma=179088353.1280137802.1478085833.1478085833.1478085833.1; __utmz=179088353.1478085833.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); p_m=110949633c275cbb4e41c27e313d8ba2e4d08990; _gat=1; _ga=GA1.2.1280137802.1478085833; cmsa=1; PHPSESSID=ugo77ns791digmnvqt0ja00c65
                                        )

                                    [host] => Array
                                        (
                                            [0] => newsite.thebigblueswim.com
                                        )

                                    [upgrade-insecure-requests] => Array
                                        (
                                            [0] => 1
                                        )

                                    [user-agent] => Array
                                        (
                                            [0] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.35 Safari/537.36
                                        )

                                )

                            [cacheControl:protected] => Array
                                (
                                )

                        )

                    [content:protected] => 
                    [languages:protected] => 
                    [charsets:protected] => 
                    [encodings:protected] => 
                    [acceptableContentTypes:protected] => 
                    [pathInfo:protected] => 
                    [requestUri:protected] => 
                    [baseUrl:protected] => 
                    [basePath:protected] => 
                    [method:protected] => 
                    [format:protected] => 
                    [session:protected] => 
                    [locale:protected] => 
                    [defaultLocale:protected] => en
                )

            [response:protected] => Omnipay\PayPal\Message\ExpressAuthorizeResponse Object
 *RECURSION*
            [zeroAmountAllowed:protected] => 1
            [negativeAmountAllowed:protected] => 
        )

    [data:protected] => Array
        (
            [TIMESTAMP] => 2016-11-03T10:20:44Z
            [CORRELATIONID] => 1e9bfc328c2e5
            [ACK] => Failure
            [VERSION] => 119.0
            [BUILD] => 26593028
            [L_ERRORCODE0] => 10471
            [L_ERRORCODE1] => 10472
            [L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details.
            [L_SHORTMESSAGE1] => Transaction refused because of an invalid argument. See additional error messages for details.
            [L_LONGMESSAGE0] => ReturnURL is invalid.
            [L_LONGMESSAGE1] => CancelURL is invalid.
            [L_SEVERITYCODE0] => Error
            [L_SEVERITYCODE1] => Error
        )

)
Setting order status to payment_failed
UPDATE perch2_shop_orders SET orderDynamicFields='{\"status\":\"payment_failed\"}', orderStatus='payment_failed', orderUpdated='2016-11-03 10:20:42' WHERE orderID='25'
No ids to log.
[1] SELECT * FROM perch2_shop_order_statuses WHERE statusKey='payment_failed' AND statusActive=1 AND statusDeleted IS NULL
[nil] SELECT * FROM perch2_shop_emails WHERE emailStatus=2 AND emailActive=1
Redirect held: /bookings
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
[18] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/shop/checkout' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-008-001', '000-008', '000') ORDER BY pageTreePosition DESC
[8] Using template: /templates/navigation/item.html
Using cart from cache.
[1] SELECT * FROM perch2_shop_products WHERE productID=64 AND productDeleted IS NULL LIMIT 1
[5] SELECT productID, productVariantDesc, stock_level FROM perch2_shop_products WHERE parentID=64 AND productDeleted IS NULL ORDER BY productOrder ASC
[1] SELECT o.* FROM perch2_shop_options o, perch2_shop_product_options po WHERE o.optionID=po.optionID AND po.productID=64 AND o.optionDeleted IS NULL ORDER BY optionPrecendence ASC
[6] SELECT valueID AS id, valueTitle AS title, valueSKUCode AS skucode FROM perch2_shop_option_values WHERE optionID=3 AND valueDeleted IS NULL ORDER BY valueOrder ASC
[5] SELECT pov.prodoptID, pov.optionID, pov.valueID, o.optionTitle, ov.* FROM perch2_shop_product_option_values pov, perch2_shop_options o, perch2_shop_option_values ov WHERE pov.productID='64' AND pov.optionID=o.optionID AND pov.valueID=ov.valueID AND o.optionDeleted IS NULL AND ov.valueDeleted IS NULL AND o.optionID='3' ORDER BY o.optionPrecendence ASC, ov.valueOrder ASC
[1] Using template: /templates/shop/cart/cart_static.html
[1] SELECT * FROM perch2_shop_customers WHERE memberID=10
[2] SELECT * FROM perch2_shop_addresses WHERE customerID='10' AND orderID IS NULL
[2] Using template: /templates/shop/checkout/order_address_form.html
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
No country set for address
Using template: /addons/apps/perch_shop/templates/shop/gateways/stripe_payment_form.html
[1] SELECT groupID FROM perch2_navigation WHERE groupSlug='footer' LIMIT 1
[7] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM perch2_navigation_pages np, perch2_pages p WHERE p.pageID=np.pageID AND np.groupID=1 AND p.pageNew=0 AND np.pageDepth >=0 AND np.pageDepth<=1 ORDER BY np.pageTreePosition ASC
[0] SELECT np.pageTreePosition FROM perch2_pages p, perch2_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=1 AND p.pagePath='/shop/checkout' LIMIT 1
[7] Using template: /templates/navigation/footer.html
Request time: 1.5676
Process time: 1.567
Memory: 9.9605

Here is my Diagnostic Report (short version)

Perch Runway: 2.8.31, PHP: 5.4.45, MySQL: 10.0.28-MariaDB, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_blog (5.0), perch_forms (1.8.3), perch_shop_orders (PERCH_SHOP_VERSION), perch_shop_products (PERCH_SHOP_VERSION), perch_shop (1.0.8), perch_members (1.5)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', 'perch_members', 'perch_shop', );
PERCH_LOGINPATH: /admin
PERCH_PATH: /home/thebigbl/public_html/newsite/admin
PERCH_CORE: /home/thebigbl/public_html/newsite/admin/core
PERCH_RESFILEPATH: /home/thebigbl/public_html/newsite/admin/resources
Image manipulation: GD
PHP limits: Max upload 2M, Max POST 8M, Memory: 128M, Total max file upload: 2M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
DOCUMENT_ROOT: /home/thebigbl/public_html/newsite
HTTP_HOST: newsite.thebigblueswim.com
REQUEST_URI: /admin/core/settings/diagnostics/
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php

Here is my shop config file

<?php
    return [

        /*
        |--------------------------------------------------------------------------
        | Gateway settings
        |--------------------------------------------------------------------------
        */

        'gateways' => [

            'default' => [
                'enabled'   => true,
                'test_mode' => false,
                'live' => [
                    'api_key'      => 'abc123',
                ],
                'test' => [
                    'api_key'      => 'abc123',
                ],
            ],


            'stripe' => [
                'enabled'   => true,
                'test_mode' => true,
                'live' => [
                    'secret_key'      => 'xxxxxxxxxxxxxxxxxxxx',
                    'publishable_key' => 'xxxxxxxxxxxxxxxxxxxx',
                ],
                'test' => [
                    'secret_key'      => 'xxxxxxxxxxxxxxxxxxxx',
                    'publishable_key' => 'xxxxxxxxxxxxxxxxxxxx',
                ],
            ],

            'paypal-express' => [
                'enabled'   => true,
                'test_mode' => true,
                'live' => [
                    'username'  => 'xxxxxxxxxxxxxxxxxxxx', // Same as test API details
                    'password'  => 'xxxxxxxxxxxxxxxxxxxx', // Same as test API details
                    'signature' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // Same as test API details
                ],
                'test' => [
                    'username'  => 'xxxxxxxxxxxxxxxxxxxx',
                    'password'  => 'xxxxxxxxxxxxxxxxxxxx',
                    'signature' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
                ],
            ],

        ],

    ];

Here is my checkout page code

<?php

    if (!perch_member_logged_in()) {
        PerchSystem::redirect('/shop/register');
    }

    PerchUtil::hold_redirects();

    // your 'success' and 'failure' URLs
    $return_url = '/shop/result';
    $cancel_url = '/bookings';

    if (perch_member_logged_in() && perch_post('stripeToken')) {

        perch_shop_checkout('stripe', [
            'return_url' => $return_url,
            'cancel_url' => $cancel_url,
            'token'      => perch_post('stripeToken')
        ]);

    }

    if (perch_member_logged_in()) {

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

    }

    // Include the header. You can find this in tempates/layouts/global
    perch_layout('global/header');
?>

    <div class="canvas">

        <?php
            // Show the cart with a non-interactive template
            perch_shop_cart([
                'template'=>'cart/cart_static.html'
            ]);

            perch_shop_order_address_form();
        ?>

            <div class="content  clear  row">
                <?php
                    // Display the form with the T&Cs checkbox
                    // perch_shop_form('checkout/confirm.html');
                    perch_shop_payment_form('stripe');
                    //perch_shop_payment_form('paypal-express');
                ?>
            </div>

        <?php
            // Include the footer. You can find this in tempates/layouts/global
            perch_layout('global/footer');
        ?>

    </div> <!-- Closes Canvas Div -->

    <script src="/assets/build/js/main.min.js"></script>

</body>
</html>

Here is my report page

<?php
    // Include the header. You can find this in tempates/layouts/global
    perch_layout('global/header');
?>

    <div class="canvas">

        <?php
            perch_shop_complete_payment('paypal-express');

            // Has the order been succcessfully placed?
            if (perch_shop_order_successful()) {
        ?>

        <?php
            // Yes! Show a success message
            perch_content('Order successful');
        ?>

        <section class="section">
            <div class="container">
                <div class="content">
                    <h2 class="alpha alpha-curve  curve secondary d700 caps align-center bottom--lg  [ anim fadeIn ]">Additional Details</h2>
                    <?php perch_member_form('profile.html'); ?>
                </div>
            </div>
        </section>

        <section class="section dotted-bg">

            <h2 class="alpha alpha-curve  curve secondary d700 caps align-center bottom--lg  [ anim fadeIn ]">Additional Details</h2>
            <?php
                // Redisplay the details of the order
                perch_shop_order_items(
                    perch_shop_successful_order_id()
                );

                perch_shop_empty_cart();
            ?>
        </section>



        <?php

            } else {

                // Payment problem! Show instructions to the customer
                perch_content('Payment not successful');
            }
        ?>

        <?php
            // Include the footer. You can find this in tempates/layouts/global
            perch_layout('global/footer');
        ?>

    </div> <!-- Closes Canvas Div -->

    <script src="/assets/build/js/main.min.js"></script>

</body>
</html>

I have followed your instructions carefully so not sure what the problem would be, I'm not understanding any of the errors on the DEBUG I was wondering if you could with this - https://docs.grabaperch.com/addons/shop/gateways/paypal-express/

Fishtank Creative

Fishtank Creative 2 points

  • 4 years ago

Please see the full diagnostics report

PERCH INFORMATION

Perch Runway: 2.8.31
Production mode: Production (100)
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_blog (5.0), perch_forms (1.8.3), perch_shop_orders (PERCH_SHOP_VERSION), perch_shop_products (PERCH_SHOP_VERSION), perch_shop (1.0.8), perch_members (1.5)
DB driver: PDO
DB tables: perch2_backup_plans (0), perch2_backup_resources (0), perch2_backup_runs (0), perch2_blog_authors (2), perch2_blog_comments (0), perch2_blog_index (477), perch2_blog_posts (18), perch2_blog_posts_to_tags (12), perch2_blog_sections (1), perch2_blog_tags (8), perch2_blogs (1), perch2_categories (5), perch2_category_counts (0), perch2_category_sets (2), perch2_collection_index (0), perch2_collection_items (0), perch2_collection_revisions (0), perch2_collections (0), perch2_content_index (2446), perch2_content_items (396), perch2_content_regions (46), perch2_forms (2), perch2_forms_responses (419), perch2_gallery_albums (6), perch2_gallery_image_versions (954), perch2_gallery_images (159), perch2_members (5), perch2_members_forms (2), perch2_members_member_tags (3), perch2_members_sessions (6), perch2_members_tags (5), perch2_navigation (1), perch2_navigation_pages (7), perch2_page_routes (4), perch2_page_templates (31), perch2_pages (30), perch2_resource_log (492), perch2_resource_tags (0), perch2_resources (198), perch2_resources_to_tags (0), perch2_settings (48), perch2_shop_addresses (49), perch2_shop_admin_index (30), perch2_shop_brands (3), perch2_shop_cart (86), perch2_shop_cart_data (203), perch2_shop_cart_items (52), perch2_shop_countries (250), perch2_shop_currencies (152), perch2_shop_customers (10), perch2_shop_emails (1), perch2_shop_index (2790), perch2_shop_option_values (24), perch2_shop_options (5), perch2_shop_order_items (26), perch2_shop_order_promotions (0), perch2_shop_order_statuses (9), perch2_shop_orders (25), perch2_shop_orders_meta (1), perch2_shop_product_files (0), perch2_shop_product_option_values (53), perch2_shop_product_options (15), perch2_shop_product_tags (6), perch2_shop_products (102), perch2_shop_promotions (1), perch2_shop_search (48), perch2_shop_shipping_zone_countries (0), perch2_shop_shipping_zones (1), perch2_shop_shippings (1), perch2_shop_tax_exhibits (59), perch2_shop_tax_group_rates (1), perch2_shop_tax_groups (1), perch2_shop_tax_locations (1), perch2_shop_tax_rates (0), perch2_shop_variants (98), perch2_user_passwords (0), perch2_user_privileges (84), perch2_user_role_privileges (24), perch2_user_roles (2), perch2_users (4), perch_blog_categories (3), perch_blog_posts (17), perch_blog_posts_to_categories (13), perch_blog_posts_to_tags (20), perch_blog_tags (8), perch_contentItems (7), perch_events (0), perch_events_categories (0), perch_events_to_categories (0), perch_forms (2), perch_forms_responses (632), perch_gallery_albums (4), perch_gallery_images (348), perch_gallery_imagesets (87), perch_settings (15), perch_users (2)
Users: 4
App runtimes:
<?php
    $apps_list = array(
        'content',
        'categories',
        'perch_blog',
        'perch_forms',
        'perch_members',
        'perch_shop',
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup
H1: c0cb7349bb666b436b84426c27935fa7
L1: f3addfd64e9906cf023b3391a0d20db3
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #0e2044
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.7: done
latest_version: 2.8.15
on_sale_version: 2.8.32
perch_gallery_update: 2.8.5
perch_blog_post_url: /blog/post/{postSlug}
headerLinkColour: #000000
logoPath: /admin/resources/bbs.png
linkColour: #ffffff
editorMayDeleteRegions: 0
perch_events_detail_url: /events/event.php?event={eventSlug}
perch_forms_editorMayConfigure: 1
perch_forms_editorMayDelete: 1
perch_events_editorMayManageCats: 0
latestUpdate: 1.8.4
headerScheme: dark
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 1
perch_gallery_bucket_mode: single
perch_gallery_bucket: default
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_blog_comment_notify: 0
perch_gallery_basicUpload: 0
update_2.8.13: done
update_runway_2.8.31: done
perch_blog_update: 5.0.1
perch_shop_update: 1.0.8
perch_members_login_page: /members/login.php?r={returnURL}
perch_shop_price_tax_mode: exc
perch_shop_trade_price_tax_mode: exc
perch_shop_site_url: https://
perch_shop_product_url: /shop/products/{slug}
perch_shop_default_currency: 47
perch_shop_reporting_currency: 47
perch_shop_invoice_number_format: Invoice%d
perch_members_update: 1.4
perch_blog_site_name: The Big Blue Swim
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: thebigbl_admin
PERCH_DB_SERVER: 87.117.252.235
PERCH_DB_DATABASE: thebigbl_runway
PERCH_DB_PREFIX: perch2_
PERCH_DEBUG: 1
PERCH_TZ: UTC
PERCH_EMAIL_FROM: barry@teamfc.co.uk
PERCH_EMAIL_FROM_NAME: Barry Corrigan
PERCH_LOGINPATH: /admin
PERCH_PATH: /home/thebigbl/public_html/newsite/admin
PERCH_CORE: /home/thebigbl/public_html/newsite/admin/core
PERCH_RESFILEPATH: /home/thebigbl/public_html/newsite/admin/resources
PERCH_RESPATH: /admin/resources
PERCH_HTML5: 1
PERCH_SITEPATH: /Users/Chris 1/Code/bigblueswim
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: /home/thebigbl/public_html/newsite/admin/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
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_SHOP_VERSION: 1.0.8
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS

PHP: 5.4.45
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: 10.0.28-MariaDB
MySQL server: 10.0.28-MariaDB
Free disk space: 45.56 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, mbstring, tokenizer, xml, cgi-fcgi, bcmath, dom, gd, imap, json, exif, mcrypt, mysql, PDO, pdo_mysql, pdo_sqlite, Phar, posix, xmlreader, xmlwriter, mhash, ionCube Loader
GD: Yes
ImageMagick: No
PHP max upload size: 2M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 2M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
CONTEXT_DOCUMENT_ROOT: /home/thebigbl/public_html/newsite
DOCUMENT_ROOT: /home/thebigbl/public_html/newsite
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,fr;q=0.6
HTTP_CONNECTION: keep-alive
HTTP_COOKIE: __utma=179088353.1280137802.1478085833.1478085833.1478085833.1; __utmz=179088353.1478085833.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); p_m=110949633c275cbb4e41c27e313d8ba2e4d08990; cmsa=1; _ga=GA1.2.1280137802.1478085833; PHPSESSID=ugo77ns791digmnvqt0ja00c65
HTTP_HOST: newsite.thebigblueswim.com
HTTP_REFERER: https://newsite.thebigblueswim.com/admin/core/settings/diagnostics/
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.35 Safari/537.36
PATH: /bin:/usr/bin
PHPRC: /home/thebigbl/public_html
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 86.2.230.214
REMOTE_PORT: 53484
REQUEST_METHOD: GET
REQUEST_SCHEME: http
REQUEST_URI: /admin/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home/thebigbl/public_html/newsite/admin/core/settings/diagnostics/index.php
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
SERVER_ADDR: 87.117.252.235
SERVER_ADMIN: webmaster@newsite.thebigblueswim.com
SERVER_NAME: newsite.thebigblueswim.com
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Apache
UNIQUE_ID: WBsST1d1-OsABq4YqgkAAAAF
PHP_SELF: /admin/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1478169167.5346
REQUEST_TIME: 1478169167
Drew McLellan

Drew McLellan 2638 points
Perch Support

It looks like you're a version behind on Shop.

Ahh ok I will get that updated. But before I do that. I noticed that the return and cancel URLs were invalid so I added the following

$actual_link = "https://$_SERVER[HTTP_HOST]";

    // your 'success' and 'failure' URLs
    $return_url = $actual_link.'/shop/result';
    $cancel_url = $actual_link.'/bookings';

Since i've done this I now get directed to paypal straight away instead of being given the choice of stripe or paypal. I'm not quite sure how I would go about this?

Thanks Barry

I think I have got this working. The way i've done is on my checkout page have the following:

<?php

    if (!perch_member_logged_in()) {
        PerchSystem::redirect('/shop/register');
    }

    $url = "https://$_SERVER[HTTP_HOST]";

    // your 'success' and 'failure' URLs
    $return_url = $url.'/shop/result';
    $cancel_url = $url.'/bookings';

    if (perch_member_logged_in() && perch_post('stripeToken')) {

        perch_shop_checkout('stripe', [
            'return_url' => $return_url,
            'cancel_url' => $cancel_url,
            'token'      => perch_post('stripeToken')
        ]);

    }

    // Include the header. You can find this in tempates/layouts/global
    perch_layout('global/header');
?>

    <div class="canvas">

        <?php
            // Show the cart with a non-interactive template
            perch_shop_cart([
                'template'=>'cart/cart_static.html'
            ]);

            perch_shop_order_address_form();
        ?>

            <div class="content  clear  row">
                <?php
                    // Display the form with the T&Cs checkbox
                    // perch_shop_form('checkout/confirm.html');
                    perch_shop_payment_form('stripe');
                    //perch_shop_payment_form('paypal-express');
                ?>

                <a href="/shop/paypal-payment">Pay with paypal</a>

            </div>

        <?php
            // Include the footer. You can find this in tempates/layouts/global
            perch_layout('global/footer');
        ?>

    </div> <!-- Closes Canvas Div -->

    <script src="/assets/build/js/main.min.js"></script>

</body>
</html>

So this page has the stripe details, but there is a button added saying "Pay with PayPal" if a user clicks this link they will be taken to a new page with the paypal settings:

<?php

    if (!perch_member_logged_in()) {
        PerchSystem::redirect('/shop/register');
    }

    PerchUtil::hold_redirects();

    $url = "https://$_SERVER[HTTP_HOST]";

    // your 'success' and 'failure' URLs
    $return_url = $url.'/shop/result';
    $cancel_url = $url.'/bookings';

    if (perch_member_logged_in()) {

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

    }
?>

Would this be the correct way of doing this? I would welcome any suggestions on this approach or any other approach to make it better.

Thanks

Hi,

I have done this, which keeps everything on the one page:

https://forum.grabaperch.com/forum/11-01-2016-multiple-payment-options?page=1#reply-41890

Cheers Mike, I will give that a go now.

That worked. Cheers for the help Mike