Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / PayPal IPN Verification Postback to HTTPS with v1.3.8

PayPal IPN Verification Postback to HTTPS with v1.3.8

Views: 8,850

Results 1 to 20 of 28
7 Mar 2016, 11:39 AM
#1
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

PayPal IPN Verification Postback to HTTPS with v1.3.8

Hi,

I havn't been able to find much about this.
I received an e-mail from PayPal informing me about changes that are coming.
Paypal has identified areas of my integration that may need to be upgraded (see attachment).
1 change has been identified according to PayPal: IPN Verification Postback to HTTPS
They added a link with information regarding this subject: https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1916&viewlocale=en_US

I am not sure if and what I need to do in order to fix is.
Any one else received this e-mail?

Any help is appreciated.

Thank you.

7 Mar 2016, 10:49 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

You need to upgrade your ZenCart install as the code it is based on is approx eight years old

8 Mar 2016, 8:15 AM
#3
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

kobra:

You need to upgrade your ZenCart install as the code it is based on is approx eight years old

Thank you. Are there other options besides upgrading Zen-Cart?

8 Mar 2016, 11:06 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

Are there other options besides upgrading Zen-Cart?
Not to my knowledge but it has been years since I have worked with 1.3.8a code

8 Mar 2016, 4:22 PM
#5
rayw1679 avatar

rayw1679

Zen Follower

Join Date:
Mar 2005
Location:
Waxahachie, Texas
Posts:
172
Plugin Contributions:
0

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

I am on 1.5.1 and have the same question. The e-mail they sent questioned my SSL certificate and "TLS 1.2 and HTTP/1.1 Upgrade." Are those host (1and1) questions or do I need to upgrade Zen Cart?

8 Mar 2016, 5:23 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

rayw1679:

I am on 1.5.1 and have the same question. The e-mail they sent questioned my SSL certificate and "TLS 1.2 and HTTP/1.1 Upgrade." Are those host (1and1) questions or do I need to upgrade Zen Cart?

They both are likely to require host intervention. The SSL part may be related to the SSL for your site, but more than likely is the SSL between your host and paypal not the SSL seen by a customer using your site. The TLS/HTTP issue I would say/expect is also a factor of your host with PayPal, but may also be a factor of the changes that were necessary to address POODLE and use of SSL3. I haven't seen any specific response/guidance yet related to that particular message, but seems to fall in line with previous discussions.

8 Mar 2016, 5:59 PM
#7
rayw1679 avatar

rayw1679

Zen Follower

Join Date:
Mar 2005
Location:
Waxahachie, Texas
Posts:
172
Plugin Contributions:
0

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

Thank you. We use a shared SSL with our host (1&1), so I called them. They are aware of the problem, but have no idea when they'll have our server upgraded. The PayPal deadline is 6/17/16. 1&1 is very economical (we pay about $100 a month for a managed server; Zen Cart runs very fast on it), but their customer service is lacking.

8 Mar 2016, 6:33 PM
#8
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

rayw1679:

Thank you. We use a shared SSL with our host (1&1), so I called them. They are aware of the problem, but have no idea when they'll have our server upgraded. The PayPal deadline is 6/17/16. 1&1 is very economical (we pay about $100 a month for a managed server; Zen Cart runs very fast on it), but their customer service is lacking.
I would be very pis..,. If I was paying $100 a month and was told that.

9 Mar 2016, 1:44 PM
#9
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

Any idea what I can do to fix my issue with PayPal? How could it change the IPN Verification Postback to HTTPS?

9 Mar 2016, 1:46 PM
#10
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

ferid:

Any idea what I can do to fix my issue with PayPal? How could it change the IPN Verification Postback to HTTPS?
I believe that the IPN Postback URL is set within your store's PayPal (not Zen Cart) account. Make sure that the URL starts with https.

10 Mar 2016, 12:36 AM
#11
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

lat9:

I believe that the IPN Postback URL is set within your store's PayPal (not Zen Cart) account. Make sure that the URL starts with https.
I just logged in to my PayPal account and was able to find the following settings:
Notification URL: https://[mysite]/ipn_main_handler.php
Message delivery: Enabled

Or maybe I need to make changes to ipn_main_handler.php?

When I check my PayPal settings in the web shop I find the following setting.
Mode for PayPal web services: https://www.paypal.com/cgi-bin/webscr
Could this be something?

10 Mar 2016, 6:20 AM
#12
moogawooga avatar

moogawooga

New Zenner

Join Date:
Apr 2013
Location:
United States
Posts:
11
Plugin Contributions:
0

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

lat9:

I believe that the IPN Postback URL is set within your store's PayPal (not Zen Cart) account. Make sure that the URL starts with https.

No, the IPN setting in the paypal account is about paypal talking to zencart via https.

The issue at hand is about zencart talking to paypal via https.
In the link from the OP paypal says that
(1) they have provided another endpoint where they want zencart to talk to them - ipnpb.paypal.com
(2) they want zencart to start talking to them via https
(3) after 9/30/2016 they will no longer listen to http even if zencart continues to talk to them there

10 Mar 2016, 3:19 PM
#13
moogawooga avatar

moogawooga

New Zenner

Join Date:
Apr 2013
Location:
United States
Posts:
11
Plugin Contributions:
0

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

As per this post by mc12345678 issue (2) and (3) in my post above are fixed in version 1.5.5

It's a simple change in the file includes/modules/payment/paypal/paypal_functions.php

Make the following replacement

    if ($mode == 'IPN') {
      ipn_debug_email('IPN INFO - POST VARS received (sorted):' . "\n" . stripslashes(urldecode(print_r($postdata_array, true))));
      if (sizeof($postdata_array) == 0) die('Nothing to process. Please return to home page.');
    }
    // send received data back to PayPal for validation
    $scheme = 'http://';
    //Parse url
    $web = parse_url($scheme . 'www.paypal.com/cgi-bin/webscr');
    if ((isset($_POST['test_ipn']) && $_POST['test_ipn'] == 1) || MODULE_PAYMENT_PAYPAL_HANDLER == 'sandbox') {
      $web = parse_url($scheme . 'www.sandbox.paypal.com/cgi-bin/webscr');
    }

with

    if ($mode == 'IPN') {
      ipn_debug_email('IPN INFO - POST VARS received (sorted):' . "\n" . stripslashes(urldecode(print_r($postdata_array, true))));
      if (sizeof($postdata_array) == 0) die('Nothing to process. Please return to home page.');
    }
    // send received data back to PayPal for validation
    $scheme = 'https://';
    //Parse url
    $web = parse_url($scheme . 'www.paypal.com/cgi-bin/webscr');
    if ((isset($_POST['test_ipn']) && $_POST['test_ipn'] == 1) || MODULE_PAYMENT_PAYPAL_HANDLER == 'sandbox') {
      $web = parse_url($scheme . 'www.sandbox.paypal.com/cgi-bin/webscr');
    }
10 Mar 2016, 7:54 PM
#14
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

Looks like an easy job. Except in my case my file looks different probably because I am running 138a.

I found the following section.

**
 * Verify IPN by sending it back to PayPal for confirmation
 */
  function ipn_postback($mode = 'IPN') {
    $info = '';
    $header = '';
    $scheme = 'http://';
    //if (ENABLE_SSL == 'true') $scheme = 'https://';
    //Parse url
    $web = parse_url($scheme . (defined('MODULE_PAYMENT_PAYPAL_HANDLER') ? MODULE_PAYMENT_PAYPAL_HANDLER : 'www.paypal.com/cgi-bin/webscr'));
    if (isset($_POST['test_ipn']) && $_POST['test_ipn'] == 1) {
      $web = parse_url($scheme . 'www.sandbox.paypal.com/cgi-bin/webscr');
    }

Couldn't I just activate the line: //if (ENABLE_SSL == 'true') $scheme = 'https://';
Or just set $scheme to https://

What would be the best course of action?

10 Mar 2016, 8:03 PM
#15
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

I havn't made any changes yet and wanted to see where zencart takes me if I place an order.
After I select paypal and confirm the order it takes me to https://www.paypal.com/nl/cgi-bin/webscr.
So it looks like this is ok. Or do I still have to set $scheme to https://?

10 Mar 2016, 9:07 PM
#16
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

So, to try to explain based on what appears to be happening... The $scheme variable appears to be associated with how the server communicates with paypal, not how the customer interacts with the site. Therefore, the previous suggestion to uncomment the line of code will not fully address the situation as that line ties the site's setup (customer's interaction with the site) to the communication of the site with paypal... So, simply uncommenting that line would only offer https: to paypal if the site also had a SSL and had it active. That though is not necessarily the requirement for that communication.

Regarding the "last" post above, the observation of the url being https: in the browser is the customer communication with paypal which also is outside the loop of the requirement being discussed. The IPN response is between paypal and the site and appearing to be a part of the site communicating to PayPal, not necessarily that PayPal is trying to reach the site (during the data transfer)... Therefore the two (URL in browser and the $scheme) are also separate.

So why is it just now that ZC is going this route in ZC 1.5.5? Well, it would seem that until the change in requirement by PayPal, ZC met the requirements of PayPal and with the upcoming change, it still will. (When the updated version is installed, or the applicable changes are discretely applied.)

Btw, I state the above from a standpoint of review in the last day, not from a position of authority.

11 Mar 2016, 10:46 AM
#17
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

Thank you for the clarification.
I will set $scheme variable to https. That should fix it for now.
Will have to see about upgrading Zen-Cart.

11 Mar 2016, 11:49 AM
#18
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

I've made the change. Turned on logging in the module settings and placed an order through the web shop (successfully).
Afterwards I was able to find a few log files.
2 of them contain a reference to IPN. I have copied a few lines from ipn_1457695299_IV51.log.

Mar 11 2016 12:21 -- IPN INFO - POST VARS to be sent back for validation: 
To: ssl://www.paypal.com:443
POST /cgi-bin/webscr HTTP/1.1
Host: www.paypal.com
Content-type: application/x-www-form-urlencoded
Content-length: 101
Connection: close

The second file also contains a few errors ipn_1457695301_EzA7.log

Mar 11 2016 12:21 -- IPN PROCESSING INITIATED. 
*** Originating IP: 173.0.81.1  notify.paypal.com
*** Browser/User Agent: PayPal IPN ( https://www.paypal.com/ipn )

Mar 11 2016 12:21 -- IPN FATAL ERROR :: Could not find stored session in DB, cannot re-create session as PayPal IPN transaction.

Mar 11 2016 12:21 -- IPN FATAL ERROR :: No saved IPN session data available. Must be an Express Checkout or Direct Pay transaction.

Mar 11 2016 12:21 -- IPN INFO - POST VARS received (sorted):
Array
(
Mar 11 2016 12:21 -- IPN INFO - Confirmation/Validation response 
SUCCESS

Mar 11 2016 12:21 -- Breakpoint: 1 - Collected data from PayPal notification

Mar 11 2016 12:21 -- IPN INFO :: Transaction email details.

Mar 11 2016 12:21 -- Breakpoint: 2 - Validated transaction components

Mar 11 2016 12:21 -- Breakpoint: 3 - Communication method verified

Mar 11 2016 12:21 -- Breakpoint: 4 - Details:  txn_type=unknown    ordersID = 0  IPN_id=0

   Relevant data from POST:
     txn_type = unknown
     parent_txn_id = None
     txn_id = xxxxxxxx (deleted by me)

Mar 11 2016 12:21 -- Breakpoint: 5 - Transaction type (txn_type) = unknown

Mar 11 2016 12:21 -- IPN WARNING :: Could not process for txn type: unknown
 postdata=transaction_subject= 
11 Mar 2016, 12:00 PM
#19
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

This line: > ssl://www.paypal.com:443

Looks unusual... It seems like it should be:

https://www.paypal.com:443

So not sure where that came from. Further, it is my understanding that because paypal is a module not just some randoom code that over time as paypal has changed other requirements that a more up-to-date version of the paypal payment module needs to be used than the version supplied with ZC 1.3.8...

Fyi, the upgrade? Not sure if I posted it, but suggested path would be: http://www.zen-cart.com/entry.php?3-How-do-I-rebuild-my-site-on-the-new-version-instead-of-upgrading

Really hoping that someone more involved with the project and specifically paypal portion comes across this and provides. Some more input. :/

12 Mar 2016, 7:22 AM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPal IPN Verification Postback to HTTPS with v1.3.8

mc12345678:

it is my understanding that because paypal is a module not just some randoom code that over time as paypal has changed other requirements that a more up-to-date version of the paypal payment module needs to be used than the version supplied with ZC 1.3.8...
Yes, and more than that: v1.3.8 had a lot of critical security flaws. A lot has been changed and improved and vastly altered since v138 was released back in 2007 ... almost a decade ago.