Paypal IPN HTTPS for an old version of MemberShip

  • Tavernier
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 days ago #112851 by Tavernier
Hello,

I read all the forum but I did not find any precise answer to my question..

I use an older version of MemberShip Pro (2.3.0 October 2015), do I have to do anything to comply with the new paypal security rules ?

For the moment, I don't have any budget to upgrade the MemberShip new version ...

I saw that you gave a hack for joomla 2.5, so - in my dreams - I would just like the same for joomla 3

Thanks for your help

Regards

Christine

Please Log in or Create an account to join the conversation.

More
7 years 4 days ago #112864 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Paypal IPN HTTPS for an old version of MemberShip
Hi Christine

I am sorry, there are different versions of Membership Pro and the code for PayPal payment plugin is different for each version, so I could not give patch for all versions of Membership Pro

So if you could not afford to upgrade the extension, you will have to modify the code of the PayPal payment plugin yourself

I remember that I posted the instructions (for Joomla 2.5 if I remember correctly) and seems you found it. You can follow that instructions to modify code and it should be fine.

Regards

Tuan

Please Log in or Create an account to join the conversation.

  • Tavernier
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 days ago #112935 by Tavernier
Hi Tuan

Thank you ! you are always so quick in your answers :-)

Indeed, I found a code for event booking joomla 2.5
www.joomdonation.com/forum/events-bookin...html?start=10#111999

but it's really different from what I have in my paypal membership plugin ... so I will not dare to transform this code

com_osmembership/plugins/os_paypal.php
Code:
protected function validate () { $ errNum = ""; $ errStr = ""; $ urlParsed = parse_url ($ this-> url); $ host = $ urlParsed ['host']; $ path = $ urlParsed ['path']; $ postString = ''; $ response = ''; $ this-> notificationData = $ _POST; foreach ($ _POST as $ key => $ value) { $ postString. = $ key. '='. urlencode (stripslashes ($ value)). '&'; } $ postString. = 'cmd = _notify-validate'; $ fp = fsockopen ($ host, '80', $ errNum, $ errStr, 30); if (! $ fp) { $ response = 'Could not open SSL connection to'. $ This-> url; $ This-> logGatewayData ($ response); return false; } fputs ($ fp, "POST $ path HTTP / 1.1 \ r \ n"); fputs ($ fp, "Host: $ host \ r \ n"); fputs ($ fp, "Content-type: application / x-www-form-urlencoded \ r \ n"); fputs ($ fp, "Content-length:". strlen ($ postString). "\ r \ n"); fputs ($ fp, "Connection: close \ r \ n"); fputs ($ fp, $ postString. "\ r \ n \ r \ n"); while (! feof ($ fp)) { $ response. = fgets ($ fp, 1024); } fclose ($ fp); $ This-> logGatewayData ($ response); if (! $ this-> mode || stristr ($ response, "VERIFIED")) { return true; } return false; }

I understand very well that you could not work for all the versions of the different products that you offer. So I will buy the version of membership pro unless you tell me that I can replace without worry by the code of events-booking joomla 2.5 ?

Thank's

Regards

Christine

Please Log in or Create an account to join the conversation.

More
7 years 2 days ago #112964 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Paypal IPN HTTPS for an old version of MemberShip
So here are the guides for someone still uses Joomla 2.5

1. Get this zip file, unzip it, you will see a folder called paypal

2. Upload that folder to components/com_osmembership/plugins folder on your site

3. Open the file components/com_osmembership/plugins/os_paypal.php, you will see a function called validate, replace the code of that function with this code:
Code:
protected function validate() { JLoader::register('PaypalIPN', JPATH_ROOT . '/components/com_osmembership/plugins/paypal/PayPalIPN.php'); $ipn = new PaypalIPN; // Use sandbox URL if test mode is configured if (!$this->mode) { $ipn->useSandbox(); } // Disable use custom certs $ipn->usePHPCerts(); $this->notificationData = $_POST; try { $valid = $ipn->verifyIPN(); $this->logGatewayData($ipn->getResponse()); if (!$this->mode || $valid) { return true; } return false; } catch (Exception $e) { $this->logGatewayData($e->getMessage()); return false; } }

4. Contact your hosting provider, ask them to make sure your server supports TLS 1.2

5. Run a test, check and make sure it is working as expected

If the patch works for you, then it's good. If not, you will need to purchase latest version of Membership Pro to have it works out of the box. You should not running on a very old version of the extension on your site

Tuan
Attachments:

Please Log in or Create an account to join the conversation.

  • Tavernier
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 10 hours ago #113149 by Tavernier
Thank you Tuan but I 'm sorry it does not answer my question...

My site is under joomla 3 with membership 2.3.0. and migrated to HTTPS

Will IPN work fine with the new paypal security standard ? or do I have to buy the new version of membership?

This may interest other people to know from which version of Membership everything works well with paypal now ?

My english is bad, so I hope my question is clear...

Thanks

Regards

Christine

Please Log in or Create an account to join the conversation.

More
6 years 11 months ago #113177 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Paypal IPN HTTPS for an old version of MemberShip
Hi Christine

I don't remember exactly the version it was added, but at least it has to be from 2.10.x.If you use older version of Membership Pro, and could not afford to update, then you will need to modify code yourself base on my instructions at www.joomdonation.com/forum/membership-pr...mbership.html#112964

Better, upgrade to latest version of the extension if it's possible

Regards,

Tuan

Please Log in or Create an account to join the conversation.