Multiples IPN (Dynamically Setting the Notification URL)

Hi,

Please, may you add Multiple IPN support? (Dynamically Setting the Notification URL)

https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_admin_IPNSetup#id091GJ202030

If you add this feature, we can use the same Paypal account on many sites.

Thank you

  • Aaron
    • CTO

    Unfortunatley PayPal Express Checkout and Pro recurring payments do no support this. Sucks I know. The only way to get around this is to use a central IPN forwarder which redirects IPNs to the proper locations. Support for this is built into Pro Sites as we do this for our Incsub sites (WPMU DEV, BuddyDress, Edublogs, etc.).

    Here are the relevant bits in the paypal gateway code:

    /* This sets the default prefix to the paypal custom field,
    		 * in case you use the same account for multiple IPN requiring scripts,
    		 * and want to setup your own forwarding script somewhere to pass IPNs to
    		 * the proper location. If that is the case you will also need to define
    		 * PSTS_IPN_PASSWORD and post "inc_pass" along with the IPN string.
    		 */
        if ( !defined('PSTS_PYPL_PREFIX') )
          define('PSTS_PYPL_PREFIX', 'psts');

    And

    } else if ( defined('PSTS_IPN_PASSWORD') && $_POST['inc_pass'] != PSTS_IPN_PASSWORD ) {
    
    		  header("HTTP/1.1 401 Authorization Required");
    			die('Error: Missing a valid IPN forwarding password. Identification is not possible.');
    
    		} else {
    
    			//if not using an IPN forwarder check the request
    			if ( !defined('PSTS_IPN_PASSWORD') ) {

    So basically define PSTS_IPN_PASSWORD and PSTS_PYPL_PREFIX in the wp-config.php file, and make sure those match your IPN forwarder. I'm attaching an example IPN forwarder here:

  • Aaron
    • CTO

    Well put the forwarder somewhere web accessible. The URL to that is what you enter into your paypal account. Also make sure there's a /logs/ directory there and that it's writable.

    Configure a password in the header of it, as well as your sites and the prefix to use for each.

    On each pro sites install, define PSTS_IPN_PASSWORD and PSTS_PYPL_PREFIX in the wp-config.php file, and make sure those match your IPN forwarder settings.

  • jcnjr
    • HummingBird

    We need to get IPN working for multiple domains ASAP too, and could use a bit more direction here. Does thorough documentation for this exist anywhere?

    Configure a password in the header of it, as well as your sites and the prefix to use for each.

    "It" being what, the forwarder file? By "in the header" do you mean the configuration section defining INC_PASS?

    I also notice the forwarder posted above is a plugin? Should it reside in the Plugins folder? Aaron only says put it "somewhere web accessible".

    On each pro sites install, define PSTS_IPN_PASSWORD and PSTS_PYPL_PREFIX in the wp-config.php file

    What exact code needs to be added to wp_config and where?

    I'm attaching an example IPN forwarder

    Aside from defining the "INC_PASS" password, are edits required other than configuring the following array? Please see my related questions that follow.

    array('prefix' => 'app1',
            'domain' => 'mysite.com',
            'path'   => '/ipn-handler.php',
            'live'   => true),

    Can we include any number of apps without making changes elsewhere? (i.e.; app1, app2, app3, app4) Only two are listed in the array.

    The path points to ipn-handler.php, not ipn-forwarder.php. Where does such a file exist? Is this the path generated after installing Pro Sites? (i.e.; /wp-admin/admin-ajax.php?action=psts_pypl_ipn) If Membership and Pro Sites are both installed, I presume they would both need an app configured in the forwarder.

    Thanks for the help. Looking forward to getting this figured out soon.

  • Aaron
    • CTO

    So in each pro sites WP install, add these to the wp-config (w/customized values of course):

    define('PSTS_IPN_PASSWORD', 'mypassword');
    define('PSTS_PYPL_PREFIX', 'site1');

    The pass is shared between all installs, the prefix should be short. It's just what the forwarder looks for to know what url to send the IPN to.

    Then put your forwarder somewhere, say at http://mysite.com/ipns/ipn-forwarder.php. Note this is not a plugin, just a standalone php script. It's not even only for pro sites, could be used with any program you have that needs an IPNs forwarded. Edit the top of ipn-forwarder.php. You need to change the INC_PASS to "mypassword" and configure any pro sites installs there in the array. You can add 100 if you want, just add more to the array. The ones there are just an example. So for example to configure the first site:

    array('prefix' => 'site1',
            'domain' => 'mysite.com',
            'path'   => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',
            'live'   => true),

    Then maybe another site:

    array('prefix' => 'site2',
            'domain' => 'myothersite.com',
            'path'   => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',
            'live'   => true),

    I hope that's clear enough?

  • jcnjr
    • HummingBird

    OK, thanks. I have followed all the directions exactly, turned notifications back on, and am waiting to see if the forwarder is working. Just a couple more questions:

    1. I presumed an app/site must be added to the array for the domain where the forwarder is installed, if that domain is to run Pro Sites, membership, etc. Correct?

    2. Does the Pro Sites and/or Membership plugin have to be activated on a given site for the forwarder to work at that domain? We have not yet installed either plugin at one of the my sites in the forwarder array.

    3. I guess I just don't understand how the IPN url works. The psts_pypl_ipn action is nowhere to be found in admin-ajax.php, but if I load the url in a browser, I do get a blank page with a single "0" at top left.

    Thanks again for your help!

  • NetFlint
    • WPMU DEV Initiate

    I'm looking for a little clarity on the PSTS_IPN_PASSWORD and inc_pass.

    Is it correct that this password is just a password that I make up to make sure that the ipn-forwarder.php is the one I configured to talk to my prosites installation and vice versa? It's not supposed to be my API password or anything like that right?

    Thanks.

  • jcnjr
    • HummingBird

    this password is just a password that I make up to make sure that the ipn-forwarder.php is the one I configured to talk to my prosites installation

    Correct. Just make sure the password matches in the forwarder and wp-config files for all sites where pro sites is installed.

    Looking forward to hearing if your IPNs get logged by the forwarder.

  • NetFlint
    • WPMU DEV Initiate

    Hi JCNJR,
    When I use the IPN Simulator tool in the sandbox, ipn-forwarder.php writes to the log file in the log directory I created. (At least it did after I got the permissions set up correctly on that directory.) It does not write to that log file when I am playing with sandbox accounts. Is it supposed to?

    I was able to use sandbox accounts to create and cancel subscriptions and those messages seem to show up in the Pro Sites Management dashboard account history section as well as actually reflecting in the account durations of the sites I created. I assume that means PayPal and prosites are talking to each other.

    I do get this message in Account History when using the sandbox accounts:
    "User modifying subscription via PayPal Express: PayPal returned an error: The token is invalid"
    It is unclear from your other thread whether this is expected or not when using sandbox accounts.

    One other point for anyone else trying this, In the sample ipn-forwarder.php file Aaron provided above, there is a comma missing at the end of the last line of the second sample app array. I was getting some error messages until I figure that out.

    Cheers!

  • jcnjr
    • HummingBird

    When I use the IPN Simulator tool in the sandbox, ipn-forwarder.php writes to the log file... It does not write to that log file when I am playing with sandbox accounts. Is it supposed to?

    This is the exact same issue I reported, that has me concerned about going live since it indicates IPNs are not being sent for actual transactions. I haven't yet been able to get a response as to why, or like you ask, whether Sandbox transactions get logged.

    My next step is to test live transactions with two real PayPal accounts on our dev install. Guess that's the only way to find out for sure if the forwarder is working.

    I also asked about the invalid token error here, but haven't received any feedback about that.

  • NetFlint
    • WPMU DEV Initiate

    Thanks Aaron.

    I don't think I had an opportunity to configure IPN for my sandbox account and I don't see anyplace to set it. Perhaps that's because I chose a quick "preconfigured" sandbox account. I guess, I will go through the process of creating a manual sandbox account and see if that gives me the appropriate options.

  • NetFlint
    • WPMU DEV Initiate

    Okay. I figured out how to configure IPN on my sandbox account. (After setting up the sandbox accounts at developer.paypal.com, I had to log in with my test business account at sandbox.paypal.com and then go to My Account > Profile > More Options in the third column under Selling Preferences select Instant Payment Notification Preferences. Then I entered the URL for my ipn-forwarder.php

    Now when I use the sand box buyer account to upgrade to a prosite, I am getting messages in my IPN logs. However, the messages aren't good. Have you seen this error before:
    [2011-12-19 22:30:09] Could not contact neighborlymedia.com/wp-admin/admin-ajax.php?action=psts_pypl_ipn to send the IPN: HTTP/1.1 302 Moved Temporarily (this is followed by the transaction details.)

    If I enter neighborlymedia.com/wp-admin/admin-ajax.php?action=psts_pypl_ipn directly in the browser I get:
    Error: Missing POST variables. Identification is not possible.

    Any insight into where I should check next?

    Thank you.

  • ilokano
    • Flash Drive

    I'm having the same problem:

    [2011-12-22 18:19:14] Could not contact pinoyfitnesscoach.com/wp-admin/admin-ajax.php?action=psts_pypl_ipn to send the IPN: HTTP/1.1 302 Moved Temporarily

    ... any chance this problem has been fixed? Thanks!

  • nphaskins
    • Flash Drive

    Hey Aaron,
    I've read through your post quite a few times, but I don't have multiple pro site installs. I have one installation of Pro Sites, and an e-store built on Wordpress that's setup with the IPN from Paypal.

    However, Pro Sites needs the IPN as well, which is why i'm asking a question about the forwarder that I need to make things work properly.

    Do I place this in the other installation of WP, the one running the estore (with changed values of course)?
    define('PSTS_IPN_PASSWORD', 'mypassword');
    define('PSTS_PYPL_PREFIX', 'site1');

    Nick

  • ilokano
    • Flash Drive

    Great that it's been fixed. However, I have tried installing Pro Sites on two different domains and checked the PayPal payment (real payment using a friends' PayPal acct) on both sites with IPN turned off and both sites seem to work fine. The user accounts are upgraded to Pro with all Pro features activated and I am able to receive payment even without IPN turned on.

    I also tried unsubscribing via the Pro Site unsubscribe button, and that seems to work fine too.

    So forgive me if this is a stupid question but what is the IPN for? I would like to know before I try to install the IPN forwarder again. Also, I am using PayPal for another invoicing tool so if this is going to present a problem with non-Pro Site sites, then I would rather leave things as they are now.

  • nphaskins
    • Flash Drive

    Well that settles that then. Thanks for your input Aaron. I'd definitely want it setup right from the start.

    Hey Aaron, I had a question above. Those two lines, am I correct in placing those in the other Wordpress install in wp-config? I've read through your instructions and they do seem pretty straight forward but wanted to make sure, as I'm not dealing with 2 Pro Sites installs.

    Thanks for your contributions man! And Merry Christmas Eve! I thought I was the only one crazy enough to be working today. :wink:

    Nick

  • NetFlint
    • WPMU DEV Initiate

    I'm not sure why I'm doing this on Christmas day, but I wanted to let you know that the new IPN Forwarder is working for me now.

    [2011-12-25 17:11:17] Successfuly sent to neighborlymedia.com/wp-admin/admin-ajax.php?action=psts_pypl_ipn:

    Thank you for your efforts.

    Merry Christmas.

  • Jason
    • The Bug Hunter

    Guys, this is exactly what I needed.

    But is there an easy 1,2,3 step to follow that consolidate what was discussed here? Maybe one of the members who got it to work for subscription based sites may be able to do this.

    It seems str forward but the back and forth of any good discussion may seem to be confusing to a newbie like myself.

    Thanks in advanced.

  • Jason
    • The Bug Hunter

    So I gave it a try
    ----------------------------------------------------------------------------------
    1. I downloaded the ipn forwarded and uploaded it at mysite.com/ipn/ipn-forwarder.php and updated the following with my site information (4 arrays for 4 networks)

    define('INC_PASS', 'mypassword');

    array('prefix' => 'site1',
            'domain' => 'mysite1.com',
            'path'   => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',
            'live'   => true),
    array('prefix' => 'site2',
            'domain' => 'mysite2.com',
            'path'   => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',
            'live'   => true),

    etc

    2. I updated the wpconfig file for each of the four networks like below with my site info

    define('PSTS_IPN_PASSWORD', 'mypassword');
    define('PSTS_PYPL_PREFIX', 'site1');
    define('PSTS_IPN_PASSWORD', 'mypassword');
    define('PSTS_PYPL_PREFIX', 'site2');

    `
    etc

    3. I then added the IPN forwarder URL to my Paypal profile
    mysite.com/ipn/ipn-forwarder.php

    End of steps. Was this set up correctly? Any steps missed?
    -------------------------------------------------------------------------------------------------

    When I go to the IPN URL on my site I get the following error:

    Parse error: syntax error, unexpected T_ARRAY, expecting ')' in /home/infotech/public_html/ipn/ipn-forwarder.php on line 38

    Is this normal or is the page suppose to be blank?

  • jcnjr
    • HummingBird

    You're not going to see anything when visiting the forward url as it does all its work behind the scene, and only works properly when it receives the proper ipn parameters.

    As for the unexpected T_ARRAY, Aaron or another developer would have to address that. Normally you would get an error more like, "Error: Missing POST variables. Identification is not possible." because no variables get sent when loading the forwarder in your browser.

  • Jason
    • The Bug Hunter

    Thanks so much for your quick reply! The entire array set is attached. Thank you for any help you can offer!

    // An array of prefix to search for, domain and path to post to, and whether we're using 
    
    sandbox or not for applications
    $apps = array(
      /* App 1 */
      array('prefix' => 'magi',
            'domain' => 'maginable.com',
            'path'   => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',
            'live'   => true),
    
      /* App2 */
      array('prefix' => 'sdat',
            'domain' => 'sdatt.org',
            'path'   => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',
            'live'   => true)
    
       /* App2 */
      array('prefix' => 'huce',
            'domain' => 'huceacs.com',
            'path'   => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',
            'live'   => true)
    
       /* App2 */
      array('prefix' => 'cari',
            'domain' => 'caribbeanthings.com',
            'path'   => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',
            'live'   => true)
    );
  • jcnjr
    • HummingBird

    I was afraid of opening that can of worms... There are many steps required to test PayPal functions in Sandbox mode. If you do not already have a developer account set up, I might suggest you keep the fowarder in live mode and test IPNs using a real transaction. Otherwise, follow the links on the Pro Sites plugin admin page to learn about using Sandbox.

    More info available at https://developer.paypal.com/

  • Jason
    • The Bug Hunter

    Hello Guys,

    So I believe the developer once said that we can use this for even other transactions outside of prosites and WPMU setups.

    I have a billing software setup (WHMCS) and they are telling me the following:

    (You must enable IPN inside your PayPal account and set the URL to http://www.mysite.com/billing)

    However, I already have the set IPN forwarder url entered in paypal.

    http://mysite.com/ipn/ipn-forwarder.php

    I know I edited the ipn-forwarder.php and the wp-config files for the WPMU sites but for this system, how do I get it to work with the same ipn fwd url.

    Any suggestions?

  • jcnjr
    • HummingBird

    @becky We have the IPN forward functioning with current Pro Sites running on multiple domains. Aaron may be able to address the specific error code, but using Sandbox can be tricky. Be sure to use all PayPal settings from the Sandbox account, set the IPN URL in the sandbox, and set the site to test mode both via the Pro Sites settings and in the array. Hoe this helps...

  • Aphrodite
    • The Reaper

    sorry a clarification about path.

    in the script we have

    'path' => '/ipn-handler.php',

    here we are said to set 'path' => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',

    And in that case, where the H.... the script must be uploaded ?

    And finally which ipn url must i setup in paypal ?

    i am a little lost.

    Which one should i setup ?

    thanks !
    And big thanks by the way for that solution !

  • jcnjr
    • HummingBird

    @Aphrodite FYI: i was lost too, but now have the forwarder working as follows...

    Upload the ipn-forwarder.php script to a new /ipn folder at the root of yourdomain.com. Be sure to create a /logs folder in that same directory (i.e.: /ipn/logs).

    Point your PayPal IPN URL to yourdomain.com/ipn/ipn-forwarder.php

    Update the forwarder script with your-password:
    define('INC_PASS', 'your-password');

    And modify the array for your sites, i.e.:

    /* Site 1 DomainX */
      array('prefix' => 'site1',
            'domain' => 'domainx.com',
            'path'   => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',
            'live'   => true),
    
      /* Site 2 DomainY */
      array('prefix' => 'site2',
            'domain' => 'domainy.com',
            'path'   => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',
            'live'   => true),

    Update wp-config for each domain with:

    /* For IPN Forwarding */
    define('PSTS_IPN_PASSWORD', 'your-password');
    define('PSTS_PYPL_PREFIX', 'site-prefix-from-ipn-app-array');

    Hope this helps!

    My question for Aaron is, does WPMU Dev plan to make this a plugin? I would like to write about this solution and offer the script for use, but I'd gladly wait and point people to the plugin here for download via an affiliate link.

  • jcnjr
    • HummingBird

    I assume I must do that with the main site, the one registered in paypal ?

    Where you put the forwarder has nothing to do with any sites in the array. But yes, mine does reside at the same domain as my main site. The IPN URL you enter in your PayPal notifications settings just has to match wherever you put the forwarder.

    the path mentioned in the script confused me

    I believe "/ipn-handler.php" is intended as place-holder since the handler may be different for some users. It confused me at first too but Aaron clarified that above.

  • Jason
    • The Bug Hunter

    As far as multiple websites including whmcs,some of you may find this helpful or help answer my questions

    WHMCS does send the notify_url with each invoice payment. We used to advise everyone to leave the IPN URL in their PayPal profile blank, but it's no longer allowed by PayPal so we simply ask to enter the URL of your WHMCS install instead.

    You can enter whatever you want there, it won't have an impact on WHMCS.

    http://forum.whmcs.com/showthread.php?31913-PayPal-IPN-Notification-URL

    Am i not sure if i can assume that it would work without modifying the code or setting above. I am not sure

  • applemarketing
    • Site Builder, Child of Zeus

    I'm wondering, will the IPN forwarder work with Pro Sites & Gravity Forms PayPal Add-on? I'm working on a project where we will take a setup fee, create the user / blog with Gravity Forms and then the user will "upgrade" with Pro Sites to enable features.

  • Jamin
    • Site Builder, Child of Zeus

    I am interested in this.

    I have a slightly different situation though.

    I have 1 WP Multisite install which is running the plugin "Network of Networks".

    Plugin Here: http://wordpress.org/extend/plugins/networks-for-wordpress/

    I only have 1 wp-config.php but it is running multiple sub domain networks.

    How do I define the subdomain IPN address?

    These are the 4 IPN address I wish to forward.

    http://freemusic.customtabs.co.nz/wp-admin/admin-ajax.php?action=psts_pypl_ipn
    http://competitions.customtabs.co.nz/wp-admin/admin-ajax.php?action=psts_pypl_ipn
    http://apps.customtabs.co.nz/wp-admin/admin-ajax.php?action=psts_pypl_ipn
    http://hosting.customtabs.co.nz/wp-admin/admin-ajax.php?action=psts_pypl_ipn

    All of these are on the same WP install.

    EDIT:

    I am thinking I would have to make a plugin file and just run the code

    $network = str_replace('/','',str_replace('http://','',network_home_url()));
    if($network = 'hosting.customtabs.co.nz'){
    define('PSTS_PYPL_PREFIX', 'hosting');
    } elseif($network = 'apps.customtabs.co.nz'){
    define('PSTS_PYPL_PREFIX', 'apps');
    } elseif($network = 'freemusic.customtabs.co.nz'){
    define('PSTS_PYPL_PREFIX', 'freemusic');
    } elseif($network = 'competitions.customtabs.co.nz'){
    define('PSTS_PYPL_PREFIX', 'competitions');
    }

    Would something like that work?

  • Aaron
    • CTO

    Actually, if it's the same WP install then you can set it up normally. Pro sites is network agnostic (it only goes by blog_id), so you should only need to setup the prefix for one of the sites, and use that in the IPN url in paypal. It will catch IPNs from all networks and apply them to the proper blogs.

  • lee_down
    • Site Builder, Child of Zeus

    I need help with the wp-config for this

    I have multiple multisites installed for niche client sites.

    The top-parent domain I'm okay with setting up the ipn forwarder and adjusting the wp-config, but I don't know what to do about other domains hosted on the same network.

    Example

    SafetyLives.com is set up with the

    /* App5 */
    array('prefix' => 'app5',
    'domain' => 'safetylives.com',
    'path' => '/wp-admin/admin-ajax.php?action=psts_pypl_ipn',
    'live' => false),

    And the wp-config specifies

    define('PSTS_IPN_PASSWORD', '######');
    define('PSTS_PYPL_PREFIX', 'app5');

    Now I also have another site under safetylives.com, mapped to biomedwashcanada.com

    I want that domain to also run paypal transactions and will have to set up an ipn forwarder for that, which I have - it is App6

    Do I add

    define('PSTS_PYPL_PREFIX', 'App6');

    Or is there some other approach I should be aware of?

    Thanks

  • lee_down
    • Site Builder, Child of Zeus

    Yes, it is a subsite

    but how does the ipn handle the request from biomedwashcanada.com ?

    I'm seting up the ipn forwarder and config files for safetylives.com
    do I set it up for biomedwashcanada.com too?

    And what does that look like if I have to do that?

  • lee_down
    • Site Builder, Child of Zeus

    I know I'm a little thick when it comes to this stuff, and I know it can annoying. But really, I need things spelled out in black and white, or I'm lost.

    I am lost.

    I want to put an ipn forwarder in the right place to handle multiple multisite installs so it can handle transactions from whatever is running - whether it is a prosite transaction on one site, or a directory listing on another domain.

    and I want to be certain I have the correct wp-config settings for each affected installation and the subset of domains hosted with them.

  • Aaron
    • CTO

    Sorry, you have me confused too. The IPN forwarder is only for Pro sites.

    So whatever wordpress multisite install (whereever it is) that you have Pro sites installed on needs to have the IPN credentials in it's wp-config.php

    Then whereever you install the ipn forwarder, you will configure it with the ipn urls for all those sites.

  • lee_down
    • Site Builder, Child of Zeus

    So.... how do we process payments for the directory listings, or marketpress, etc., without using the IPN forwarder?

    I'm rather confused by what I need to do to set things up properly.

    I'll have 3 instances of Prosites running, and hopefully a fourth in a few months.

    Underneath all of this, will be different sites offering different products or services from within my tribes. I plan on having some of my own commerce running as well.

    I want to ensure that I've set up the paypal payment items 100% accurate. My techie abilities are very gui based.

  • JJS
    • Design Lord, Child of Thor

    Not sure if I need to do this.

    I have a site where the users will be able to choose if they want a store or not, it will be a sub domain at x.mysite.com. In the store they should be able to make their OWN subscriptions since like you said Pro Site is in every multisite sub domain.

    Do I still need to do this? I added the IPN url to PayPal and that's about it.

  • SooBahkDo
    • Syntax Hero

    Hello,

    We are in need of a solution to allow multiple applications on one multisite network to use the same PayPal account and I am curious if anyone has experience with this IPN Redirect plugin?

    http://wickedcoolplugins.com/the-plugins/ipn-redirect/

    They have a video on the pitch page that is insightful and informative.

    I have purchased it and will be testing and report back, but if anyone else has experience with it, your comments would be appreciated.

    They automatically set you up as an affiliate as soon as your order is done.
    For example this is the affiliate link they assigned us
    http://wickedcoolplugins.com/dap/a/?a=12275

    Perhaps WPMUDEV would consider packaging all this IPN code discussed in this thread into a nice neat plugin? hint hint

    I'll report back after some testing on a network with about 6 different applications that all need to use the same PayPal account.

    Phil D

  • jcnjr
    • HummingBird

    @Aaron I apologize in advance for the length of this post. I just need to know if the following notice from PayPal will affect your IPN Forwarder script in any way. Or Pro Sites and Marketpress for that matter.

    Will it? Thanks!

    From PayPal:

    In a bulletin dated October 18, 2011, we announced that we were going to expand the number of IP addresses for http://www.paypal.com to improve our site’s performance, scalability and availability. As part of this transition, we planned to discontinue support for HTTP 1.0 protocol starting October 7, 2013.

    We have recently identified that this change may impact the ability of some of our merchants to perform IPN (Instant Payment Notification) post-back validation or PDT (Payment Data Transfer) posts to http://www.paypal.com and ipnpb.paypal.com. This happens when the IPN or PDT scripts use HTTP 1.0 protocol and do not include the “Host: http://www.paypal.com” or “Host: ipnpb.paypal.com” header in the HTTP request.

    Additional Details

    Starting October 7, 2013, we will require all incoming requests to have a “Host” header which complies with HTTP 1.1 Specifications. This header was not required under HTTP 1.0. IPN and PDT scripts using HTTP 1.0 may start failing with “HTTP/1.0 400 Bad Request” errors after October 7, 2013, which will result in IPN messages not being validated successfully, or PDT scripts not being able to retrieve transaction information.

    Action Required before October 7, 2013

    Merchants need to update their IPN and/or PDT scripts to use HTTP 1.1, and include the “Host” and “Connection: close” HTTP header in the IPN postback script.

    Example with Host as http://www.paypal.com (please make necessary changes if you are using ipnpb.paypal.com):

    ASP
    //Set values for the request back
    req.Method="POST";
    req.Host="'www.paypal.com'";
    req.ContentType="application/x-www-form-urlencoded";

    Perl
    $req=HTTP::Request->new('POST', 'https://www.paypal.com/cgi-bin/webscr');
    $req->content_type('application/x-www-form-urlencoded');
    $req->header(Host=> 'www.paypal.com');
    $req->header(Connection=> 'close');
    PHP
    // post back to PayPal system to validate
    $header="POST /cgi-bin/webscr HTTP/1.1\r\n";
    $header .="Content-Type: application/x-www-form-urlencoded\r\n";
    $header .="Host: http://www.paypal.com\r\n";
    $header .="Connection: close\r\n\r\n";

    Java
    HttpsURLConnection uc=(HttpsURLConnection) u.openConnection();
    uc.setDoOutput(true);
    uc.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
    uc.setRequestProperty("Host", "www.paypal.com");
    uc.setRequestProperty("Connection", "Close");

    The PayPal Sandbox has been configured to reject any HTTP requests without the “Host” header with HTTP 400 error. Merchants can use the Sandbox environment to certify the changes to their IPN and PDT scripts.

    For more information on PDT and IPN, please refer to http://www.paypal.com/pdt and http://www.paypal.com/ipn. For additional information or questions about this change, please contact PayPal's Merchant Technical Support team via https://www.paypal.com/mts.

    Sincerely,

    PayPal

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.