Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
afiqiqmal committed Apr 11, 2021
1 parent 63f318b commit b2c22cb
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/HttpClient/PayResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ public function __construct($response)
$this->error = true;
$this->status_code = $response->getCode();
$this->body = $response->getMessage();
}

try {
$this->error = !$response->isOk();
$this->status_code = $response->status();
$this->body = $response->json();
} catch (\Exception $exception) {
$this->error = true;
$this->status_code = $response->status();
$this->body = $response->json();
} else {

try {
$this->error = !$response->isOk();
$this->status_code = $response->status();
$this->body = $response->json();
} catch (\Exception $exception) {
$this->error = true;
$this->status_code = $response->status();
$this->body = $response->json();
}
}
}

Expand Down

0 comments on commit b2c22cb

Please sign in to comment.