• Resolved jlgouwy

    (@jlgouwy)


    Hi everyone,

    I know there are a plenty of post about IPN paypal issues.
    But none of thoses solutions worked for me.

    I don’t find where I fail.

    So, for a client, before sending the website in production, we would try some feature in staging environment.

    So, I created a sandbox paypal account and use generated email to make an order.

    The emails are :
    [email protected]
    [email protected]

    In woocommerce setup, I configured [email protected] for paypal email and receiver email. Then, I also configure API sandbox username + signature + password.

    When I make an order, I order with “[email protected]” account paypal.

    But still, the order stays in pending.
    But I need to receive completed order to test some features.

    When I activate the woocommerce log, I can see this :
    2019-07-26T10:37:18+00:00 INFO Received valid response from PayPal IPN
    2019-07-26T10:37:18+00:00 INFO Found order #396
    2019-07-26T10:37:18+00:00 INFO Payment status: completed

    So what’s wrong ? why does it stay Pending mode ?
    any ideas ?

    thanks in advance to help me ??

    • This topic was modified 5 years, 4 months ago by jlgouwy.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jlgouwy

    (@jlgouwy)

    this is the all log :

    2019-07-26T10:52:36+00:00 INFO Generating payment form for order 397. Notify URL: https://mystaging.host.fr/wc-api/WC_Gateway_Paypal/
    2019-07-26T10:52:36+00:00 INFO PayPal Request Args for order 397: Array
    (
        [cmd] => _cart
        [business] => [email protected]
        [no_note] => 1
        [currency_code] => EUR
        [charset] => utf-8
        [rm] => 1
        [upload] => 1
        [return] => https://mystaging.host.fr/checkout/order-received/397/?key=wc_order_aiL8Nr7lc9fPZ&utm_nooverride=1
        [cancel_return] => https://mystaging.host.fr/cart/?cancel_order=true&order=wc_order_aiL8Nr7lc9fPZ&order_id=397&redirect&_wpnonce=3ad010674c
        [page_style] => 
        [image_url] => 
        [paymentaction] => sale
        [invoice] => WC-397
        [custom] => {"order_id":397,"order_key":"wc_order_aiL8Nr7lc9fPZ"}
        [notify_url] => https://mystaging.host.fr/wc-api/WC_Gateway_Paypal/
        [first_name] => ***
        [last_name] => ***
        [address1] => ***
        [address2] => ***
        [city] => ***
        [state] => ***
        [zip] => ***
        [country] => ***
        [email] => ***@***
        [night_phone_a] => ***
        [night_phone_b] => ***
        [address_override] => 0
        [no_shipping] => 0
        [tax_cart] => 0.00
        [shipping_1] => 1.00
        [item_name_1] => ANGELE cotton blouse (Chosen Size: Standard)
        [quantity_1] => 1
        [amount_1] => 145
        [item_number_1] => 
        [lc] => en
        [bn] => WooThemes_Cart
    )
    
    2019-07-26T10:53:09+00:00 INFO Checking IPN response is valid
    2019-07-26T10:53:11+00:00 INFO IPN Response: Array
    (
        [headers] => Requests_Utility_CaseInsensitiveDictionary Object
            (
                [data:protected] => Array
                    (
                        [date] => Fri, 26 Jul 2019 10:52:53 GMT
                        [server] => Apache
                        [x-frame-options] => SAMEORIGIN
                        [set-cookie] => Array
                            (
                                [0] => c9MWDuvPtT9GIMyPc3jwol1VSlO=11N3MgLAZODXOTjBSiB7BZ5Y8yEKZvikTBhW4b_GSW57nAUhdJ6CiJ2lPsVvXFdEo70P_NAIjf87s_yM0cKybOVCedT9jgsQQb-QBC03UeyM_XygD2y-bDPIeHZM-Q-7T99UKVcWYmT5puP6MIxS4tb77wiukrKQztHDIMh3TFWm9AV1-Nk4qAFuccnpJqLKeBiXzE29_8qz2gQO7flRyad6DGGy4EB-r6pcOafZqc482zEyWgAuKK-Ejso1knv4aSFrZAAtoS44bm0Abfh9Bu6OAlXAa8a9Yf6ildgmI0hxQrAtgLnAJR1S6xCJS9emRKQaJVUQzbNBc1IqjfFUzBbFFDFBRJ0j17Be_5G5XRLSORk8RIt0-SDFzYeGNhvekoVWLQk235MTsVSSvAwXab5QmwmE51jI5Gqi8MLf-RrVeaHzhnT_Xiygqe8; domain=.paypal.com; path=/; Secure; HttpOnly
                                [1] => cookie_check=yes; expires=Mon, 23-Jul-2029 10:52:53 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
                                [2] => navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; HttpOnly
                                [3] => navlns=0.0; expires=Sun, 25-Jul-2021 10:52:53 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
                                [4] => Apache=10.72.108.11.1564138373206918; path=/; expires=Sun, 18-Jul-49 10:52:53 GMT
                                [5] => X-PP-SILOVER=name%3DSANDBOX3.WEB.1%26silo_version%3D1880%26app%3Dappdispatcher%26TIME%3D2245737053%26HTTP_X_PP_AZ_LOCATOR%3Dsandbox.slc; Expires=Fri, 26 Jul 2019 11:22:54 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
                                [6] => X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
                            )
    
                        [vary] => Accept-Encoding,User-Agent
                        [http_x_pp_az_locator] => sandbox.slc
                        [content-encoding] => gzip
                        [paypal-debug-id] => a3502f7129978
                        [content-type] => text/html; charset=UTF-8
                        [strict-transport-security] => max-age=63072000
                    )
    
            )
    
        [body] => VERIFIED
        [response] => Array
            (
                [code] => 200
                [message] => OK
            )
    
        [cookies] => Array
            (
                [0] => WP_Http_Cookie Object
                    (
                        [name] => c9MWDuvPtT9GIMyPc3jwol1VSlO
                        [value] => 11N3MgLAZODXOTjBSiB7BZ5Y8yEKZvikTBhW4b_GSW57nAUhdJ6CiJ2lPsVvXFdEo70P_NAIjf87s_yM0cKybOVCedT9jgsQQb-QBC03UeyM_XygD2y-bDPIeHZM-Q-7T99UKVcWYmT5puP6MIxS4tb77wiukrKQztHDIMh3TFWm9AV1-Nk4qAFuccnpJqLKeBiXzE29_8qz2gQO7flRyad6DGGy4EB-r6pcOafZqc482zEyWgAuKK-Ejso1knv4aSFrZAAtoS44bm0Abfh9Bu6OAlXAa8a9Yf6ildgmI0hxQrAtgLnAJR1S6xCJS9emRKQaJVUQzbNBc1IqjfFUzBbFFDFBRJ0j17Be_5G5XRLSORk8RIt0-SDFzYeGNhvekoVWLQk235MTsVSSvAwXab5QmwmE51jI5Gqi8MLf-RrVeaHzhnT_Xiygqe8
                        [expires] => 
                        [path] => /
                        [domain] => paypal.com
                        [host_only] => 
                    )
    
                [1] => WP_Http_Cookie Object
                    (
                        [name] => cookie_check
                        [value] => yes
                        [expires] => 1879498373
                        [path] => /
                        [domain] => paypal.com
                        [host_only] => 
                    )
    
                [2] => WP_Http_Cookie Object
                    (
                        [name] => navcmd
                        [value] => _notify-validate
                        [expires] => 
                        [path] => /
                        [domain] => paypal.com
                        [host_only] => 
                    )
    
                [3] => WP_Http_Cookie Object
                    (
                        [name] => navlns
                        [value] => 0.0
                        [expires] => 1627210373
                        [path] => /
                        [domain] => paypal.com
                        [host_only] => 
                    )
    
                [4] => WP_Http_Cookie Object
                    (
                        [name] => Apache
                        [value] => 10.72.108.11.1564138373206918
                        [expires] => 2510218373
                        [path] => /
                        [domain] => www.sandbox.paypal.com
                        [host_only] => 1
                    )
    
                [5] => WP_Http_Cookie Object
                    (
                        [name] => X-PP-SILOVER
                        [value] => 
                        [expires] => 1
                        [path] => /cgi-bin
                        [domain] => www.sandbox.paypal.com
                        [host_only] => 1
                    )
    
            )
    
        [filename] => 
        [http_response] => WP_HTTP_Requests_Response Object
            (
                [response:protected] => Requests_Response Object
                    (
                        [body] => VERIFIED
                        [raw] => HTTP/1.1 200 OK
    Date: Fri, 26 Jul 2019 10:52:53 GMT
    Server: Apache
    X-Frame-Options: SAMEORIGIN
    Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=11N3MgLAZODXOTjBSiB7BZ5Y8yEKZvikTBhW4b_GSW57nAUhdJ6CiJ2lPsVvXFdEo70P_NAIjf87s_yM0cKybOVCedT9jgsQQb-QBC03UeyM_XygD2y-bDPIeHZM-Q-7T99UKVcWYmT5puP6MIxS4tb77wiukrKQztHDIMh3TFWm9AV1-Nk4qAFuccnpJqLKeBiXzE29_8qz2gQO7flRyad6DGGy4EB-r6pcOafZqc482zEyWgAuKK-Ejso1knv4aSFrZAAtoS44bm0Abfh9Bu6OAlXAa8a9Yf6ildgmI0hxQrAtgLnAJR1S6xCJS9emRKQaJVUQzbNBc1IqjfFUzBbFFDFBRJ0j17Be_5G5XRLSORk8RIt0-SDFzYeGNhvekoVWLQk235MTsVSSvAwXab5QmwmE51jI5Gqi8MLf-RrVeaHzhnT_Xiygqe8; domain=.paypal.com; path=/; Secure; HttpOnly
    Set-Cookie: cookie_check=yes; expires=Mon, 23-Jul-2029 10:52:53 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
    Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; HttpOnly
    Set-Cookie: navlns=0.0; expires=Sun, 25-Jul-2021 10:52:53 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
    Set-Cookie: Apache=10.72.108.11.1564138373206918; path=/; expires=Sun, 18-Jul-49 10:52:53 GMT
    Vary: Accept-Encoding,User-Agent
    Connection: close
    HTTP_X_PP_AZ_LOCATOR: sandbox.slc
    Content-Encoding: gzip
    Paypal-Debug-Id: a3502f7129978
    Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.WEB.1%26silo_version%3D1880%26app%3Dappdispatcher%26TIME%3D2245737053%26HTTP_X_PP_AZ_LOCATOR%3Dsandbox.slc; Expires=Fri, 26 Jul 2019 11:22:54 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
    Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
    Content-Type: text/html; charset=UTF-8
    Strict-Transport-Security: max-age=63072000
    
    VERIFIED
                        [headers] => Requests_Response_Headers Object
                            (
                                [data:protected] => Array
                                    (
                                        [date] => Array
                                            (
                                                [0] => Fri, 26 Jul 2019 10:52:53 GMT
                                            )
    
                                        [server] => Array
                                            (
                                                [0] => Apache
                                            )
    
                                        [x-frame-options] => Array
                                            (
                                                [0] => SAMEORIGIN
                                            )
    
                                        [set-cookie] => Array
                                            (
                                                [0] => c9MWDuvPtT9GIMyPc3jwol1VSlO=11N3MgLAZODXOTjBSiB7BZ5Y8yEKZvikTBhW4b_GSW57nAUhdJ6CiJ2lPsVvXFdEo70P_NAIjf87s_yM0cKybOVCedT9jgsQQb-QBC03UeyM_XygD2y-bDPIeHZM-Q-7T99UKVcWYmT5puP6MIxS4tb77wiukrKQztHDIMh3TFWm9AV1-Nk4qAFuccnpJqLKeBiXzE29_8qz2gQO7flRyad6DGGy4EB-r6pcOafZqc482zEyWgAuKK-Ejso1knv4aSFrZAAtoS44bm0Abfh9Bu6OAlXAa8a9Yf6ildgmI0hxQrAtgLnAJR1S6xCJS9emRKQaJVUQzbNBc1IqjfFUzBbFFDFBRJ0j17Be_5G5XRLSORk8RIt0-SDFzYeGNhvekoVWLQk235MTsVSSvAwXab5QmwmE51jI5Gqi8MLf-RrVeaHzhnT_Xiygqe8; domain=.paypal.com; path=/; Secure; HttpOnly
                                                [1] => cookie_check=yes; expires=Mon, 23-Jul-2029 10:52:53 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
                                                [2] => navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; HttpOnly
                                                [3] => navlns=0.0; expires=Sun, 25-Jul-2021 10:52:53 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
                                                [4] => Apache=10.72.108.11.1564138373206918; path=/; expires=Sun, 18-Jul-49 10:52:53 GMT
                                                [5] => X-PP-SILOVER=name%3DSANDBOX3.WEB.1%26silo_version%3D1880%26app%3Dappdispatcher%26TIME%3D2245737053%26HTTP_X_PP_AZ_LOCATOR%3Dsandbox.slc; Expires=Fri, 26 Jul 2019 11:22:54 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
                                                [6] => X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
                                            )
    
                                        [vary] => Array
                                            (
                                                [0] => Accept-Encoding,User-Agent
                                            )
    
                                        [http_x_pp_az_locator] => Array
                                            (
                                                [0] => sandbox.slc
                                            )
    
                                        [content-encoding] => Array
                                            (
                                                [0] => gzip
                                            )
    
                                        [paypal-debug-id] => Array
                                            (
                                                [0] => a3502f7129978
                                            )
    
                                        [content-type] => Array
                                            (
                                                [0] => text/html; charset=UTF-8
                                            )
    
                                        [strict-transport-security] => Array
                                            (
                                                [0] => max-age=63072000
                                            )
    
                                    )
    
                            )
    
                        [status_code] => 200
                        [protocol_version] => 1.1
                        [success] => 1
                        [redirects] => 0
                        [url] => https://www.sandbox.paypal.com/cgi-bin/webscr
                        [history] => Array
                            (
                            )
    
                        [cookies] => Requests_Cookie_Jar Object
                            (
                                [cookies:protected] => Array
                                    (
                                        [c9MWDuvPtT9GIMyPc3jwol1VSlO] => Requests_Cookie Object
                                            (
                                                [name] => c9MWDuvPtT9GIMyPc3jwol1VSlO
                                                [value] => 11N3MgLAZODXOTjBSiB7BZ5Y8yEKZvikTBhW4b_GSW57nAUhdJ6CiJ2lPsVvXFdEo70P_NAIjf87s_yM0cKybOVCedT9jgsQQb-QBC03UeyM_XygD2y-bDPIeHZM-Q-7T99UKVcWYmT5puP6MIxS4tb77wiukrKQztHDIMh3TFWm9AV1-Nk4qAFuccnpJqLKeBiXzE29_8qz2gQO7flRyad6DGGy4EB-r6pcOafZqc482zEyWgAuKK-Ejso1knv4aSFrZAAtoS44bm0Abfh9Bu6OAlXAa8a9Yf6ildgmI0hxQrAtgLnAJR1S6xCJS9emRKQaJVUQzbNBc1IqjfFUzBbFFDFBRJ0j17Be_5G5XRLSORk8RIt0-SDFzYeGNhvekoVWLQk235MTsVSSvAwXab5QmwmE51jI5Gqi8MLf-RrVeaHzhnT_Xiygqe8
                                                [attributes] => Requests_Utility_CaseInsensitiveDictionary Object
                                                    (
                                                        [data:protected] => Array
                                                            (
                                                                [domain] => paypal.com
                                                                [path] => /
                                                                [secure] => 1
                                                                [httponly] => 1
                                                            )
    
                                                    )
    
                                                [flags] => Array
                                                    (
                                                        [creation] => 1564138391
                                                        [last-access] => 1564138391
                                                        [persistent] => 
                                                        [host-only] => 
                                                    )
    
                                                [reference_time] => 1564138391
                                            )
    
                                        [cookie_check] => Requests_Cookie Object
                                            (
                                                [name] => cookie_check
                                                [value] => yes
                                                [attributes] => Requests_Utility_CaseInsensitiveDictionary Object
                                                    (
                                                        [data:protected] => Array
                                                            (
                                                                [expires] => 1879498373
                                                                [domain] => paypal.com
                                                                [path] => /
                                                                [secure] => 1
                                                                [httponly] => 1
                                                            )
    
                                                    )
    
                                                [flags] => Array
                                                    (
                                                        [creation] => 1564138391
                                                        [last-access] => 1564138391
                                                        [persistent] => 
                                                        [host-only] => 
                                                    )
    
                                                [reference_time] => 1564138391
                                            )
    
                                        [navcmd] => Requests_Cookie Object
                                            (
                                                [name] => navcmd
                                                [value] => _notify-validate
                                                [attributes] => Requests_Utility_CaseInsensitiveDictionary Object
                                                    (
                                                        [data:protected] => Array
                                                            (
                                                                [domain] => paypal.com
                                                                [path] => /
                                                                [secure] => 1
                                                                [httponly] => 1
                                                            )
    
                                                    )
    
                                                [flags] => Array
                                                    (
                                                        [creation] => 1564138391
                                                        [last-access] => 1564138391
                                                        [persistent] => 
                                                        [host-only] => 
                                                    )
    
                                                [reference_time] => 1564138391
                                            )
    
                                        [navlns] => Requests_Cookie Object
                                            (
                                                [name] => navlns
                                                [value] => 0.0
                                                [attributes] => Requests_Utility_CaseInsensitiveDictionary Object
                                                    (
                                                        [data:protected] => Array
                                                            (
                                                                [expires] => 1627210373
                                                                [domain] => paypal.com
                                                                [path] => /
                                                                [secure] => 1
                                                                [httponly] => 1
                                                            )
    
                                                    )
    
                                                [flags] => Array
                                                    (
                                                        [creation] => 1564138391
                                                        [last-access] => 1564138391
                                                        [persistent] => 
                                                        [host-only] => 
                                                    )
    
                                                [reference_time] => 1564138391
                                            )
    
                                        [Apache] => Requests_Cookie Object
                                            (
                                                [name] => Apache
                                                [value] => 10.72.108.11.1564138373206918
                                                [attributes] => Requests_Utility_CaseInsensitiveDictionary Object
                                                    (
                                                        [data:protected] => Array
                                                            (
                                                                [path] => /
                                                                [expires] => 2510218373
                                                                [domain] => www.sandbox.paypal.com
                                                            )
    
                                                    )
    
                                                [flags] => Array
                                                    (
                                                        [creation] => 1564138391
                                                        [last-access] => 1564138391
                                                        [persistent] => 
                                                        [host-only] => 1
                                                    )
    
                                                [reference_time] => 1564138391
                                            )
    
                                        [X-PP-SILOVER] => Requests_Cookie Object
                                            (
                                                [name] => X-PP-SILOVER
                                                [value] => 
                                                [attributes] => Requests_Utility_CaseInsensitiveDictionary Object
                                                    (
                                                        [data:protected] => Array
                                                            (
                                                                [expires] => 1
                                                                [domain] => www.sandbox.paypal.com
                                                                [path] => /cgi-bin
                                                            )
    
                                                    )
    
                                                [flags] => Array
                                                    (
                                                        [creation] => 1564138391
                                                        [last-access] => 1564138391
                                                        [persistent] => 
                                                        [host-only] => 1
                                                    )
    
                                                [reference_time] => 1564138391
                                            )
    
                                    )
    
                            )
    
                    )
    
                [filename:protected] => 
                [data] => 
                [headers] => 
                [status] => 
            )
    
    )
    2019-07-26T10:53:11+00:00 INFO Received valid response from PayPal IPN
    2019-07-26T10:53:11+00:00 INFO Found order #397
    2019-07-26T10:53:11+00:00 INFO Payment status: completed
    • This reply was modified 5 years, 4 months ago by jlgouwy.
    Thread Starter jlgouwy

    (@jlgouwy)

    Ok my bad !
    It’s my own mistake !

    In fact, I wrote a filter woocommerce_payment_complete_order_status which is returned nothing.
    So when order proceeds with a complete payment and tried to change status to processing, it didn’t work anymore

    class-wc-order:
    $this->set_status( apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? 'processing' : 'completed', $this->get_id(), $this ) )

    And thanks to my investigation, I learned when it’s a physical product, to complete an order, we still need some action from the seller. (Indeed, he needs to pack and send the product to the customer, so the order is not totally completed)

    if you cant for some reasons applying the virtual product behavior to physical product, use this hook :

    add_filter('woocommerce_order_item_needs_processing', function() {
        return false;
    }', 10);

    Sorry for the flood :p

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sandbox Paypal : always pending in staging env.’ is closed to new replies.