Forum

Thread tagged as: Problem, Shop

Paypal Express Checkout

Hi Guys

I have a bit of a problem with Paypal Checkout within the shop. I have setup the API details in shop.php. When I call the perch_shop_checkout() function on the checkout page it just goes straight to the URL I set as the $cancel_url.

As the page is forwarding I am not getting errors displayed. Is it the perch_shop_checkout() that is doing the forwading? Or is it making a call to Paypal and they are rejecting and forwarding to the $cancel_url?

Daniel Ruffle

Daniel Ruffle 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Good question. Turn on debug, and add this before perch_shop_checkout():

PerchUtil::hold_redirects();

What does debug say?

Ahh I see lots of red now!

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] => xxxxx
                            [password] => xxxx
                            [signature] => xxxx
                            [testMode] => 
                            [solutionType] => Sole
                            [landingPage] => Billing
                            [brandName] => 
                            [headerImageUrl] => 
                            [logoImageUrl] => 
                            [borderColor] => 
                            [returnUrl] => /payment.php
                            [cancelUrl] => xxxxx
                            [amount] => 55.80
                            [currency] => GBP
                            [transactionId] => 97
                            [clientIp] => xxxx
                            [description] => Order #97
                            [card] => Omnipay\Common\CreditCard Object
                                (
                                    [supported_cards:protected] => Array
                                        (
                                            [visa] => /^4\d{12}(\d{3})?$/
                                            [mastercard] => /^(5[1-5]\d{4}|677189)\d{10}$/
                                            [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] => Daniel
                                                    [shippingFirstName] => Daniel
                                                    [billingLastName] => Ruffle
                                                    [shippingLastName] => Ruffle
                                                    [billingAddress1] => xxxxxxx
                                                    [billingAddress2] => 
                                                    [billingCity] => xxxxx
                                                    [billingPostcode] => xxxxx
                                                    [billingState] => OXON
                                                    [billingCountry] => GB
                                                    [shippingAddress1] => 123 The Road
                                                    [shippingAddress2] => Across the way
                                                    [shippingCity] =>xxxxxxx
                                                    [shippingPostcode] => xxxx
                                                    [shippingState] => OXON
                                                    [shippingCountry] => US
                                                    [billingCompany] => 
                                                    [shippingCompany] => 
                                                    [email] => xxxxx
                                                )

                                        )

                                )

                            [transactionReference] => 97
                        )

                )

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

                        )

                    [userAgent:protected] => Guzzle/3.9.3 curl/7.19.7 PHP/5.6.22
                    [config:Guzzle\Http\Client:private] => Guzzle\Common\Collection Object
                        (
                            [data:protected] => Array
                                (
                                    [curl.options] => Array
                                        (
                                            [78] => 60
                                            [10065] => xxxxxxx/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 #210
                                            [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
                                (
                                    [PATH] => /usr/local/bin:/usr/bin:/bin
                                    [REDIRECT_STATUS] => 200
                                    [UNIQUE_ID] => V1bmlH8AAAEAAHPla5QAAAAW
                                    [SCRIPT_URL] => /checkout.php
                                    [SCRIPT_URI] => xxxxxxxx
                                    [PP_CUSTOM_PHP_INI] =>xxxx
                                    [PP_CUSTOM_PHP_CGI_INDEX] => plesk-php56-cgi
                                    [HTTP_HOST] => xxxxxxx
                                    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
                                    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
                                    [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5
                                    [HTTP_ACCEPT_ENCODING] => gzip, deflate
                                    [HTTP_REFERER] => xxxxx
                                    [HTTP_COOKIE] => _ga=GA1.3.1046825602.1438870050; cmsa=1; PHPSESSID=hegaqf6bk6kv501b9r6521hq45; p_m=c31eeb5d78113d48df2cdf360b6a40ed9ded10ca; _gat=1
                                    [HTTP_CONNECTION] => keep-alive
                                    [SERVER_SOFTWARE] => Apache
                                    [SERVER_NAME] => xxxxx
                                    [SERVER_ADDR] => xxxxx
                                    [SERVER_PORT] => 80
                                    [REMOTE_ADDR] =>xxx
                                    [DOCUMENT_ROOT] => xxxxx
                                    [SERVER_ADMIN] => alerts@supportpro.com
                                    [SCRIPT_FILENAME] => xxxxxxxxxxxx
                                    [REMOTE_PORT] => 58706
                                    [REDIRECT_URL] => /checkout.php
                                    [GATEWAY_INTERFACE] => CGI/1.1
                                    [SERVER_PROTOCOL] => HTTP/1.1
                                    [REQUEST_METHOD] => GET
                                    [QUERY_STRING] => 
                                    [REQUEST_URI] => /checkout.php
                                    [SCRIPT_NAME] => /checkout.php
                                    [ORIG_SCRIPT_FILENAME] => /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
                                    [ORIG_PATH_INFO] => /checkout.php
                                    [ORIG_PATH_TRANSLATED] => xxxxxxxxxxxx
                                    [ORIG_SCRIPT_NAME] => /phppath/cgi_wrapper
                                    [PHP_SELF] => /checkout.php
                                    [REQUEST_TIME_FLOAT] => 1465312916.2078
                                    [REQUEST_TIME] => 1465312916
                                )

                        )

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

                        )

                    [cookies] => Symfony\Component\HttpFoundation\ParameterBag Object
                        (
                            [parameters:protected] => Array
                                (
                                    [_ga] => GA1.3.1046825602.1438870050
                                    [cmsa] => 1
                                    [PHPSESSID] => hegaqf6bk6kv501b9r6521hq45
                                    [p_m] => c31eeb5d78113d48df2cdf360b6a40ed9ded10ca
                                    [_gat] => 1
                                )

                        )

                    [headers] => Symfony\Component\HttpFoundation\HeaderBag Object
                        (
                            [headers:protected] => Array
                                (
                                    [host] => Array
                                        (
                                            [0] => xxxxx
                                        )

                                    [user-agent] => Array
                                        (
                                            [0] => Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
                                        )

                                    [accept] => Array
                                        (
                                            [0] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
                                        )

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

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

                                    [referer] => Array
                                        (
                                            [0] =>xxxxx
                                        )

                                    [cookie] => Array
                                        (
                                            [0] => _ga=GA1.3.1046825602.1438870050; cmsa=1; PHPSESSID=hegaqf6bk6kv501b9r6521hq45; p_m=c31eeb5d78113d48df2cdf360b6a40ed9ded10ca; _gat=1
                                        )

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

                                )

                            [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-06-07T15:21:52Z
            [CORRELATIONID] => 1e4709f1882ca
            [ACK] => Failure
            [VERSION] => 119.0
            [BUILD] => 22708556
            [L_ERRORCODE0] => 10471
            [L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details.
            [L_LONGMESSAGE0] => ReturnURL is invalid.
            [L_SEVERITYCODE0] => Error
        )

)

Do you need the rest of the debug?

Further to this and more concerning. I have just received a 'Thank you for your order email' saying that the order is complete. Although it doesn't appear in the orders list in the admin!

This is the rest of the debug

Debug Message
[1] SELECT * FROM perch2_members_sessions WHERE sessionID='c31eeb5d78113d48df2cdf360b6a40ed9ded10ca' AND sessionHttpFootprint='7ed18babfda40d0e519bab7e418663a9561561d5' AND sessionExpires>'2016-06-07 16:21:56' LIMIT 1
User is logged in
[1] SELECT * FROM perch2_pages WHERE pagePath='/checkout.php' LIMIT 1
Holding redirects
[1] SELECT * FROM perch2_shop_cart WHERE cartID=50
[1] SELECT * FROM perch2_shop_cart WHERE cartID=50
Checking out with paypal-express
Member ID: 4
[1] SELECT * FROM perch2_shop_customers WHERE memberID=4
[1] SELECT billingAddress, shippingAddress FROM perch2_shop_cart WHERE billingAddress IS NOT NULL AND cartID=50
[1] SELECT * FROM perch2_shop_addresses WHERE customerID='5' AND orderID IS NULL AND addressSlug='default'
[1] SELECT * FROM perch2_shop_addresses WHERE customerID='5' AND orderID IS NULL AND addressSlug='shipping'
------------------------------ Calculating cart ------------------------------
[1] SELECT * FROM perch2_shop_cart WHERE cartID=50
[1] SELECT * FROM perch2_shop_cart WHERE cartID=50
[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=4
[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=50
[33] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Tax mode: exc
[1] SELECT * FROM perch2_shop_cart_items WHERE cartID=50 ORDER BY itemID ASC
[1] SELECT * FROM perch2_shop_products WHERE productID=1 AND productDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_tax_groups WHERE groupID=1 AND groupDeleted IS NULL LIMIT 1
[1] 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 billingAddress, shippingAddress FROM perch2_shop_cart WHERE billingAddress IS NOT NULL AND cartID=50
[1] SELECT z.* FROM perch2_shop_shipping_zones z LEFT JOIN perch2_shop_shipping_zone_countries c ON z.zoneID=c.zoneID WHERE z.zoneActive=1 AND z.zoneDeleted IS NULL AND (c.countryID=236 OR zoneIsDefault=1) ORDER BY zoneIsDefault ASC LIMIT 1
[4] SELECT * FROM perch2_shop_shippings WHERE shippingDeleted IS NULL
[1] SELECT * FROM perch2_shop_shipping_zones WHERE zoneDeleted IS NULL AND zoneActive=1 AND zoneID IN (1)
[1] SELECT rateID AS id, rateTitle AS title, rateValue AS rate, locationID FROM perch2_shop_tax_rates WHERE rateDeleted IS NULL ORDER BY rateValue DESC
[1] SELECT * FROM perch2_shop_shipping_zones WHERE zoneDeleted IS NULL AND zoneActive=1 AND zoneID IN (1)
[1] SELECT * FROM perch2_shop_shipping_zones WHERE zoneDeleted IS NULL AND zoneActive=1 AND zoneID IN (1)
[1] SELECT * FROM perch2_shop_shipping_zones WHERE zoneDeleted IS NULL AND zoneActive=1 AND zoneID IN (1)
Rejecting shipping method ‘UK Freight Items’ because: cart weight is less than min shipping weight
Qualifying shipping method ‘UK Large Items’
Rejecting shipping method ‘UK Medium Items’ because: cart weight is greater than the max
Rejecting shipping method ‘UK Small Items’ because: cart weight is greater than the max
[1] SELECT * FROM perch2_shop_shippings WHERE shippingID='4' AND shippingDeleted IS NULL LIMIT 1
Using shipping zone: United Kingdom
[1] SELECT * FROM perch2_shop_tax_groups WHERE groupID=1 AND groupDeleted IS NULL LIMIT 1
[1] 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
[nil] SELECT * FROM perch2_shop_promotions WHERE promoFrom<='2016-06-07 15:21:00' AND promoTo>'2016-06-07 15:21:00' AND promoActive=1 AND promoDeleted IS NULL ORDER BY promoOrder ASC
[1] SELECT * FROM perch2_shop_cart WHERE cartID=50
[1] SELECT * FROM perch2_shop_cart WHERE cartID=50
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','55.80','47','33.00','6.60',39.6,'13.50','0.00','2.70','0.00','16.20','0.00','0.00',46.5,'9.30',0,0,0,0,NULL,'2.00','2016-06-07 15:21:56','standard','[]','5','4','20.00','42','44')
[1] SELECT * FROM perch2_shop_orders WHERE orderID='97' LIMIT 1
No ids to log.
UPDATE perch2_shop_orders SET orderStatus='created', orderGateway='paypal-express', orderTotal='55.80', currencyID='47', orderItemsSubtotal='33.00', orderItemsTax='6.60', orderItemsTotal=39.6, orderShippingSubtotal='13.50', orderShippingDiscounts='0.00', orderShippingTax='2.70', orderShippingTaxDiscounts='0.00', orderShippingTotal='16.20', orderDiscountsTotal='0.00', orderTaxDiscountsTotal='0.00', orderSubtotal=46.5, orderTaxTotal='9.30', orderItemsRefunded=0, orderTaxRefunded=0, orderShippingRefunded=0, orderTotalRefunded=0, orderTaxID=NULL, orderShippingWeight='2.00', orderCreated='2016-06-07 15:21:56', orderPricing='standard', orderDynamicFields='[]', customerID='5', shippingID='4', orderShippingTaxRate='20.00', orderBillingAddress='42', orderShippingAddress='44', orderUpdated='2016-06-07 16:21:56' WHERE orderID='97'
No ids to log.
[1] SELECT * FROM perch2_shop_addresses WHERE addressID=42
INSERT INTO perch2_shop_addresses(addressTitle,addressSlug,addressFirstName,addressLastName,addressCompany,addressLine1,addressDynamicFields,addressCreated,addressUpdated,addressDeleted,customerID,countryID,regionID,orderID) VALUES('default','default','Daniel','Ruffle','','xxxx','{\"first_name\":\"Daniel\",\"last_name\":\"Ruffle\",\"address_1\":\"xxxx\",\"address_2\":\"\",\"postcode\":\"xxxxx\",\"country\":\"236\",\"company\":\"\",\"city\":\"xxxxx\",\"county\":\"OXON\",\"customer\":\"5\"}','2016-04-05 13:02:12','2016-04-05 13:02:12',NULL,'5','236',NULL,97)
[1] SELECT * FROM perch2_shop_addresses WHERE addressID=44
INSERT INTO perch2_shop_addresses(addressTitle,addressSlug,addressFirstName,addressLastName,addressCompany,addressLine1,addressDynamicFields,addressCreated,addressUpdated,addressDeleted,customerID,countryID,regionID,orderID) VALUES('shipping','shipping','Daniel','Ruffle','Fresh Webs','123 The Road','{\"first_name\":\"Daniel\",\"last_name\":\"Ruffle\",\"address_1\":\"123 The Road\",\"address_2\":\"Across the way\",\"postcode\":\"xxxxx\",\"country\":\"237\",\"company\":\"Fresh Webs\",\"city\":\"xxxx\",\"customer\":\"5\",\"phone\":false,\"county\":\"OXON\",\"instructions\":false,\"addressID\":\"44\",\"r\":\"\\/shop\\/addresses\"}','2016-04-05 13:19:17','2016-06-07 15:39:04',NULL,'5','237',NULL,97)
UPDATE perch2_shop_orders SET orderBillingAddress='198', orderShippingAddress='199', orderUpdated='2016-06-07 16:21:56' WHERE orderID='97'
No ids to log.
INSERT INTO perch2_shop_order_items(itemType,orderID,productID,itemPrice,itemTax,itemTotal,itemQty,itemTaxRate,itemDiscount,itemTaxDiscount) VALUES('product','97','1','16.50','3.30','19.80','2','20.00',0,0)
[1] SELECT * FROM perch2_shop_order_items WHERE itemID='199' LIMIT 1
No ids to log.
UPDATE perch2_shop_order_items SET itemType='product', orderID='97', productID='1', itemPrice='16.50', itemTax='3.30', itemTotal='19.80', itemQty='2', itemTaxRate='20.00', itemDiscount=0, itemTaxDiscount=0 WHERE itemID='199'
No ids to log.
INSERT INTO perch2_shop_order_items(itemType,orderID,shippingID,itemPrice,itemTax,itemTotal,itemQty,itemTaxRate,itemDiscount,itemTaxDiscount) VALUES('shipping','97','4','13.50','2.70','16.20',1,'20.00','0.00','0.00')
[1] SELECT * FROM perch2_shop_order_items WHERE itemID='200' LIMIT 1
No ids to log.
UPDATE perch2_shop_order_items SET itemType='shipping', orderID='97', shippingID='4', itemPrice='13.50', itemTax='2.70', itemTotal='16.20', itemQty=1, itemTaxRate='20.00', itemDiscount='0.00', itemTaxDiscount='0.00' WHERE itemID='200'
No ids to log.
UPDATE perch2_shop_cart_data SET orderID='97' WHERE cartID='50'
INSERT INTO perch2_shop_tax_exhibits(orderID,exhibitType,exhibitDetail,exhibitSource,locationID,countryID,exhibitDate) VALUES(97,'IP_ADDRESS','86.182.88.107','Environment',NULL,NULL,'2016-06-07 15:21:56')
[1] SELECT * FROM perch2_shop_tax_exhibits WHERE exhibitID='97' LIMIT 1
No ids to log.
UPDATE perch2_shop_tax_exhibits SET orderID=97, exhibitType='IP_ADDRESS', exhibitDetail='86.182.88.107', exhibitSource='Environment', locationID=NULL, countryID=NULL, exhibitDate='2016-06-07 15:21:56' WHERE exhibitID='97'
No ids to log.
[1] SELECT * FROM perch2_shop_order_statuses WHERE statusKey='created' AND statusActive=1 AND statusDeleted IS NULL
[1] SELECT * FROM perch2_shop_emails WHERE emailStatus=1 AND emailActive=1
Sending customer email
[1] SELECT * FROM perch2_shop_customers WHERE customerID='5' AND customerDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_members WHERE memberID='4' LIMIT 1
Using email template: /var/www/vhosts/xxxx/httpdocs/siteadmin/templates/shop/emails/order_paid.html (html)
[1] SELECT * FROM perch2_shop_order_statuses WHERE statusKey='created' AND statusDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_addresses WHERE addressID=199 AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='237' LIMIT 1
[1] SELECT * FROM perch2_shop_addresses WHERE addressID=198 AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
[2] SELECT * FROM perch2_shop_order_items WHERE orderID='97' ORDER BY itemID ASC
[1] SELECT * FROM perch2_shop_order_statuses WHERE statusKey='created' AND statusDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_currencies WHERE currencyID=47 LIMIT 1
[1] SELECT * FROM perch2_shop_shippings WHERE shippingID=4 AND shippingDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_products WHERE productID=1 AND productDeleted IS NULL LIMIT 1
Looking up missing property sender_name
Looking up missing property sender_email
Building message with Perch template
[1] Using template: /templates/shop/emails/order_paid.html
Using sub-template: /templates/shop/emails/email.html
Using sub-template: /templates/shop/emails/_email_header.html
[1] Using sub-template: /templates/shop/emails/_email_footer.html
Sent email: "Thank you for your order" to me@me.co.uk
[1] SELECT * FROM perch2_shop_currencies WHERE currencyID='47' LIMIT 1
[1] SELECT * FROM perch2_shop_customers WHERE customerID='5' AND customerDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_addresses WHERE addressID=199 AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_addresses WHERE addressID=198 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='237' LIMIT 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

Under Shop > Emails > Order placed, which status do you have in "Send for status" ?

Ah I see that I have Order paid sending out when the Send for status is Created. Thank you that one is sorted.

It looks like from the errors above that it may be Paypal rejecting the connection?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It says ReturnURL is invalid

What value are you setting for the return URL?

I had the ReturnURL as relative! Thank you again for your excellent support.