Forum

Thread tagged as: Problem, Error, Shop

Payment says failed but was sucsessfull

Hi All

My paypal payments keep failing but they not

this is my thank you page

<?php include('../perch/runtime.php');?>
<?php perch_shop_complete_payment('paypal-express');?>
<?php perch_layout('header'); ?>
<?php perch_content('Title Image'); ?>
<div id="caption-pager" class="caption-pager">
    <?php perch_layout('pager'); ?>
</div>
<div class="row">
<?php
if (perch_shop_order_successful()) {
    echo '<h1>Thank you for your order!</h1>';
    perch_form('photoComp.html');
}else{
    echo '<h1>Sorry Your Payment Has Failed!</h1>';
} ?>
</div>
<?php perch_layout('footer'); ?>
<?php PerchUtil::output_debug(); ?>

but debug says payment sucsessfull

Anthony Elleray

Anthony Elleray 2 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Hi Anthony

As with your original thread about the same issue we're unable to help because we don't have information from you that enables us to help. This isn't happening to everyone so we need you to go through a debugging process to find out what is triggering that error.

If you can isolate under what conditions the error occurs then we can most likely help, we can't however do that debugging for you.

Rachel

its happening all the time

normal paypal checkout item is £5 login to paypal sandbox make payment i get sent back

debug is green and says payment successful

but the

if (perch_shop_order_successful()) {

is not working

Full Debug

Debug Message
[1] SELECT * FROM perch2_pages WHERE pagePath='/shop/thankyou.php' LIMIT 1
[1] SELECT * FROM perch2_shop_cart WHERE cartID=2
[1] SELECT * FROM perch2_shop_cart WHERE cartID=2
[25] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/shop/thankyou.php' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-009-003', '000-009', '000') ORDER BY pageTreePosition DESC
Using template: /templates/navigation/level1.html
[3] Using template: /templates/navigation/level2.html
[4] Using template: /templates/navigation/level2.html
Using template: /templates/navigation/level2.html
[11] Using template: /templates/navigation/level3.html
[25] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/shop/thankyou.php' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-009-003', '000-009', '000') ORDER BY pageTreePosition DESC
Using template: /templates/navigation/off_canvas.html
[3] Using template: /templates/navigation/off_canvas_lvl1.html
[4] Using template: /templates/navigation/off_canvas_lvl1.html
[11] Using template: /templates/navigation/off_canvas_lvl1.html
[7] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/shop/thankyou.php' OR regionPage='*' ORDER BY regionPage DESC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/shop/thankyou.php' OR pageSortPath='/shop/thankyou.php' LIMIT 1
[1] SELECT * FROM perch2_pages WHERE pageHidden=0 AND pageNew=0 AND pageTreePosition IN ('000-009-003', '000-009', '000') ORDER BY pageTreePosition
[1] Using template: /templates/navigation/breadcrumbs.html
Runtime complete_payment for paypal-express
[1] SELECT * FROM perch2_shop_orders WHERE orderGatewayRef='EC-3AD96759UD206610P' AND orderDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_currencies WHERE currencyID='47' LIMIT 1
Payment successful
UPDATE perch2_shop_orders SET orderGatewayRef='45U64965J2637800Y', orderUpdated='2016-08-09 11:02:13' WHERE orderID='329'
No ids to log.
Omnipay\PayPal\Message\Response Object
(
    [request:protected] => Omnipay\PayPal\Message\ExpressCompletePurchaseRequest 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] => paypaltest_api1.designthebox.co.uk
                            [password] => VFMZM2HQX92GSKWB
                            [signature] => ASyonluZdnNUQ-jstYWn6uwEVPygA1qQGicydFrH4.iFXXcJeQYqtWhp
                            [testMode] => 1
                            [solutionType] => Sole
                            [landingPage] => Billing
                            [brandName] => 
                            [headerImageUrl] => 
                            [logoImageUrl] => 
                            [borderColor] => 
                            [token] => EC-3AD96759UD206610P
                            [payerID] => CJKVLXCQNVYLG
                            [amount] => 12.50
                            [currency] => GBP
                            [transactionReference] => 329
                        )

                )

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

                        )

                    [userAgent:protected] => Guzzle/3.9.3 curl/7.41.0 PHP/5.6.22
                    [config:Guzzle\Http\Client:private] => Guzzle\Common\Collection Object
                        (
                            [data:protected] => Array
                                (
                                    [curl.options] => Array
                                        (
                                            [78] => 60
                                            [10065] => /var/sites/s/swanagelifeboat.org.uk/public_html/perch/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 #188
                                            [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
                                (
                                    [token] => EC-3AD96759UD206610P
                                    [PayerID] => CJKVLXCQNVYLG
                                )

                        )

                    [server] => Symfony\Component\HttpFoundation\ServerBag Object
                        (
                            [parameters:protected] => Array
                                (
                                    [DOCUMENT_ROOT] => /var/sites/s/swanagelifeboat.org.uk/public_html
                                    [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-GB,en-US;q=0.8,en;q=0.6
                                    [HTTP_CONNECTION] => close
                                    [HTTP_COOKIE] => p_m=; _gat=1; PHPSESSID=3bdcc587b344f039b355fae81547d4df; _ga=GA1.3.6157684.1469120874
                                    [HTTP_HOST] => swanagelifeboat.org.uk
                                    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1
                                    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
                                    [HTTP_X_FORWARDED_FOR] => 94.192.120.84
                                    [PATH] => /bin
                                    [QUERY_STRING] => token=EC-3AD96759UD206610P&PayerID=CJKVLXCQNVYLG
                                    [REDIRECT_QUERY_STRING] => token=EC-3AD96759UD206610P&PayerID=CJKVLXCQNVYLG
                                    [REDIRECT_STATUS] => 200
                                    [REDIRECT_URL] => /shop/thankyou
                                    [REMOTE_ADDR] => 94.192.120.84
                                    [REMOTE_PORT] => 53153
                                    [REQUEST_METHOD] => GET
                                    [REQUEST_URI] => /shop/thankyou?token=EC-3AD96759UD206610P&PayerID=CJKVLXCQNVYLG
                                    [SCRIPT_FILENAME] => /var/sites/s/swanagelifeboat.org.uk/public_html/shop/thankyou.php
                                    [SCRIPT_NAME] => /shop/thankyou.php
                                    [SERVER_ADDR] => 10.168.1.130
                                    [SERVER_ADMIN] => you@example.com
                                    [SERVER_NAME] => swanagelifeboat.org.uk
                                    [SERVER_PORT] => 80
                                    [SERVER_PROTOCOL] => HTTP/1.1
                                    [SERVER_SIGNATURE] => 
                                    [SERVER_SOFTWARE] => Apache
                                    [PHP_SELF] => /shop/thankyou.php
                                    [REQUEST_TIME_FLOAT] => 1470736926.97
                                    [REQUEST_TIME] => 1470736926
                                    [argv] => Array
                                        (
                                            [0] => token=EC-3AD96759UD206610P&PayerID=CJKVLXCQNVYLG
                                        )

                                    [argc] => 1
                                )

                        )

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

                        )

                    [cookies] => Symfony\Component\HttpFoundation\ParameterBag Object
                        (
                            [parameters:protected] => Array
                                (
                                    [p_m] => 
                                    [_gat] => 1
                                    [PHPSESSID] => 3bdcc587b344f039b355fae81547d4df
                                    [_ga] => GA1.3.6157684.1469120874
                                )

                        )

                    [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-GB,en-US;q=0.8,en;q=0.6
                                        )

                                    [connection] => Array
                                        (
                                            [0] => close
                                        )

                                    [cookie] => Array
                                        (
                                            [0] => p_m=; _gat=1; PHPSESSID=3bdcc587b344f039b355fae81547d4df; _ga=GA1.3.6157684.1469120874
                                        )

                                    [host] => Array
                                        (
                                            [0] => swanagelifeboat.org.uk
                                        )

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

                                    [user-agent] => Array
                                        (
                                            [0] => Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
                                        )

                                    [x-forwarded-for] => Array
                                        (
                                            [0] => 94.192.120.84
                                        )

                                )

                            [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\Response Object
 *RECURSION*
            [zeroAmountAllowed:protected] => 1
            [negativeAmountAllowed:protected] => 
        )

    [data:protected] => Array
        (
            [TOKEN] => EC-3AD96759UD206610P
            [SUCCESSPAGEREDIRECTREQUESTED] => false
            [TIMESTAMP] => 2016-08-09T10:02:12Z
            [CORRELATIONID] => 1eee5c953f5fe
            [ACK] => Success
            [VERSION] => 119.0
            [BUILD] => 000000
            [INSURANCEOPTIONSELECTED] => false
            [SHIPPINGOPTIONISDEFAULT] => false
            [PAYMENTINFO_0_TRANSACTIONID] => 45U64965J2637800Y
            [PAYMENTINFO_0_TRANSACTIONTYPE] => expresscheckout
            [PAYMENTINFO_0_PAYMENTTYPE] => instant
            [PAYMENTINFO_0_ORDERTIME] => 2016-08-09T10:02:12Z
            [PAYMENTINFO_0_AMT] => 12.50
            [PAYMENTINFO_0_FEEAMT] => 0.63
            [PAYMENTINFO_0_TAXAMT] => 0.00
            [PAYMENTINFO_0_CURRENCYCODE] => GBP
            [PAYMENTINFO_0_PAYMENTSTATUS] => Completed
            [PAYMENTINFO_0_PENDINGREASON] => None
            [PAYMENTINFO_0_REASONCODE] => None
            [PAYMENTINFO_0_PROTECTIONELIGIBILITY] => Eligible
            [PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE] => ItemNotReceivedEligible,UnauthorizedPaymentEligible
            [PAYMENTINFO_0_SECUREMERCHANTACCOUNTID] => UV9M3NSKXNZNQ
            [PAYMENTINFO_0_ERRORCODE] => 0
            [PAYMENTINFO_0_ACK] => Success
        )

)
UPDATE perch2_shop_orders_meta SET metaValue=last_insert_id(metaValue+1) WHERE id='last_invoice_number'
[1] SELECT last_insert_id()
[42] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
UPDATE perch2_shop_orders SET orderInvoiceNumber='Invoice15', orderUpdated='2016-08-09 11:02:13' WHERE orderID='329'
No ids to log.
Setting order status to paid
UPDATE perch2_shop_orders SET orderDynamicFields='{\"status\":\"paid\"}', orderStatus='paid', orderUpdated='2016-08-09 11:02:13' WHERE orderID='329'
No ids to log.
Array
(
    [country] => GB
)
[1] SELECT * FROM perch2_shop_countries WHERE iso2='GB' LIMIT 1
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationDeleted IS NULL AND ((countryID=236 AND regionID IS NULL) OR locationIsDefault=1) ORDER BY locationIsDefault ASC LIMIT 1
INSERT INTO perch2_shop_tax_exhibits(orderID,exhibitType,exhibitDetail,exhibitSource,locationID,countryID,exhibitDate) VALUES(329,'CARD_ADDRESS','GB','PayPal_Express','1','236','2016-08-09 10:02:14')
[1] SELECT * FROM perch2_shop_tax_exhibits WHERE exhibitID='15' LIMIT 1
No ids to log.
UPDATE perch2_shop_tax_exhibits SET orderID=329, exhibitType='CARD_ADDRESS', exhibitDetail='GB', exhibitSource='PayPal_Express', locationID='1', countryID='236', exhibitDate='2016-08-09 10:02:14' WHERE exhibitID='15'
No ids to log.
[1] SELECT * FROM perch2_shop_addresses WHERE addressID='16' AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationDeleted IS NULL AND ((countryID=0 AND regionID IS NULL) OR locationIsDefault=1) ORDER BY locationIsDefault ASC LIMIT 1
Looking up missing property address_1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
No country set for address
Looking up missing property address_2
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
No country set for address
Looking up missing property city
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
No country set for address
Looking up missing property county
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
No country set for address
Looking up missing property postcode
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
No country set for address
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
INSERT INTO perch2_shop_tax_exhibits(orderID,exhibitType,exhibitDetail,exhibitSource,locationID,countryID,exhibitDate) VALUES(329,'BILL_ADDRESS',', ','Customer','1','0','2016-08-09 10:02:14')
[1] SELECT * FROM perch2_shop_tax_exhibits WHERE exhibitID='16' LIMIT 1
No ids to log.
UPDATE perch2_shop_tax_exhibits SET orderID=329, exhibitType='BILL_ADDRESS', exhibitDetail=', ', exhibitSource='Customer', locationID='1', countryID='0', exhibitDate='2016-08-09 10:02:14' WHERE exhibitID='16'
No ids to log.
[1] SELECT * FROM perch2_shop_addresses WHERE addressID='17' AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationDeleted IS NULL AND ((countryID=0 AND regionID IS NULL) OR locationIsDefault=1) ORDER BY locationIsDefault ASC LIMIT 1
Looking up missing property address_1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
No country set for address
Looking up missing property address_2
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
No country set for address
Looking up missing property city
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
No country set for address
Looking up missing property county
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
No country set for address
Looking up missing property postcode
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
No country set for address
[1] SELECT * FROM perch2_shop_countries WHERE countryID='0' LIMIT 1
INSERT INTO perch2_shop_tax_exhibits(orderID,exhibitType,exhibitDetail,exhibitSource,locationID,countryID,exhibitDate) VALUES(329,'SHIP_ADDRESS',', ','Customer','1','0','2016-08-09 10:02:14')
[1] SELECT * FROM perch2_shop_tax_exhibits WHERE exhibitID='17' LIMIT 1
No ids to log.
UPDATE perch2_shop_tax_exhibits SET orderID=329, exhibitType='SHIP_ADDRESS', exhibitDetail=', ', exhibitSource='Customer', locationID='1', countryID='0', exhibitDate='2016-08-09 10:02:14' WHERE exhibitID='17'
No ids to log.
[1] SELECT * FROM perch2_shop_order_statuses WHERE statusKey='paid' AND statusActive=1 AND statusDeleted IS NULL
[nil] SELECT * FROM perch2_shop_emails WHERE emailStatus=3 AND emailActive=1
[1] SELECT p.*, oi.itemQty FROM perch2_shop_order_items oi, perch2_shop_products p WHERE oi.productID = p.productID AND oi.orderID='329'
[1] SELECT * FROM perch2_shop_customers WHERE customerID='1' AND customerDeleted IS NULL LIMIT 1
UPDATE perch2_shop_products SET stock_level=0, productUpdated='2016-08-09 11:02:14' WHERE productID='1'
No ids to log.
[nil] SELECT * FROM perch2_shop_product_tags WHERE productID=1 AND tagDeleted IS NULL ORDER BY tagOrder ASC
[1] SELECT * FROM perch2_shop_currencies WHERE currencyActive=1 AND currencyID=47
UPDATE perch2_shop_orders SET orderExchangeRate=1, orderUpdated='2016-08-09 11:02:14' WHERE orderID='329'
No ids to log.
Rachel Andrew

Rachel Andrew 394 points
Perch Support

This is not happening to everyone who uses PayPal to take payments, so there is something specific in terms of what you are doing. It may be that there is something we can do to make that case easier once we know what the problem actually is, at the moment I have no way of knowing.

We really want to help you, but you do need to be able to get some sort of reduced test case in place to isolate where the problem is happening. If that isn't something you are able to do then you are going to need to get someone to help you who can do that, it's over and above what we can do in free support.

sorry i just dont know how i can be more specific

its every transaction i try

there is only two products and happens with both

i get same result with both sanbox and live paypal

on a live server and wamp

Rachel Andrew

Rachel Andrew 394 points
Perch Support

You need to isolate what is happening, there isn't anything we can do with such vague information. We haven't even been able to ascertain if this has anything to do with Perch so far.

Im Creating a fresh website

New Database New Perch Download New Shop Download

hopfully try figure out the issues

Ok so i have created a fresh website

https://myboxproject.co.uk/shop/

New DB Fresh Download files

/shop/index.php

<?php include('../perch/runtime.php'); ?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Perch Example Page</title>
    <?php perch_get_css(); ?>
</head>
<body>
<?php perch_shop_products(); ?>
<?php perch_get_javascript(); ?>
</body>
</html>
<?php PerchUtil::output_debug(); ?>

cart.php

<?php include('../perch/runtime.php'); ?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Perch Example Page</title>
    <?php perch_get_css(); ?>
</head>
<body>
<?php perch_shop_cart(); ?>
<?php perch_get_javascript(); ?>
</body>
</html>
<?php PerchUtil::output_debug(); ?>

checkout.php

<?php include('../perch/runtime.php'); ?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Perch Example Page</title>
    <?php perch_get_css(); ?>
</head>
<body>
<?php
  if (!perch_member_logged_in()) {
    // Returning customer login form
    perch_shop_login_form();

    // New customer sign up form
    perch_shop_registration_form();
  } else {
     echo '<a href="/shop/payment">Pay now</a>';
  }
?>
<?php perch_get_javascript(); ?>
</body>
</html>
<?php PerchUtil::output_debug(); ?>

payment.php

<?php include('../perch/runtime.php'); ?>
<?php
if (perch_member_logged_in()) {
PerchUtil::hold_redirects();
  // your 'success' return URL
  $return_url = 'https://myboxproject.dev/shop/thanks';
  $cancel_url = 'https://myboxproject.dev/';

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

?>
<?php PerchUtil::output_debug(); ?>

Thanks.php

<?php include('../perch/runtime.php'); ?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Perch Example Page</title>
    <?php perch_get_css(); ?>
</head>
<body>
<?php
  perch_shop_complete_payment('paypal-express');

  if (perch_shop_order_successful()) {
      echo '<h1>Thank you for your order!</h1>';
    }else{
      echo '<h1>Sorry!</h1>';
    }
?>
<?php perch_get_javascript(); ?>
</body>
</html>
<?php PerchUtil::output_debug(); ?>

Its all per the instructions on the documentation Payments in the debug are successful

but the thanks page says Sorry!

there has to be either a paypal or perch issue here this is by the book fresh setup

Even a new PayPal Sandbox account

Perch: 2.8.31
Production mode: Production (100)
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_shop_orders (PERCH_SHOP_VERSION), perch_shop_products (1.0.6), perch_shop (1.0.6), perch_members (1.5)
DB driver: PDO
DB tables: perch2_categories (1), perch2_category_counts (0), perch2_category_sets (1), perch2_content_index (0), perch2_content_items (0), perch2_content_regions (0), perch2_members (1), perch2_members_forms (1), perch2_members_member_tags (0), perch2_members_sessions (2), perch2_members_tags (0), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (0), perch2_pages (0), perch2_resource_log (0), perch2_resource_tags (0), perch2_resources (0), perch2_resources_to_tags (0), perch2_settings (24), perch2_shop_addresses (104), perch2_shop_admin_index (30), perch2_shop_brands (1), perch2_shop_cart (1), perch2_shop_cart_data (6), perch2_shop_cart_items (1), perch2_shop_countries (250), perch2_shop_currencies (152), perch2_shop_customers (1), perch2_shop_emails (1), perch2_shop_index (63), perch2_shop_option_values (0), perch2_shop_options (0), perch2_shop_order_items (51), perch2_shop_order_promotions (0), perch2_shop_order_statuses (9), perch2_shop_orders (51), perch2_shop_orders_meta (0), perch2_shop_product_files (0), perch2_shop_product_option_values (0), perch2_shop_product_options (0), perch2_shop_product_tags (0), perch2_shop_products (1), perch2_shop_promotions (0), perch2_shop_search (1), perch2_shop_shipping_zone_countries (1), perch2_shop_shipping_zones (1), perch2_shop_shippings (1), perch2_shop_tax_exhibits (54), perch2_shop_tax_group_rates (1), perch2_shop_tax_groups (1), perch2_shop_tax_locations (1), perch2_shop_tax_rates (1), perch2_shop_variants (0), perch2_user_passwords (0), perch2_user_privileges (65), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (1)
Users: 1
App runtimes:
<?php
    $apps_list = array(
        'content',
        'categories',
        'perch_members',
        'perch_shop',
    );
Editor plug-ins: markitup
H1: c82ecf56f5cca66d13c35c0aab48914f
L1: d65faed3aa447ca1826c6356b93ece7a
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.31: done
latest_version: 2.8.15
on_sale_version: 2.8.31
perch_shop_update: 1.0.6
headerScheme: light
perch_members_login_page: /members/login.php?r={returnURL}
perch_shop_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
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_members_update: 1.4
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: myboxpro_project
PERCH_DB_SERVER: 10.169.0.112
PERCH_DB_DATABASE: myboxpro_project
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: a.elleray1182@gmail.com
PERCH_EMAIL_FROM_NAME: Anthony Elleray
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/sites/m/myboxproject.co.uk/public_html/perch
PERCH_CORE: /var/sites/m/myboxproject.co.uk/public_html/perch/core
PERCH_RESFILEPATH: /var/sites/m/myboxproject.co.uk/public_html/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_DEBUG: 1
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /var/sites/m/myboxproject.co.uk/public_html/perch/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.6
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS

PHP: 5.5.26
Zend: 2.5.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 15d5c781cfcad91193dceae1d2cdd127674ddb3e $
MySQL server: 5.7.14
Free disk space: 32.99 TB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, session, json, ldap, mbstring, mcrypt, mssql, standard, mysql, mysqlnd, mysqli, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, memcache, geoip, mhash, ionCube Loader
GD: Yes
ImageMagick: No
PHP max upload size: 100M
PHP max form post size: 100M
PHP memory limit: 128M
Total max uploadable file size: 100M
Resource folder writeable: Yes
Session timeout: 240 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
DOCUMENT_ROOT: /var/sites/m/myboxproject.co.uk/public_html
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-GB,en-US;q=0.8,en;q=0.6
HTTP_CONNECTION: close
HTTP_COOKIE: p_m=18189af9250f81013b880723d93543766ea7dc51; cmsa=1; PHPSESSID=86f10d255b919d7e64efd1faeb05ca72
HTTP_HOST: myboxproject.co.uk
HTTP_REFERER: https://myboxproject.co.uk/perch/core/settings/diagnostics/
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
HTTP_X_FORWARDED_FOR: 94.192.120.84
PATH: /bin
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 94.192.120.84
REMOTE_PORT: 45109
REQUEST_METHOD: GET
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /var/sites/m/myboxproject.co.uk/public_html/perch/core/settings/diagnostics/index.php
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
SERVER_ADDR: 10.170.0.15
SERVER_ADMIN: you@example.com
SERVER_NAME: myboxproject.co.uk
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Apache
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1470850811.54
REQUEST_TIME: 1470850811
argc: 1
Sorry!

Debug Message
[1] SELECT * FROM perch2_members_sessions WHERE sessionID='2607b429d3c95e8196568277197bdbe81ffcd94d' AND sessionHttpFootprint='c2ad529b65534f80670902c3bb12809f98ae644e' AND sessionExpires>'2016-08-10 18:42:05' LIMIT 1
User is logged in
[1] SELECT * FROM perch2_pages WHERE pagePath='/shop/thanks.php' LIMIT 1
[1] SELECT * FROM perch2_shop_cart WHERE cartID=1
[1] SELECT * FROM perch2_shop_cart WHERE cartID=1
Runtime complete_payment for paypal-express
[1] SELECT * FROM perch2_shop_orders WHERE orderGatewayRef='EC-86499553284225536' AND orderDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_currencies WHERE currencyID='47' LIMIT 1
Payment successful
UPDATE perch2_shop_orders SET orderGatewayRef='6V89806103320931X', orderUpdated='2016-08-10 18:42:33' WHERE orderID='52'
No ids to log.
Omnipay\PayPal\Message\Response Object
(
    [request:protected] => Omnipay\PayPal\Message\ExpressCompletePurchaseRequest 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] => payments_api1.myboxproject.co.uk
                            [password] => WR7B6YVAQDE44XME
                            [signature] => AFcWxV21C7fd0v3bYYYRCpSSRl31ABoIWgqO3XoHUfBKxtC2I48k5gPb
                            [testMode] => 1
                            [solutionType] => Sole
                            [landingPage] => Billing
                            [brandName] => 
                            [headerImageUrl] => 
                            [logoImageUrl] => 
                            [borderColor] => 
                            [token] => EC-86499553284225536
                            [payerID] => CJKVLXCQNVYLG
                            [amount] => 840.00
                            [currency] => GBP
                            [transactionReference] => 52
                        )

                )

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

                        )

                    [userAgent:protected] => Guzzle/3.9.3 curl/7.42.1 PHP/5.6.16
                    [config:Guzzle\Http\Client:private] => Guzzle\Common\Collection Object
                        (
                            [data:protected] => Array
                                (
                                    [curl.options] => Array
                                        (
                                            [78] => 60
                                            [10065] => C:\wamp64\www\myboxproject\perch\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 #143
                                            [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
                                (
                                    [token] => EC-86499553284225536
                                    [PayerID] => CJKVLXCQNVYLG
                                )

                        )

                    [server] => Symfony\Component\HttpFoundation\ServerBag Object
                        (
                            [parameters:protected] => Array
                                (
                                    [HTTP_HOST] => myboxproject.dev
                                    [HTTP_CONNECTION] => keep-alive
                                    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1
                                    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
                                    [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-GB,en-US;q=0.8,en;q=0.6
                                    [HTTP_COOKIE] => cmsa=1; p_m=2607b429d3c95e8196568277197bdbe81ffcd94d; PHPSESSID=iqg49e2nlvcc0sd1tptpefuaa2
                                    [PATH] => C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
                                    [SystemRoot] => C:\WINDOWS
                                    [COMSPEC] => C:\WINDOWS\system32\cmd.exe
                                    [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
                                    [WINDIR] => C:\WINDOWS
                                    [SERVER_SIGNATURE] => 
Apache/2.4.17 (Win64) PHP/5.6.16 Server at myboxproject.dev Port 80


                                    [SERVER_SOFTWARE] => Apache/2.4.17 (Win64) PHP/5.6.16
                                    [SERVER_NAME] => myboxproject.dev
                                    [SERVER_ADDR] => 192.168.1.4
                                    [SERVER_PORT] => 80
                                    [REMOTE_ADDR] => 192.168.1.60
                                    [DOCUMENT_ROOT] => C:/wamp64/www/myboxproject
                                    [REQUEST_SCHEME] => http
                                    [CONTEXT_PREFIX] => 
                                    [CONTEXT_DOCUMENT_ROOT] => C:/wamp64/www/myboxproject
                                    [SERVER_ADMIN] => admin@example.com
                                    [SCRIPT_FILENAME] => C:/wamp64/www/myboxproject/shop/thanks.php
                                    [REMOTE_PORT] => 51171
                                    [GATEWAY_INTERFACE] => CGI/1.1
                                    [SERVER_PROTOCOL] => HTTP/1.1
                                    [REQUEST_METHOD] => GET
                                    [QUERY_STRING] => token=EC-86499553284225536&PayerID=CJKVLXCQNVYLG
                                    [REQUEST_URI] => /shop/thanks?token=EC-86499553284225536&PayerID=CJKVLXCQNVYLG
                                    [SCRIPT_NAME] => /shop/thanks.php
                                    [PHP_SELF] => /shop/thanks.php
                                    [REQUEST_TIME_FLOAT] => 1470850925.569
                                    [REQUEST_TIME] => 1470850925
                                )

                        )

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

                        )

                    [cookies] => Symfony\Component\HttpFoundation\ParameterBag Object
                        (
                            [parameters:protected] => Array
                                (
                                    [cmsa] => 1
                                    [p_m] => 2607b429d3c95e8196568277197bdbe81ffcd94d
                                    [PHPSESSID] => iqg49e2nlvcc0sd1tptpefuaa2
                                )

                        )

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

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

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

                                    [user-agent] => Array
                                        (
                                            [0] => Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
                                        )

                                    [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-GB,en-US;q=0.8,en;q=0.6
                                        )

                                    [cookie] => Array
                                        (
                                            [0] => cmsa=1; p_m=2607b429d3c95e8196568277197bdbe81ffcd94d; PHPSESSID=iqg49e2nlvcc0sd1tptpefuaa2
                                        )

                                )

                            [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\Response Object
 *RECURSION*
            [zeroAmountAllowed:protected] => 1
            [negativeAmountAllowed:protected] => 
        )

    [data:protected] => Array
        (
            [TOKEN] => EC-86499553284225536
            [SUCCESSPAGEREDIRECTREQUESTED] => false
            [TIMESTAMP] => 2016-08-10T17:42:34Z
            [CORRELATIONID] => df068503f18d
            [ACK] => Success
            [VERSION] => 119.0
            [BUILD] => 24362847
            [INSURANCEOPTIONSELECTED] => false
            [SHIPPINGOPTIONISDEFAULT] => false
            [PAYMENTINFO_0_TRANSACTIONID] => 6V89806103320931X
            [PAYMENTINFO_0_TRANSACTIONTYPE] => expresscheckout
            [PAYMENTINFO_0_PAYMENTTYPE] => instant
            [PAYMENTINFO_0_ORDERTIME] => 2016-08-10T17:42:33Z
            [PAYMENTINFO_0_AMT] => 840.00
            [PAYMENTINFO_0_FEEAMT] => 28.76
            [PAYMENTINFO_0_TAXAMT] => 0.00
            [PAYMENTINFO_0_CURRENCYCODE] => GBP
            [PAYMENTINFO_0_PAYMENTSTATUS] => Completed
            [PAYMENTINFO_0_PENDINGREASON] => None
            [PAYMENTINFO_0_REASONCODE] => None
            [PAYMENTINFO_0_PROTECTIONELIGIBILITY] => Eligible
            [PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE] => ItemNotReceivedEligible,UnauthorizedPaymentEligible
            [PAYMENTINFO_0_SECUREMERCHANTACCOUNTID] => EKVP5TAQWMNK2
            [PAYMENTINFO_0_ERRORCODE] => 0
            [PAYMENTINFO_0_ACK] => Success
        )

)
UPDATE perch2_shop_orders_meta SET metaValue=last_insert_id(metaValue+1) WHERE id='last_invoice_number'
[1] SELECT last_insert_id()
[24] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
UPDATE perch2_shop_orders SET orderInvoiceNumber='Invoice0', orderUpdated='2016-08-10 18:42:34' WHERE orderID='52'
No ids to log.
Setting order status to paid
UPDATE perch2_shop_orders SET orderDynamicFields='{\"status\":\"paid\"}', orderStatus='paid', orderUpdated='2016-08-10 18:42:34' WHERE orderID='52'
No ids to log.
Array
(
    [country] => GB
)
[1] SELECT * FROM perch2_shop_countries WHERE iso2='GB' LIMIT 1
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationDeleted IS NULL AND ((countryID=236 AND regionID IS NULL) OR locationIsDefault=1) ORDER BY locationIsDefault ASC LIMIT 1
INSERT INTO perch2_shop_tax_exhibits(orderID,exhibitType,exhibitDetail,exhibitSource,locationID,countryID,exhibitDate) VALUES(52,'CARD_ADDRESS','GB','PayPal_Express','1','236','2016-08-10 17:42:35')
[1] SELECT * FROM perch2_shop_tax_exhibits WHERE exhibitID='56' LIMIT 1
No ids to log.
UPDATE perch2_shop_tax_exhibits SET orderID=52, exhibitType='CARD_ADDRESS', exhibitDetail='GB', exhibitSource='PayPal_Express', locationID='1', countryID='236', exhibitDate='2016-08-10 17:42:35' WHERE exhibitID='56'
No ids to log.
[1] SELECT * FROM perch2_shop_addresses WHERE addressID='105' AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationDeleted IS NULL AND ((countryID=236 AND regionID IS NULL) OR locationIsDefault=1) ORDER BY locationIsDefault ASC LIMIT 1
Looking up missing property address_1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
Looking up missing property address_2
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
Looking up missing property city
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
Looking up missing property county
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
Looking up missing property postcode
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
INSERT INTO perch2_shop_tax_exhibits(orderID,exhibitType,exhibitDetail,exhibitSource,locationID,countryID,exhibitDate) VALUES(52,'BILL_ADDRESS','Flat 5 Richmond Lodge, 6 Victoria Avenue, Swanage, Dorset, BH191AN, United Kingdom','Customer','1','236','2016-08-10 17:42:35')
[1] SELECT * FROM perch2_shop_tax_exhibits WHERE exhibitID='57' LIMIT 1
No ids to log.
UPDATE perch2_shop_tax_exhibits SET orderID=52, exhibitType='BILL_ADDRESS', exhibitDetail='Flat 5 Richmond Lodge, 6 Victoria Avenue, Swanage, Dorset, BH191AN, United Kingdom', exhibitSource='Customer', locationID='1', countryID='236', exhibitDate='2016-08-10 17:42:35' WHERE exhibitID='57'
No ids to log.
[1] SELECT * FROM perch2_shop_addresses WHERE addressID='106' AND addressDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationDeleted IS NULL AND ((countryID=236 AND regionID IS NULL) OR locationIsDefault=1) ORDER BY locationIsDefault ASC LIMIT 1
Looking up missing property address_1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
Looking up missing property address_2
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
Looking up missing property city
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
Looking up missing property county
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
Looking up missing property postcode
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
[1] SELECT * FROM perch2_shop_countries WHERE countryID='236' LIMIT 1
INSERT INTO perch2_shop_tax_exhibits(orderID,exhibitType,exhibitDetail,exhibitSource,locationID,countryID,exhibitDate) VALUES(52,'SHIP_ADDRESS','Flat 5 Richmond Lodge, 6 Victoria Avenue, Swanage, Dorset, BH191AN, United Kingdom','Customer','1','236','2016-08-10 17:42:35')
[1] SELECT * FROM perch2_shop_tax_exhibits WHERE exhibitID='58' LIMIT 1
No ids to log.
UPDATE perch2_shop_tax_exhibits SET orderID=52, exhibitType='SHIP_ADDRESS', exhibitDetail='Flat 5 Richmond Lodge, 6 Victoria Avenue, Swanage, Dorset, BH191AN, United Kingdom', exhibitSource='Customer', locationID='1', countryID='236', exhibitDate='2016-08-10 17:42:35' WHERE exhibitID='58'
No ids to log.
[1] SELECT * FROM perch2_shop_order_statuses WHERE statusKey='paid' AND statusActive=1 AND statusDeleted IS NULL
[nil] SELECT * FROM perch2_shop_emails WHERE emailStatus=3 AND emailActive=1
[1] SELECT p.*, oi.itemQty FROM perch2_shop_order_items oi, perch2_shop_products p WHERE oi.productID = p.productID AND oi.orderID='52'
[1] SELECT * FROM perch2_shop_customers WHERE customerID='1' AND customerDeleted IS NULL LIMIT 1
UPDATE perch2_shop_products SET stock_level=0, productUpdated='2016-08-10 18:42:36' WHERE productID='1'
No ids to log.
[nil] SELECT * FROM perch2_shop_product_tags WHERE productID=1 AND tagDeleted IS NULL ORDER BY tagOrder ASC
[1] SELECT * FROM perch2_shop_currencies WHERE currencyActive=1 AND currencyID=47
UPDATE perch2_shop_orders SET orderExchangeRate=1, orderUpdated='2016-08-10 18:42:36' WHERE orderID='52'
No ids to log.
[1] SELECT * FROM perch2_shop_orders WHERE orderID=1 AND orderDeleted IS NULL LIMIT 1
Is paid?

I am also discussing this issue with paypal

4th website now

either i cant follow basic documentation or paypal is broken

Ok this worked a few times

  if (perch_shop_order_successful('paypal-express')) {

rather than

  if (perch_shop_order_successful()) {
Drew McLellan

Drew McLellan 2638 points
Perch Support

perch_shop_order_successful() does not take any arguments.