Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: translations calls and blocks blocks references #375

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Block/Payment/Info/BaseCardInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ abstract class BaseCardInfo extends Cc
public function getTransactionInfo()
{
$charge = $this->getLastCharge();

if (empty($charge) || empty($charge->getLastTransaction())) {
return [];
}
if ($charge->getLastTransaction()->getCardData() == null) {
return [];
}
Expand Down Expand Up @@ -65,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