Skip to content

Commit

Permalink
Merge pull request #43 from snappmarket/SP-4713/fix/already_refund_re…
Browse files Browse the repository at this point in the history
…sponse

SP-4713 - fix already refunded response
  • Loading branch information
salehimehdi authored Aug 27, 2022
2 parents 22fefc7 + 8b9b2a8 commit ba8b00d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Treasury/Communicator.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,10 @@ public function getAlreadyRefundedAmountForOrder(GetAlreadyRefundedAmountForOrde
$response = $this->request(static::METHOD_GET, $uri);

if ($response->getStatusCode() == 200){
$data = json_decode($response->getBody()->getContents(), true);

if(empty($data)){
return false;
}
$responseContent = $response->getBody()->__toString();
$responseArray = json_decode($responseContent, true);

return $data['results']['already_refunded_amount'] ?? false;
return $responseArray['results']['already_refunded_amount'] ?? false;
}

return false;
Expand Down

0 comments on commit ba8b00d

Please sign in to comment.