Paypal IPN Failures

Hi All,
My client received this email from paypal yesterday:

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

http://www.modelflyermagazine.com/flying-scale-models/store/payment-return/paypal-express
http://www.modelflyermagazine.com/rc-electric-flyer/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've checked the order history in Marketpress and it looks like all orders are being recorded fine, so I'm not sure what's going on, but obviously it's not acceptable.

Having looked at the error log in Paypal, they're all showing 503 errors like the one attached. As far as I can tell, I've followed the setup for Marketpress to the letter so I'm rather confused as to why we're getting this error. My client is handling transactions for a number of websites using the same PayPal account with IPN working fine (the other sites don't use Marketpress), so allowing PayPal to disable IPNs is not an option.

Note: I'm running domain mapping on the sites where it's failing. (Domain mapping is the thorn in my side at the moment!)

Please can anyone shed any light on how we can fix this?

Thanks

Justin

  • justinn

    Just had my host check the server logs and we're getting this:

    [01-Jul-2012 20:11:14 UTC] PHP Warning: Missing argument 3 for MP_Gateway_Paypal_Express::smiley:oExpressCheckoutPayment(), called in /home/mode98/public_html/wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php on line 333 and defined in /home/mode98/public_html/wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php on line 1046
    [01-Jul-2012 20:11:14 UTC] PHP Warning: Missing argument 4 for MP_Gateway_Paypal_Express::smiley:oExpressCheckoutPayment(), called in /home/mode98/public_html/wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php on line 333 and defined in /home/mode98/public_html/wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php on line 1046
    [01-Jul-2012 20:11:14 UTC] PHP Warning: Missing argument 5 for MP_Gateway_Paypal_Express::smiley:oExpressCheckoutPayment(), called in /home/mode98/public_html/wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php on line 333 and defined in /home/mode98/public_html/wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php on line 1046
    [01-Jul-2012 20:11:14 UTC] PHP Warning: Missing argument 6 for MP_Gateway_Paypal_Express::smiley:oExpressCheckoutPayment(), called in /home/mode98/public_html/wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php on line 333 and defined in /home/mode98/public_html/wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php on line 1046

    Any ideas what's up?

    Thanks
    Justin

  • Paul

    @justinn, I have reviewed the warnings and they are just that PHP warnings. Which should not effect PayPal posting back to your site for the IPN processing.

    So to review the first warning:

    [01-Jul-2012 20:11:14 UTC] PHP Warning: Missing argument 3 for MP_Gateway_Paypal_Express::smiley:oExpressCheckoutPayment(), called in /home/mode98/public_html/wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php on line 333 and defined in /home/mode98/public_html/wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php on line 1046

    So if you open the MarketPress file /marketpress/marketpress-includes/plugins-gateway/paypal-express.php and go to line 333 you will see if calls the class function DoExpressCheckoutPayment with 2 parameters.

    $result = $this->DoExpressCheckoutPayment($_SESSION['token'], $_SESSION['PayerID']);

    From the second part of the warning if references line 1046. This is the actual class function DoExpressCheckoutPayment() As you can see that function needs 6 parameters. But in reading the actual function code only the first two are used. So I'm not sure of Aaron's intentions here.

    function DoExpressCheckoutPayment($token, $payer_id, $final_amts, $seller_paypal_accounts, $ipns, $prs) {
    
    	$nvpstr  = '&TOKEN=' . urlencode($token);
    	$nvpstr .= '&PAYERID=' . urlencode($payer_id);
    	$nvpstr .= $_SESSION['nvpstr'];
    	var_dump($nvpstr);
    	/* Make the call to PayPal to finalize payment */
    	return $this->api_call("DoExpressCheckoutPayment", $nvpstr);
    }
  • Paul

    Part of my reply has to do with the HTTP 503 error. http://www.checkupdown.com/status/E503.html

    As you mentioned in your reply you are using domain mapping. This might have something to do with the issue. PayPal might be detecting the switch. Or one other possibility is when MarketPress makes the call to PayPal it is sending the wrong domain URL or something. You didn't provide any URL information so I have to ask what is the URL used within WordPress? And what is the mapped (external) domain? Finally, the error from PatPal about the 503 what URL is PayPal sending to?

  • justinn

    Hi PaulM,

    There are two mapped domains at present:
    RCElectricFlyer.com is mapped to: http://www.modelflyermagazine.com/rc-electric-flyer
    FlyingScaleModels.com is mapped to: http://www.modelflyermagazine.com/flying-scale-models/

    Looking at the error info I can only assume that paypal is sending the info to http://www.modelflyermagazine.com/flying-scale-models/store/payment-return/paypal-express for FlyingScaleModels.com

    However, looking at the IPN setup in paypal, it seems you can only have one IPN URL per account, is that right?

    My client has several ecommerce sites and they're using the IPN setup in their paypal account to communicate with an existing site which uses a different cart setup than my marketpress installs. Could that be the problem?

    Surely they don't have to get another PayPal account to run with marketpress, that's crazy!

    If the error is just a warning, but all else is actually working fine, then I guess all is well. The part I need to put my clients mind to rest over though is the fact that paypal say IPN may be disabled if it continues... This cannot be allow to happen as they need it for their other, currently business cart.

    I can't find anything relating to IPN in any of the marketpress documentation... or am I missing something,

    Thanks

    Justin

  • justinn

    Hi, My client is now getting daily emails from paypal saying they will turn off IPN's shortly if it's not fixed!

    We can't allow this to happen because of the way their other sites work. please can we get a solution to this. I thought the whole point of paying for a membership to wpmudev was to get decent support.

    Any progress updates would be greatly appreciated. As I said in my previous post, I can give you access to our live site if you wish.

    Thanks

    Justin

  • Paul

    @justinn, Just rereading some of the comment in this thread. Prompted some questions.

    1. So from your comments your client is using the same PayPal account for both stores RCElectricFlyer.com and FlyingScaleModels.com, correct?

    2. And from other comments your client is using other websites with PayPal (not using MarketPress). And all these use the same PayPal account?

    3. In PayPal do you know if the IPN URL is defined?

    4. Can you forward as ask the client to forward some (3-4) of the PayPal emails directly to me paul [at] incsub.com? There might be something there you are not seeing.

    5. If you log into PayPal does it show pending IPN transactions? Referring here to the screenshot on the initial post of this thread. Wondering if there is a way to review these an ensure these match to actual MarketPress transactions on either site.

  • Paul

    @justinn, I'm somewhat doubtful this is a Domain Mapper issue. But I'm not ruling anything out at this point. One issue is the HTTP error. This normally means there is a server to DNS issue preventing traffic from reaching the server. MarketPress itself would not trigger a 503 error for example. This is unfortunately one of this issue which will not be easy to figure out. But will keep digging.

    On your MarketPress setup can you confirm which PayPal option you are using. I'm assuming 'PayPal Express Checkout' But wanted to make sure. I'm going to provide you a replacement gateway file which will log the output and inbound data to a file. Maybe this will help in the debug.

  • Paul

    @justinn, In case you are using PayPal Express please download this replacement gateway file. Please retain a copy of your original file outside of the plugins-gateway directory

    This should replace your current paypal gateway file:
    /plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php

    If you open this file and look at line 56 you will see where I've defined a debug output file. By default this writes the file to your site root. Feel free to change this to somewhere else even outside of your website root.

    // PaulM Incsub - Begin debug logging
    	$this->MARKETPRESS_DATA_FILE = ABSPATH .'/marketpress_data.txt';

    https://dl.dropbox.com/u/2616987/WPMUDev/paypal-express.php-DEBUG-1.zip

  • justinn

    Hi PaulM,

    Right... I'll work though all the points one by one :slight_smile:

    1. So from your comments your client is using the same PayPal account for both stores RCElectricFlyer.com and FlyingScaleModels.com, correct?

    yes

    2. And from other comments your client is using other websites with PayPal (not using MarketPress). And all these use the same PayPal account?
    yes

    3. In PayPal do you know if the IPN URL is defined?
    Yes, one is defined in Paypal for their existing site: http://www.adhbooks.com/vsadmin/ppconfirm.asp

    4. Can you forward as ask the client to forward some (3-4) of the PayPal emails directly to me paul [at] incsub.com? There might be something there you are not seeing.
    Yes, will do that now

    5. If you log into PayPal does it show pending IPN transactions? Referring here to the screenshot on the initial post of this thread. Wondering if there is a way to review these an ensure these match to actual MarketPress transactions on either site.
    Yes it shows all the ones relating to marketpress transactions as retrying when we look at the IPN history

    @justinn, I'm somewhat doubtful this is a Domain Mapper issue. But I'm not ruling anything out at this point. One issue is the HTTP error. This normally means there is a server to DNS issue preventing traffic from reaching the server. MarketPress itself would not trigger a 503 error for example. This is unfortunately one of this issue which will not be easy to figure out. But will keep digging.
    I'll contact the web host to check whether there are any setup issues here

    On your MarketPress setup can you confirm which PayPal option you are using. I'm assuming 'PayPal Express Checkout' But wanted to make sure. I'm going to provide you a replacement gateway file which will log the output and inbound data to a file. Maybe this will help in the debug.
    Yes we're using express checkout - We also have Global shopping cart enabled, which incidentally isn't compatible with domain mapping, but that's another story!

    Will try the debug thing now too :slight_smile:

  • Paul

    @justinn, Sorry for my delay. I received the email forwards you send from PayPal. Thanks. I don't see anything specific that would lead to a clue on a solution.

    I had also asked that you forward me your current gateway file for PayPal. My assumption is you would not have touched it and would be using the stock one from the plugin. With the debug version I provided I don't know why it would be breaking the checkout process. As I mentioned in my email regarding that file you may want to change the location of where the file gets written. I think the default location I used was the site root. Your site root might not be writable by the web process.

    The debug file should not need permalinks or any other changes to your site. All it does is capture outbound and input data structure related to PayPal. So when someone goes through the checkout process an array is build before we handle the customer off to PayPal. In my debug version that array is simply written to a file. Same with the inbound return from PayPal and the IPN processing information. All these arrays are the form post data send to us. I was hopping to capture the data and be able to sync that up to some reported error from PayPal. But I'm guessing by now you have more the original gateway file into place.

    I know you are looking for answers from me on this. But to be honest I've not seen a problem with the processing. as you stated all the transaction are accounted form. When I check from within the PayPal sandbox those URLs are confirmed to work. Other than the working error message you had reported I've not been able to find an issue with the plugin.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.