Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "quixotix/paypalipn",
"autoload": {
"psr-0": {
"Quixotix\\": "lib/"
}
}
}

7 changes: 7 additions & 0 deletions lib/Quixotix/Exception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Quixotix;

class Exception extends \Exception {
}

21 changes: 18 additions & 3 deletions ipnlistener.php → lib/Quixotix/IpnListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* @copyright (c) 2012 - Micah Carrick
* @version 2.1.0
*/

namespace Quixotix;

class IpnListener {

/**
Expand All @@ -23,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
Expand Down Expand Up @@ -96,7 +109,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);
Expand All @@ -105,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);
}

Expand Down