Skip to content
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
14 changes: 13 additions & 1 deletion src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public function payment(
curl_setopt($request_handle, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($request_handle, CURLOPT_POSTFIELDS, $payload);
$result = curl_exec($request_handle);

if ($result === false)
$result = curl_error($request_handle);

return new TransactionResponse($result);
}

Expand Down Expand Up @@ -103,6 +107,10 @@ public function refund(string $transaction_id, float $amount): TransactionRespon
curl_setopt($request_handle, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($request_handle, CURLOPT_POSTFIELDS, $payload);
$result = curl_exec($request_handle);

if ($result === false)
$result = curl_error($request_handle);

return new TransactionResponse($result);
}

Expand All @@ -128,6 +136,10 @@ public function query(string $query_reference): TransactionResponseInterface
'Authorization: ' . $this->config->getBearerToken()
]);
$result = curl_exec($request_handle);

if ($result === false)
$result = curl_error($request_handle);

return new TransactionResponse($result);
}
}
}