Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
khanzadimahdi committed Dec 27, 2019
1 parent 12f3b5f commit bed6276
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/Drivers/Zibal/Zibal.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,13 @@ public function purchase()
'mobile' => $mobile, //optional for mpg
);

$json = json_encode($data, JSON_UNESCAPED_UNICODE);

$response = $this->client->request(
'POST',
$this->settings->apiPurchaseUrl,
[
"form_params" => $json,
"http_errors" => false,
]
["json" => $data, "http_errors" => false]
);
$body = json_decode($response->getBody()->getContents(), true);

$body = json_decode($response->getBody()->getContents(), false);

if ($body->result != 100) {
// some error has happened
Expand Down Expand Up @@ -133,7 +129,7 @@ public function verify() : ReceiptInterface
$orderId = request()->input('orderId');
$transactionId = $this->invoice->getTransactionId() ?? request()->input('trackId');

if (!$successFlag != 1) {
if ($successFlag != 1) {
$this->notVerified('پرداخت با شکست مواجه شد');
}

Expand All @@ -143,14 +139,13 @@ public function verify() : ReceiptInterface
"trackId" => $transactionId, //required
);

$json = json_encode($data, JSON_UNESCAPED_LINE_TERMINATORS);

$response = $this->client->request(
'POST',
$this->settings->apiVerificationUrl,
["form_params" => $json, "http_errors" => false]
["json" => $data, "http_errors" => false]
);
$body = json_decode($response->getBody()->getContents(), true);

$body = json_decode($response->getBody()->getContents(), false);

if ($body->result != 100) {
$this->notVerified($body->message);
Expand Down

0 comments on commit bed6276

Please sign in to comment.