Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

updated for pci compliance #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
16 changes: 12 additions & 4 deletions ipnlistener.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class IpnListener {
*
* @var boolean
*/
public $force_ssl_v3 = true;
public $force_tls_v2 = true;

/**
* If true, cURL will use the CURLOPT_FOLLOWLOCATION to follow any
Expand Down Expand Up @@ -105,9 +105,17 @@ 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);
}
//https://github.com/paypal/TLS-update#php
//The Payment Card Industry (PCI) Council has mandated that early versions of TLS be retired from service.
//All organizations that handle credit card information are required to comply with this standard. As part of this obligation,
//PayPal is updating its services to require TLS 1.2 for all HTTPS connections. At this time, PayPal will also require HTTP/1.1
//for all connections.
//if ($this->force_ssl_v3) {
// curl_setopt($ch, CURLOPT_SSLVERSION, 3);
//}
if($this->force_tls_v2){
curl_setopt($ch, CURLOPT_SSLVERSION, 6); //force tls_v2 for testing in sandbox
}

$this->response = curl_exec($ch);
$this->response_status = strval(curl_getinfo($ch, CURLINFO_HTTP_CODE));
Expand Down