Skip to content

Commit

Permalink
fix: translations calls and blocks blocks references
Browse files Browse the repository at this point in the history
fix: translations calls and blocks blocks references
  • Loading branch information
fabiano-mallmann authored Jan 17, 2025
2 parents 2ae2a86 + efbbfbf commit 14fafc8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Block/Payment/Info/BaseCardInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ abstract class BaseCardInfo extends Cc
public function getTransactionInfo()
{
$charge = $this->getLastCharge();
if($charge->getLastTransaction() == null) {

if (empty($charge) || empty($charge->getLastTransaction())) {
return [];
}
if ($charge->getLastTransaction()->getCardData() == null) {
Expand Down Expand Up @@ -69,7 +69,7 @@ private function getLastCharge()

return current($orderObject->getCharges());
}

/**
* @param mixed $orderService
* @param mixed $pagarmeId
Expand Down
4 changes: 2 additions & 2 deletions Controller/Adminhtml/Invoices/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ public function execute()

$message = $this->messageFactory->create(
MessageInterface::TYPE_ERROR,
_("Unable to cancel invoice")
__("Unable to cancel invoice")
);

$invoice = $this->invoiceService->cancel($id);

if ($invoice['code'] == 200) {
$message = $this->messageFactory->create(
MessageInterface::TYPE_SUCCESS,
_("Invoice canceled.")
__("Invoice canceled.")
);
}

Expand Down
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Plans/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function execute()

$planService->delete($productId);

$message = $this->messageFactory->create('success', _("Plan deleted."));
$message = $this->messageFactory->create('success', __("Plan deleted."));
$this->messageManager->addMessage($message);

$this->_redirect('pagarme_pagarme/plans/index');
Expand Down
4 changes: 2 additions & 2 deletions Controller/Adminhtml/Subscriptions/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ public function execute()

$message = $this->messageFactory->create(
MessageInterface::TYPE_ERROR,
_("Unable to cancel subscription")
__("Unable to cancel subscription")
);

$subscription = $this->subscriptionService->cancel($id);

if ($subscription['code'] == 200) {
$message = $this->messageFactory->create(
MessageInterface::TYPE_SUCCESS,
_("Subscription deleted.")
__("Subscription deleted.")
);
}

Expand Down
2 changes: 1 addition & 1 deletion view/frontend/templates/info/card.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @var \Pagarme\Core\Kernel\Aggregates\Transaction $info
*/
$info = $this->getTransactionInfo();
$info = $block->getTransactionInfo();
if(empty($info)) {
return;
}
Expand Down

0 comments on commit 14fafc8

Please sign in to comment.