Skip to content

Commit

Permalink
fix zibal gateway 500 response (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnateghi authored Dec 21, 2024
1 parent 24eafe9 commit 5b5264a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/Drivers/Zibal/Zibal.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,25 @@ public function verify() : ReceiptInterface

$curl = curl_init();

$postData = json_encode([
"merchant" => $this->settings->merchantId,
"trackId" => $transactionId,
]);

curl_setopt_array($curl, array(
CURLOPT_URL => $this->settings->apiVerificationUrl,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_TIMEOUT => 30,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"merchant": "'.$this->settings->merchantId.'",
"trackId": "'.$transactionId.'",
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
CURLOPT_POSTFIELDS => $postData,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Content-Length: ' . strlen($postData),
],
));

$response = curl_exec($curl);
Expand Down

0 comments on commit 5b5264a

Please sign in to comment.