diff --git a/README.md b/README.md index bcc772a..19e8009 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # TransferWise Simple API PHP Class +# It's a fork from robclark56's to iron out a few bugs, and deprecated calls in newer php versions. + ## Introduction This PHP class is completely standalone; it does not require composer to bring in other code. As such this is a light-weight module for easy inclusion into bigger projects. diff --git a/code/includes/class_TransferWise.php b/code/includes/class_TransferWise.php index bc7455d..c2c95ab 100644 --- a/code/includes/class_TransferWise.php +++ b/code/includes/class_TransferWise.php @@ -274,14 +274,14 @@ private function curl($mode, $curl_url,$data=NULL,$headers=NULL){ $payload = json_encode($data); $headerArray[] = "Content-Type: application/json"; $headerArray[] = 'Content-Length: ' . strlen($payload); - if($headers){ + curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); + } + if($headers){ foreach($headers as $header){ $headerArray[] = $header; } - } - curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); } - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $mode); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $mode); curl_setopt($ch, CURLOPT_HTTPHEADER, $headerArray); //Reset One Time Token @@ -311,7 +311,7 @@ private function curl($mode, $curl_url,$data=NULL,$headers=NULL){ } $headers[] = "x-2fa-approval: $this->OTT"; $headers[] = "X-Signature: $Xsignature"; - $response = $this->curl($mode, $SCA->path,$data,$headers); + $response = $this->curl($mode,$curl_url,$data,$headers); } }