XF 1.3 PayPal IPN Warnings after Migrating from vB

caliman

Active member
PayPal is sending my IPN warnings after I have migrated from vB.

Warning:

IPNs sent to the following URL(s) are failing:

myvB.com/forums/payment_gateway.php?method=paypal

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.

Thank you for your prompt attention to this issue.

So doing some searching here, I see that xF has a gateway file and on my board that is located here:

myxF.com/payment_callback.php

What is unclear is how I resolve this.

On the PayPal side:
I cannot find the old URL on my PayPal admin cp.
(I did find the IPN Notification URL settings page in PayPal - but that file (verify_ipn.php) is only about receiving notification messages. I did copy that file to my xF root.)

On the xF side:
Should I make a 301 redirect to the new file?

Since migrating I have been planning to deal with my PayPal subscriptions, but this just bumped up the matter.

Any help would be appreciated.

caliman
 
Saw this on the PayPal community help board, untested:

Re: IPN Notifications posting to wrong URL
‎06-07-2012 04:32 PM


Hi JZarr,



Yes; existing recurring payments for which you've specified the NOTIFYURL when the recurring payment was initially created, will continue to use the old URL.

In order to use the new URL, you would need to cancel the existing recurring payment(s) and re-create them.



Alternatively, if the old URL sits on a domain which still exists and which is still under your control, you could do something as follows (my example is for PHP as that's what I'm familiar with, but any language could do this);



  1. Create a file in the exact same location, with the exact same filename as your oldIPN script
  2. Paste the following code and replace where indicated
PHP:
<?php



// Force a successfull HTTP response to be returned to PayPal

header("HTTP/1.1 200 OK");


// Check if we've received POST data

if(!empty($_POST)) {

// Open a connection to www.yourdomain.tld on port 80

$fp = fsockopen("www.yourdomain.tld", 80, $errno, $errstr, 30);



// If your site use SSL, uncomment the line above and use this instead

// $fp = fsockopen("ssl://www.yourdomain.tld", 443, $errno, $errstr, 30);
if (!$fp) {

// Return an error if you're unable to set up a connection

echo "$errstr ($errno)<br />\n";

} else {

// Build the HTTP data

// Replace "youroldIPNscript.php" by the filename of your old IPN script

// For example, if your IPN script is available onwww.yourdomain.tld/checkout/paypal/ipn.php

// Then you the line below would read "POST /checkout/paypal/ipn.php
$out = "POST /youroldIPNscript.php HTTP/1.0\r\n";

// Replace by your (old) domain name again

$out .= "Host: www.yourdomain.tld\r\n";
$out .= 'Content-Type: application/x-www-form-urlencoded\r\n';
$out .= 'Content-Length: ' . strlen($data) . '\r\n\r\n';
$out .= "Connection: Close\r\n\r\n";
// Send the HTTP data

fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}

// Close the connection
fclose($fp);
}

}

?>


What this script does, is that it 'forwards' all incoming POST data arriving on your oldIPN script URL automatically to your new IPN script URL.

That way, your new IPN script will always receive the IPN data, even if it was sent to the old URL.

I agree it's a bit of a workaroud, but at least you'll be able to receive your IPN data again.



Hope this was useful. Unfortunately I don't have an example in any other languages, but if you are (or have) a developer, they should be able to create a similar file for you fairly quickly.



-Rob
 
Recurring user upgrades cannot be imported, mostly due to the IPN side of things. Redirecting the request is not sufficient because XenForo uses a different structure for some fields.

As it stands, the only option is to cancel the recurring subscriptions on PayPal and have people resubscribe via XF.
 
Saw this on the PayPal community help board, untested:
Hi Mike. I think we all understand that and are fine with it. I think we all just want to keep those paymants coming in until we can get our members to cancel and upgrade on Xenforo, nothing more.
 
Last edited:
Recurring user upgrades cannot be imported, mostly due to the IPN side of things. Redirecting the request is not sufficient because XenForo uses a different structure for some fields.

As it stands, the only option is to cancel the recurring subscriptions on PayPal and have people resubscribe via XF.

Hi Mike - I guess I will go that route. A small pain for me with less than two dozens subscribers, but for those with a 100 or more, this is a brutal pain to migration.
 
Recurring user upgrades cannot be imported, mostly due to the IPN side of things. Redirecting the request is not sufficient because XenForo uses a different structure for some fields.

As it stands, the only option is to cancel the recurring subscriptions on PayPal and have people resubscribe via XF.
Hi Mike - I guess I will go that route. A small pain for me with less than two dozens subscribers, but for those with a 100 or more, this is a brutal pain to migration.
I have over 250 losing them is not an option for me. That money pays server fees.

Those are the recurring ones, I'm not worried about the other subs just those.
 
Just tell them that their subscriptions are valid till the first of next month (give some of them some grace time) and then after that they will have to resubscribe through the new system as all subscriptions from the vB days will be cancelled and they have to resubscribe. Cancel the recurring payments from PayPal and have them resubscribe again under XenForo.
You may lose a little money (depends on how much time you allow between the last valid renewal date and forcing new subscriptions.
 
Just tell them that their subscriptions are valid till the first of next month (give some of them some grace time) and then after that they will have to resubscribe through the new system as all subscriptions from the vB days will be cancelled and they have to resubscribe. Cancel the recurring payments from PayPal and have them resubscribe again under XenForo.
You may lose a little money (depends on how much time you allow between the last valid renewal date and forcing new subscriptions.
No problem there. The problem lies in the paypal IPN errors. Just to stop those would do the trick.
 
The only way to stop an IPN is to stop the subscription. PayPal provides basically no control over this (presumably for security reasons).
 
The only way to stop an IPN is to stop the subscription. PayPal provides basically no control over this (presumably for security reasons).
Mike let me ask you this. what if I i left:

/includes
/vb
payment_gateway.php

in the root? Would that keep paypal happy?
 
If your goal is just to stop the errors, make an empty payment_gateway.php file and put it in the correct location and that should be fine (just needs to return a 200 OK message which it will do by default). But that won't actually do anything. It will effectively throw away the IPN message.
 
Mike let me ask you this. what if I i left:

/includes
/vb
payment_gateway.php

in the root? Would that keep paypal happy?
Thank you Mike. That is all i needed. that buys me time to get my members to cancel and re-subscribe.

Stopping the errors during that process is important i think because i have read of cases where PayPal will lock your account if you get too many.
 
By the way loving Xenforo. Everything that used to take me ages to figure out on VB is now taking me minutes in Xenforo.

Everything from CDN to plug-ins are so much easier.
Thanks for all the hard work.
 
Top Bottom