Skip to content

Commit

Permalink
Merge pull request #24 from mercadopago/release/1.9.1
Browse files Browse the repository at this point in the history
Release v1.9.1
  • Loading branch information
katelucena-meli authored Feb 10, 2025
2 parents a1eafce + 5a254cc commit 7f5e4b6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Setup/Patch/Data/UpdateBinaryMode.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,26 +138,24 @@ protected function getBinaryModeFromPayment()
try {
$responseBody = $client->get($uri, $clientHeaders);
$data = $responseBody->getData();
$binaryMode = $data['binary_mode'];

if ($data && isset($data['binary_mode'])) {
$binaryMode = $data['binary_mode'];
}
} catch (InvalidArgumentException $exc) {
$this->logger->debug(
[
'url' => $baseUrl . '/v1/payments/' . $paymentId,
'error' => $exc->getMessage(),
]
);
// phpcs:ignore Magento2.Exceptions.DirectThrow
throw new Exception('Invalid JSON was returned by the gateway');
} catch (\Throwable $exc) {
$this->logger->debug(
[
'url' => $baseUrl . $uri,
'error' => $exc->getMessage(),
]
);
// phpcs:ignore Magento2.Exceptions.DirectThrow
throw new Exception($exc->getMessage());
}

return $binaryMode;
Expand Down

0 comments on commit 7f5e4b6

Please sign in to comment.