Paypal IPN issue

Hi all

I received an email from Paypal regarding IPN failure.

==============
Please check your server that handles PayPal Instant Payment Notifications (IPN). Instant Payment Notifications sent to the following URL(s) are failing:

http://www.site.com/sub-site-name/store/payment-return/paypal-express

If you do not recognize this URL, you may be using a service provider that is using IPN on your behalf. Please contact your service provider with the above information. If this problem continues, IPNs may be disabled for your account.
==============

I got in touch with the host who did some investigating: Their initial response was:

==============
I can see that the URL is returning 503 in your access log:

[07/Nov/2012:22:49:36 +0000] "POST /sub-site-name/store/payment-return/paypal-express HTTP/1.0" 503 75 "-" "-"
[07/Nov/2012:22:49:48 +0000] "POST /sub-site-name/store/payment-return/paypal-express HTTP/1.0" 503 75 "-" "-"
[07/Nov/2012:22:50:12 +0000] "POST /sub-site-name/store/payment-return/paypal-express HTTP/1.0" 503 75 "-" "-"

I'm having a look now through the server logs to see if there's any reason why it would show a 503 return code.
==============

and they followed up shortly with

==============
Nothing in our logs that show that our server would cause a 503.

But am I right that you are using MarketPress? If yes, their code contains a 503 response:

---------------
//check results
if (is_wp_error($response) || wp_remote_retrieve_response_code($response) != 200 || $response['body'] != 'VERIFIED') {
header("HTTP/1.1 503 Service Unavailable");
_e( 'There was a problem verifying the IPN string with PayPal. Please try again.', 'mp' );
exit;
}
---------------
(source http://plugins.svn.wordpress.org/wordpress-ecommerce/trunk/marketpress-includes/plugins-gateway/paypal-express.php )

And there are a few posts of MarketPress users with similar issues: https://premium.wpmudev.org/forums/topic/paypal-ipn-failures and there's also https://premium.wpmudev.org/forums/topic/paypal-ipn-problem but there's no resolution posted.

Can you contact MarketPress & check with them in the first instance if there's any possible bug with the module?

PayPal is widely used on our servers, and I'm not aware of any other user having IPN errors, so it's unlikely that PayPal is having generic problems accessing our server. The 503 response appears to be created by the script itself so you need to check why the script is triggering the 503 response.

In summary the 503 is not from the server, but from the script & will need to be tackled at script level.
==============

Any ideas on how to fix the issue. Having the IPN disabled by Paypal would be a bad thing.

  • Timothy Bowers

    Hey there.

    I was just reading through those other threads regarding this issue.

    Firstly, we use notify_url so the return url should be dynamically given to Paypal.

    The actual return url is /wp-admin/admin-ajax.php?action=psts_pypl_ipn

    Can you please check yourIPN log as per this thread:

    https://premium.wpmudev.org/forums/topic/paypal-ipn-problem

    And please let me have the information so I can see where it's trying to send people back to.

    Let et me know.

    Take care.

  • cml

    Hi Timothy

    Thanks for getting back.

    There only appears to be 2 items listed in my IPN log:

    Date/time created Message ID Status Transaction ID
    07/11/2012 22:49 GMT 05T82503JC163200N Sent 6NC9358809805794L
    19/10/2012 16:55 BST 44N87021WJ1052217 Failed 2PY54752EW396825S

    The most recent is a 200 error, the latter a 503 but it's dated a long time ago.

    This is the 503 error details -
    ============================
    Message ID: 44N87021WJ1062217
    Date/time created: 19/10/2012 16:55 BST
    Original/Resent: Original
    Latest delivery attempt date/time: 23/10/2012 14:26 BST
    Notification URL: http://www.comicsy.co.uk/store/payment-return/paypal-express
    HTTP response code: 503
    Delivery status: Failed
    No. of retries: 16
    Transaction ID: 2PY54752EC396825S
    IPN type :Transaction made
    IPN Message:
    mc_gross=0.75&invoice=b40adf670ea0&item_mpn1=&protection_eligibility=Eligible&item_count_unit1=0&address_status=confirmed&item_number1=AAFH1S&tax=0.00&payer_id=EV87DEHS8WSJ6&address_street=fake_address_here&payment_date=08:55:02 Oct 19, 2012 PDT&item_tax_rate1=0&payment_status=Completed&charset=windows-1252&address_zip=b78 3pn&mc_shipping=0.00&item_tax_rate_double1=0.00&mc_handling=0.00&first_name=fakename&mc_fee=0.23&address_country_code=GB&address_name=fakename&notify_version=3.7&custom=&payer_status=unverified&business=emailadress.co.uk&address_country=United Kingdom&num_cart_items=1&mc_handling1=0.00&address_city=fakecity&verify_sign=A5UeliS9AtFnxfZvca9rP4BOU54PAHrLGGgMkBzJacRORfAf3YxJbYor&payer_email=fake@hotmail.co.uk&mc_shipping1=0.00&item_style_number1=&tax1=0.00&item_plu1=&txn_id=2PY54752EC396825S&payment_type=instant&last_name=fakename&address_state=fake&item_name1=fakeproductname&receiver_email=fake@email.co.uk&item_isbn1=&payment_fee=&quantity1=1&receiver_id=EX4JYLQ2682VJ&txn_type=cart&item_model_number1=&mc_gross_1=0.75&mc_currency=GBP&item_taxable1=N&residence_country=GB&transaction_subject=Store Purchase - Order ID: b40adf670ea0&payment_gross=&ipn_track_id=ccfa31u428a5
    ============================

    I've also just been informed by one of my store owners that he is also receiving the email from Paypal concerning IPN.

  • cml

    Hi Timothy

    Definately not using Sandbox.

    I fear it's yet another Marketpress global cart related error. Seriously, has this actually ever been tested by anyone, or run in a live environment?

    Another store owner contacted me today. He is also receiving the IPN error email from Paypal.

    Prob explains why I only have 2 entries in my IPN history. The other store owners are getting these error messages as payments are being made straight to their accounts not via mine.

    So we're all getting IPN errors. Surely this indicates a fault with the software rather than Paypal.

    A rapid response would be appreciated.

  • cml

    Hi Tim

    Thanks for your response.

    I've contacted one of the stores. IPN details listed below

    ============================
    Message ID36T96582HS027410L

    Date/time created04/11/2012 15:22 GMT

    Original/ResentOriginal

    Latest delivery attempt date/time08/11/2012 12:54 GMT

    Notification URLhttp://www.comicsy.co.uk/bolt01/store/payment-return/paypal-express

    HTTP response codeWhat's this?503

    Delivery statusFailed

    No. of retries16

    Transaction ID981504077D662852R

    IPN typeTransaction made

    mc_gross=0.50&invoice=b3a6c93813b9&protection_eligibility=Eligible&address_status=confirmed&item_number1=Stak01&payer_id=MXSHZ2ECXFH3Q&tax=0.00&address_street=15 Park&payment_date=07:22:30 Nov 04, 2012 PST&payment_status=Completed&charset=windows-1252&address_zip=KO3 5BR&mc_shipping=0.00&mc_handling=0.00&first_name=John&mc_fee=0.22&address_country_code=GB&address_name=John Smith&notify_version=3.7&custom=&payer_status=verified&business=strip@gmail.com&address_country=United Kingdom&num_cart_items=1&mc_handling1=0.00&address_city=Killip&verify_sign=AHKQUdA.TmKW8HIgJ1ydCWUStq-GAS3kshlISk9NLLJXLdY0lFI7Kgz1&payer_email=buyer@gmail.com&mc_shipping1=0.00&tax1=0.00&txn_id=981504077D662852R&payment_type=instant&last_name=Smith&address_state=Yorks&item_name1=Stak 01&receiver_email=strip@gmail.com&payment_fee=&quantity1=1&receiver_id=DU5ARE8VQ9GQE&txn_type=cart&mc_gross_1=0.50&mc_currency=GBP&residence_country=GB&transaction_subject=FutureQuakePress Store Purchase - Order ID: b3a6c93815b9&payment_gross=&ipn_track_id=e0988af8c318b
    ============================

  • cml

    @Timothy Here's more IPN details from a different user

    ==================================
    Message ID3UM12712NC973881U
    Date/time created11/11/2012 00:34 GMT
    Original/ResentOriginal
    Latest delivery attempt date/time14/11/2012 22:05 GMT
    Notification URLhttp://www.comicsy.co.uk/hibernia/store/payment-return/paypal-express
    HTTP response code503
    Delivery statusFailed
    No. of retries16
    Transaction ID5M150772HU291394T
    IPN typeTransaction made
    IPN Messagemc_gross=6.49&invoice=4171d6964142&protection_eligibility=Ineligible&address_status=confirmed&item_number1=&payer_id=C9FYFFRJHXXKC&tax=0.00&address_street=Dune Road&payment_date=16:34:42 Nov 10, 2012 PST&payment_status=Completed&charset=windows-1252&address_zip=TN28 8SS&mc_shipping=2.50&mc_handling=0.00&first_name=Don&mc_fee=0.45&address_country_code=GB&address_name=Don Free&notify_version=3.7&custom=&payer_status=unverified&business=demo@email.com&address_country=United Kingdom&num_cart_items=1&mc_handling1=0.00&address_city=Stone&verify_sign=A3ZKTxiufDzyhkbbibim-.gv7TRHAdcW6MJmxGRT-g9XlHn1wBgH.afS&payer_email=don@vogue.net&mc_shipping1=0.00&tax1=0.00&txn_id=5M150792HU291294T&payment_type=instant&last_name=Free&address_state=Kingston&item_name1=COMIC ARCHIVE 'ONE EYED JACK AND THE DEATH OF VALIANT'&receiver_email=demo@email.com&payment_fee=&quantity1=1&receiver_id=2UL56WXU2JAMU&txn_type=cart&mc_gross_1=3.99&mc_currency=GBP&residence_country=GB&transaction_subject=Comics Store Purchase - Order ID: 4171d6944842&payment_gross=&ipn_track_id=2fc4c9c86ee8b
    ==================================

  • Timothy Bowers

    The that they return to loads fine for me:

    http://www.domain.com/site/store/payment-return/paypal-express

    Well it tells me it's missing VARs but that's because I'm not returning any data.

    The error they log is a 503, which is service unavailable. Was this a test purchase or a real one?

    Just wondering if you've noticed any load issues on your site or not. Do you have monitoring services like pingdom watching your site?

    Any chance you run another test transaction, maybe a small amount and see what happens then?

    Could you please check with your host to ensure they are not somehow blocking Paypal from communicating with your site/server. Something which would prevent them returning to that URL.

    Let me know.

    Thanks.

  • cml

    Hi Tim

    Contacted the hosting again for a double check. They seem sure everything is in order at their end.

    ===========
    As advised the 503 code is returned by your script, not our server. You are correct that normally 503 means server is offline but in this case, the script itself issues a 503 response. You need to look at the script snippet I sent to check why and how this is triggered.

    As for PayPal, I'm confident this is working normally. PayPal is widely used & nobody else has reported any errors on any site hosted with us. Load on the server is very low ( load average: 0.90, 1.14, 1.19 ) with load being able to go up to 16 before you notice any issues. There is also no block in place from our end, I have checked both firewall and mod_security logs.
    ===========

    I placed a small sale thoough the site to one of the accounts I have. IPN details listed below. Another 503 error but this time it says 'Retrying'

    Any ideas?

    ==========
    8FK15250EA699011K

    Date/time created16/11/2012 10:04 GMT

    Original/ResentOriginal

    Latest delivery attempt date/time16/11/2012 12:55 GMT

    Notification URLhttp://www.comicsy.co.uk/backfromthedepths/store/payment-return/paypal-express

    HTTP response codeWhat's this?503

    Delivery statusRetrying

    No. of retries11

    Transaction ID21V915620G733320U

    IPN typeTransaction made

    mc_gross=0.01&invoice=34532e410ef8&protection_eligibility=Eligible&address_status=confirmed&item_number1=bftd01&payer_id=833EYXQ7B3QRE&tax=0.00&address_street=13 A Road&payment_date=02:04:51 Nov 16, 2012 PST&payment_status=Completed&charset=windows-1252&address_zip=Y647SQ&mc_shipping=0.00&mc_handling=0.00&first_name=Tim&mc_fee=0.01&address_country_code=GB&address_name=John Smith&notify_version=3.7&custom=&payer_status=verified&business=john@smith.co.uk&address_country=United Kingdom&num_cart_items=1&mc_handling1=0.00&address_city=Heath&verify_sign=AlaIc83oE4P1xSWdYdBoNmIY-PzLAzk9Kjw0MCjdGaXT2dt55hXtbJ1K&payer_email=person@email.co.uk&mc_shipping1=0.00&tax1=0.00&txn_id=21V915620G783320U&payment_type=instant&last_name=Smith&address_state=West Yorks&item_name1=Blackfriars - DIGITAL DOWNLOAD&receiver_email=john@smith.co.uk&payment_fee=&quantity1=1&receiver_id=CT2WUXBPYGM2Y&txn_type=cart&mc_gross_1=0.01&mc_currency=GBP&residence_country=GB&transaction_subject=Back from the Depths Store Purchase - Order ID: 34272e410ef8&payment_gross=&ipn_track_id=bfb328374ab01

  • Timothy Bowers

    I just realised that we've not check the version you're running.

    What version of MarketPress are you running? If not the latest could you upgrade and try once more.

    Same for Frame/GridMarket.

    If you look at the code your host is referring to:

    if (is_wp_error($response) || wp_remote_retrieve_response_code($response) != 200 || $response['body'] != 'VERIFIED')

    It's checking if there are any wp_errors i.e. WordPress errors being passed. Then checking the response from PP and the body from PP.

    This works on my own install.

    Anyway, lets check those versions just to be sure.

    Thanks.

  • Aaron

    The 503 means either your server can't reach paypal via an external call, or is having trouble verifying the IPN string. Unfortunately it's not easy to tell. I have seen on occassion some wierd character encoding causeing a mismatch.

    You said some IPNs are going through as 200 though?

    You can put some debug code in there, right before the header() 503 call:
    trigger_error("PayPal IPN Debug: ".var_export($response, true), E_USER_WARNING);

    Then it should drop debug info in your error log if a 503 is returned again.

  • cml

    Hi Guys

    Not responded as I've been waiting for orders and watching for warnings or a pattern. Nothing yet, the IPN error emails are still being sent randomly when orders are placed. Not had any error messages in the error log.

    I've been using the code here. Is that correct?
    On this page: plugins-gateway/paypal-express.php

    //check results
    if (is_wp_error($response) || wp_remote_retrieve_response_code($response) != 200 || $response['body'] != 'VERIFIED') {

    //header("HTTP/1.1 504 Gateway Time-out");

    //Custom Change - test IPN issues
    trigger_error("PayPal IPN Debug: ".var_export($response, true), E_USER_WARNING);

    header("HTTP/1.1 503 Service Unavailable");
    _e( 'There was a problem verifying the IPN string with PayPal. Please try again.', 'mp' );

    exit;
    }

    Any help would be greatly appreciated. The site is going well so if people start getting banned from Paypal its gonna be bad.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.