From f62480b7e6f5b59f925f677dfe7efdab187f1bd3 Mon Sep 17 00:00:00 2001 From: Carlo Capocasa Date: Tue, 14 Jan 2014 19:33:50 +0100 Subject: [PATCH 1/5] composer support via PSR-0 autoload --- composer.json | 10 ++++++++++ ipnlistener.php => lib/Quixotix/IpnListener.php | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 composer.json rename ipnlistener.php => lib/Quixotix/IpnListener.php (99%) diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..361f194 --- /dev/null +++ b/composer.json @@ -0,0 +1,10 @@ +{ + "name": "quixotix/paypalipn", + "version": "2.1.0", + "autoload": { + "psr-0": { + "Quixotix\\": "lib/" + } + } +} + diff --git a/ipnlistener.php b/lib/Quixotix/IpnListener.php similarity index 99% rename from ipnlistener.php rename to lib/Quixotix/IpnListener.php index bb8c93d..336ee71 100644 --- a/ipnlistener.php +++ b/lib/Quixotix/IpnListener.php @@ -12,6 +12,9 @@ * @copyright (c) 2012 - Micah Carrick * @version 2.1.0 */ + +namespace Quixotix; + class IpnListener { /** @@ -96,7 +99,7 @@ protected function curlPost($encoded_data) { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_CAINFO, - dirname(__FILE__)."/cert/api_cert_chain.crt"); + dirname(__FILE__)."/../../cert/api_cert_chain.crt"); curl_setopt($ch, CURLOPT_URL, $uri); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded_data); From c79f100a5db2c3195ba7d09e6e29455ca4853859 Mon Sep 17 00:00:00 2001 From: Carlo Capocasa Date: Tue, 14 Jan 2014 19:43:03 +0100 Subject: [PATCH 2/5] Update composer.json --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 361f194..6aa0da8 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,5 @@ { "name": "quixotix/paypalipn", - "version": "2.1.0", "autoload": { "psr-0": { "Quixotix\\": "lib/" From 97ab0078fec52cb5f748d309bfcacf5310dbd1d6 Mon Sep 17 00:00:00 2001 From: Carlo Capocasa Date: Thu, 16 Oct 2014 19:25:28 +0200 Subject: [PATCH 3/5] fix exception --- lib/Quixotix/Exception.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lib/Quixotix/Exception.php diff --git a/lib/Quixotix/Exception.php b/lib/Quixotix/Exception.php new file mode 100644 index 0000000..0382db9 --- /dev/null +++ b/lib/Quixotix/Exception.php @@ -0,0 +1,7 @@ + Date: Fri, 17 Oct 2014 12:23:53 +0200 Subject: [PATCH 4/5] fix ssl v3 --- lib/Quixotix/IpnListener.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Quixotix/IpnListener.php b/lib/Quixotix/IpnListener.php index 336ee71..608a542 100644 --- a/lib/Quixotix/IpnListener.php +++ b/lib/Quixotix/IpnListener.php @@ -26,12 +26,13 @@ class IpnListener { public $use_curl = true; /** - * If true, explicitly sets cURL to use SSL version 3. Use this if cURL + * + * If true, explicitly sets cURL to use SSL version 4. Use this if cURL * is compiled with GnuTLS SSL. * * @var boolean */ - public $force_ssl_v3 = true; + public $force_ssl_v4 = true; /** * If true, cURL will use the CURLOPT_FOLLOWLOCATION to follow any @@ -108,8 +109,8 @@ protected function curlPost($encoded_data) { curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, true); - if ($this->force_ssl_v3) { - curl_setopt($ch, CURLOPT_SSLVERSION, 3); + if ($this->force_ssl_v4) { + curl_setopt($ch, CURLOPT_SSLVERSION, 4); } $this->response = curl_exec($ch); From 4a928adba7245fabefdcbd3fb4352531c3f8ba02 Mon Sep 17 00:00:00 2001 From: Carlo Capocasa Date: Fri, 17 Oct 2014 12:23:53 +0200 Subject: [PATCH 5/5] fix ssl v3 --- lib/Quixotix/IpnListener.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/Quixotix/IpnListener.php b/lib/Quixotix/IpnListener.php index 336ee71..c17d9e5 100644 --- a/lib/Quixotix/IpnListener.php +++ b/lib/Quixotix/IpnListener.php @@ -26,12 +26,22 @@ class IpnListener { public $use_curl = true; /** + * * If true, explicitly sets cURL to use SSL version 3. Use this if cURL * is compiled with GnuTLS SSL. * * @var boolean */ - public $force_ssl_v3 = true; + public $force_ssl_v3 = false; + + /** + * + * If true, explicitly sets cURL to use SSL version 4. Use this if cURL + * is compiled with GnuTLS SSL. + * + * @var boolean + */ + public $force_ssl_v4 = true; /** * If true, cURL will use the CURLOPT_FOLLOWLOCATION to follow any @@ -108,7 +118,9 @@ protected function curlPost($encoded_data) { curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, true); - if ($this->force_ssl_v3) { + if ($this->force_ssl_v4) { + curl_setopt($ch, CURLOPT_SSLVERSION, 4); + } elseif ($this->force_ssl_v3) { curl_setopt($ch, CURLOPT_SSLVERSION, 3); }