Skip to content

Commit 6008d3b

Browse files
authored
Merge pull request #2 from php-monsters/fix/asanpardakht-gateway-token
decode gateway output of AsanPrdakht
2 parents 2f726f0 + 3c38514 commit 6008d3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Provider/AsanPardakhtProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ public function requestToken(): string
139139

140140
if ($response->successful() && !empty($response->body())) {
141141
$this->getTransaction()->setGatewayToken(
142-
$response->body(),
142+
json_decode($response->body(), false, 512, JSON_THROW_ON_ERROR),
143143
true
144144
);
145145

146-
return $response->body();
146+
return json_decode($response->body(), false, 512, JSON_THROW_ON_ERROR);
147147
} elseif ($response->status() !== 200) {
148148
//todo: handle error page
149149
throw new Exception(sprintf('shaparak::asanpardakht.error_%s', $response->status()));

0 commit comments

Comments
 (0)