Skip to content

Commit

Permalink
Fixed translations
Browse files Browse the repository at this point in the history
  • Loading branch information
L3RAZ committed Jan 9, 2025
1 parent 934b5f4 commit edaf568
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions controllers/admin/AdminAjaxPrestashopCheckoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,13 @@ public function ajaxProcessTogglePayLaterProductPageButton()
public function ajaxProcessFetchOrder()
{
$isLegacy = (bool) Tools::getValue('legacy');
// $id_order = (int) Tools::getValue('id_order');
$id_order = (int) Tools::getValue('id_order');
if (empty($id_order)) {
http_response_code(400);
$this->exitWithResponse([
'status' => false,
'errors' => [
$this->trans('No PrestaShop Order identifier received', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController'),
$this->module->l('No PrestaShop Order identifier received'),
],
]);
}
Expand All @@ -372,7 +372,7 @@ public function ajaxProcessFetchOrder()
'status' => false,
'errors' => [
strtr(
$this->trans('This PrestaShop Order [PRESTASHOP_ORDER_ID] is not paid with PrestaShop Checkout', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController'),
$this->module->l('This PrestaShop Order [PRESTASHOP_ORDER_ID] is not paid with PrestaShop Checkout'),
[
'[PRESTASHOP_ORDER_ID]' => $order->id,
]
Expand All @@ -391,7 +391,7 @@ public function ajaxProcessFetchOrder()
'status' => false,
'errors' => [
strtr(
$this->trans('Unable to find PayPal Order associated to this PrestaShop Order [PRESTASHOP_ORDER_ID]', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController'),
$this->module->l('Unable to find PayPal Order associated to this PrestaShop Order [PRESTASHOP_ORDER_ID]'),
[
'[PRESTASHOP_ORDER_ID]' => $order->id,
]
Expand All @@ -418,7 +418,7 @@ public function ajaxProcessFetchOrder()
'status' => false,
'errors' => [
strtr(
$this->trans('PayPal Order [PAYPAL_ORDER_ID] is not in the same environment as PrestaShop Checkout', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController'),
$this->module->l('PayPal Order [PAYPAL_ORDER_ID] is not in the same environment as PrestaShop Checkout'),
[
'[PAYPAL_ORDER_ID]' => $psCheckoutCart->paypal_order,
]
Expand Down Expand Up @@ -484,23 +484,23 @@ public function ajaxProcessRefundOrder()
'httpCode' => $exception->getCode(),
'status' => false,
'errors' => [
$this->trans('Refund cannot be processed by PayPal.', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController'),
$this->module->l('Refund cannot be processed by PayPal.'),
],
]);
} catch (PayPalRefundException $invalidArgumentException) {
$error = '';
switch ($invalidArgumentException->getCode()) {
case PayPalRefundException::INVALID_ORDER_ID:
$error = $this->trans('PayPal Order is invalid.', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController');
$error = $this->module->l('PayPal Order is invalid.');
break;
case PayPalRefundException::INVALID_TRANSACTION_ID:
$error = $this->trans('PayPal Transaction is invalid.', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController');
$error = $this->module->l('PayPal Transaction is invalid.');
break;
case PayPalRefundException::INVALID_CURRENCY:
$error = $this->trans('PayPal refund currency is invalid.', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController');
$error = $this->module->l('PayPal refund currency is invalid.');
break;
case PayPalRefundException::INVALID_AMOUNT:
$error = $this->trans('PayPal refund amount is invalid.', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController');
$error = $this->module->l('PayPal refund amount is invalid.');
break;
default:
break;
Expand All @@ -515,7 +515,7 @@ public function ajaxProcessRefundOrder()
$this->exitWithResponse([
'httpCode' => 200,
'status' => true,
'content' => $this->trans('Refund has been processed by PayPal, but order status change or email sending failed.', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController'),
'content' => $this->module->l('Refund has been processed by PayPal, but order status change or email sending failed.'),
]);
} elseif ($exception->getCode() !== OrderException::ORDER_HAS_ALREADY_THIS_STATUS) {
$this->exitWithResponse([
Expand All @@ -532,7 +532,7 @@ public function ajaxProcessRefundOrder()
'httpCode' => 500,
'status' => false,
'errors' => [
$this->trans('Refund cannot be processed by PayPal.', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController'),
$this->module->l('Refund cannot be processed by PayPal.'),
],
'error' => $exception->getMessage(),
]);
Expand All @@ -541,7 +541,7 @@ public function ajaxProcessRefundOrder()
$this->exitWithResponse([
'httpCode' => 200,
'status' => true,
'content' => $this->trans('Refund has been processed by PayPal.', [], 'Modules.Ps_checkout.AdminAjaxPrestashopCheckoutController'),
'content' => $this->module->l('Refund has been processed by PayPal.'),
]);
}

Expand Down

0 comments on commit edaf568

Please sign in to comment.