Skip to content

Commit

Permalink
PagBank 😍 Magento
Browse files Browse the repository at this point in the history
  • Loading branch information
elisei committed Apr 11, 2024
1 parent 69a8161 commit de53a76
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Controller/Notification/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,18 @@ public function execute()

$response = $this->getRequest()->getContent();

$psData = $this->json->unserialize($response);
try {
$psData = $this->json->unserialize($response);
} catch (Exception $exc) {
/** @var ResultInterface $result */
return $this->createResult(
205,
[
'error' => 205,
'message' => $exc->getMessage(),
]
);
}

if (!isset($psData['id'])) {
return $this->createResult(
Expand Down
4 changes: 4 additions & 0 deletions Gateway/Request/ItemsDataRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ public function getPurchaseItems(
continue;
}

if ((int) $this->config->formatPrice($item->getPrice()) === 0) {
continue;
}

$replacements = [
'á' => 'a',
'à' => 'a',
Expand Down

0 comments on commit de53a76

Please sign in to comment.