Skip to content

Commit

Permalink
Fix cs and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Aug 22, 2024
1 parent 7fa4eb8 commit 240aaed
Show file tree
Hide file tree
Showing 21 changed files with 62 additions and 53 deletions.
12 changes: 6 additions & 6 deletions inc/settings/mollie_advanced_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
],
'desc' => sprintf(
/* translators: Placeholder 1: link tag Placeholder 2: closing tag */
__('Sending a language (or locale) is required. The option \'Automatically send WordPress language\' will try to get the customer\'s language in WordPress (and respects multilanguage plugins) and convert it to a format Mollie understands. If this fails, or if the language is not supported, it will fall back to American English. You can also select one of the locales currently supported by Mollie, that will then be used for all customers.', 'mollie-payments-for-woocommerce'),
__('Sending a language (or locale) is required. The option \'Automatically send WordPress language\' will try to get the customer\'s language in WordPress (and respects multilanguage plugins) and convert it to a format Mollie understands. If this fails, or if the language is not supported, it will fall back to American English. You can also select one of the locales currently supported by Mollie, that will then be used for all customers.', 'mollie-payments-for-woocommerce'),
'<a href="https://www.mollie.com/nl/docs/reference/payments/create" target="_blank">',
'</a>'
),
Expand Down Expand Up @@ -113,7 +113,7 @@
'default' => PaymentService::PAYMENT_METHOD_TYPE_ORDER,
'desc' => sprintf(
/* translators: Placeholder 1: opening link tag, placeholder 2: closing link tag */
__(
__(
'Click %1$shere%2$s to read more about the differences between the Payments and Orders API',
'mollie-payments-for-woocommerce'
),
Expand Down Expand Up @@ -163,7 +163,7 @@ class="mollie-settings-advanced-payment-desc-label button button-secondary butto
)),
sprintf(
/* translators: Placeholder 1: Opening paragraph tag, placeholder 2: Closing paragraph tag */
__(
__(
'Select among the available variables the description to be used for this transaction.%1$s(Note: this only works when the method is set to Payments API)%2$s',
'mollie-payments-for-woocommerce'
),
Expand All @@ -182,9 +182,9 @@ class="mollie-settings-advanced-payment-desc-label button button-secondary butto
'custom_attributes' => ['maxlength' => '30'],
'default' => __('Gateway Fee', 'mollie-payments-for-woocommerce'),
'desc' => __(
'This is the label will appear in frontend when the surcharge applies',
'mollie-payments-for-woocommerce'
),
'This is the label will appear in frontend when the surcharge applies',
'mollie-payments-for-woocommerce'
),
],
[
'id' => $pluginName . '_removeOptionsAndTransients',
Expand Down
10 changes: 5 additions & 5 deletions inc/settings/mollie_applepay_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
'id' => 'display_logo',
'title' => __('Display logo', 'mollie-payments-for-woocommerce'),
'desc' => __(
'Display logo',
'mollie-payments-for-woocommerce'
),
'Display logo',
'mollie-payments-for-woocommerce'
),
'desc_tip' => true,
'type' => 'checkbox',
'default' => 'yes',
Expand Down Expand Up @@ -88,7 +88,7 @@
'title' => __('Enable Apple Pay Button on Cart page', 'mollie-payments-for-woocommerce'),
'desc' => sprintf(
/* translators: Placeholder 1: enabled or disabled */
__(
__(
'Enable the Apple Pay direct buy button on the Cart page',
'mollie-payments-for-woocommerce'
),
Expand All @@ -104,7 +104,7 @@
'title' => __('Enable Apple Pay Button on Product page', 'mollie-payments-for-woocommerce'),
'desc' => sprintf(
/* translators: Placeholder 1: enabled or disabled */
__(
__(
'Enable the Apple Pay direct buy button on the Product page',
'mollie-payments-for-woocommerce'
),
Expand Down
2 changes: 1 addition & 1 deletion src/Activation/ActivationModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function mollieWcNoticeApiKeyMissing()
$notice = new AdminNotice();
$message = sprintf(
/* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to settings. Placeholder 4: Closing link tag.*/
esc_html__(
esc_html__(
'%1$sMollie Payments for WooCommerce: API keys missing%2$s Please%3$s set your API keys here%4$s.',
'mollie-payments-for-woocommerce'
),
Expand Down
10 changes: 8 additions & 2 deletions src/Activation/ConstraintsChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,19 @@ protected function showNotice(array $errors)
{
$message = sprintf(
/* translators: Placeholder 1: opening tags Placeholder 2: closing tags */
__('%1$sMollie Payments for WooCommerce is inactive:%2$s', 'mollie-payments-for-woocommerce'), '<p><strong>', '</strong></p>');
__('%1$sMollie Payments for WooCommerce is inactive:%2$s', 'mollie-payments-for-woocommerce'),
'<p><strong>',
'</strong></p>'
);
foreach ($errors as $error) {
$message .= sprintf('<p>%s</p>', $error);
}
$message .= sprintf(
/* translators: Placeholder 1: opening tags Placeholder 2: closing tags */
__('%1$sCorrect the above errors to use Mollie Payments for Woocommerce%2$s', 'mollie-payments-for-woocommerce'), '<p>', '</p>');
__('%1$sCorrect the above errors to use Mollie Payments for Woocommerce%2$s', 'mollie-payments-for-woocommerce'),
'<p>',
'</p>'
);
$errorLevel = 'notice-error';
$this->notice->addNotice($errorLevel, $message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Buttons/ApplePayButton/AppleAjaxRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ function ($result, $order_id) {
} else {
$message = sprintf(
/* translators: Placeholder 1: Payment method title */
__(
__(
'Could not create %s payment.',
'mollie-payments-for-woocommerce'
),
Expand Down
4 changes: 2 additions & 2 deletions src/Buttons/ApplePayButton/ApplePayDirectHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function bootstrap($buttonEnabledProduct, $buttonEnabledCart)
if (!$this->isApplePayCompatible()) {
$message = sprintf(
/* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to documentation. Placeholder 4: Closing link tag.*/
esc_html__(
esc_html__(
'%1$sServer not compliant with Apple requirements%2$s Check %3$sApple Server requirements page%4$s to fix it in order to make the Apple Pay button work',
'mollie-payments-for-woocommerce'
),
Expand All @@ -55,7 +55,7 @@ public function bootstrap($buttonEnabledProduct, $buttonEnabledCart)
if (!$this->merchantValidated()) {
$message = sprintf(
/* translators: Placeholder 1: Opening link tag to documentation. Placeholder 2: Closing link tag.*/
esc_html__(
esc_html__(
'Apple Pay Validation Error: Please review the %1$sApple Server requirements%2$s. If everything appears correct, click the Apple Pay button to retry validation.',
'mollie-payments-for-woocommerce'
),
Expand Down
4 changes: 2 additions & 2 deletions src/Buttons/PayPalButton/PayPalAjaxRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function createWcOrder()
} else {
$message = sprintf(
/* translators: Placeholder 1: Payment method title */
__(
__(
'Could not create %s payment.',
'mollie-payments-for-woocommerce'
),
Expand Down Expand Up @@ -154,7 +154,7 @@ public function createWcOrderFromCart()
} else {
$message = sprintf(
/* translators: Placeholder 1: Payment method title */
__(
__(
'Could not create %s payment.',
'mollie-payments-for-woocommerce'
),
Expand Down
2 changes: 1 addition & 1 deletion src/Gateway/Surcharge.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ protected function name_fixed_fee_percentage($paymentMethod)
$amountPercent = $paymentMethod->getProperty(self::PERCENTAGE);
return sprintf(
/* translators: Placeholder 1: Fee amount tag. Placeholder 2: Currency. Placeholder 3: Percentage amount. */
__(' + %1$s %2$s + %3$s%% fee might apply', 'mollie-payments-for-woocommerce'),
__(' + %1$s %2$s + %3$s%% fee might apply', 'mollie-payments-for-woocommerce'),
$currency,
$amountFix,
$amountPercent
Expand Down
2 changes: 1 addition & 1 deletion src/MerchantCapture/Capture/Action/CapturePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __invoke()
$this->order->add_order_note(
sprintf(
/* translators: Placeholder 1: Order price */
__(
__(
'The payment capture of %s has been sent successfully, and we are currently awaiting confirmation.',
'mollie-payments-for-woocommerce'
),
Expand Down
8 changes: 4 additions & 4 deletions src/Payment/MollieOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ public function refund_amount($order, $amount, $paymentObject, $reason)
if ($paymentObject->isCreated() || $paymentObject->isAuthorized() || $paymentObject->isShipping()) {
$noteMessage = sprintf(
/* translators: Placeholder 1: payment status.*/
_x(
_x(
'Can not refund order amount that has status %1$s at Mollie.',
'Order note error',
'mollie-payments-for-woocommerce'
Expand All @@ -779,7 +779,7 @@ public function refund_amount($order, $amount, $paymentObject, $reason)
]);
$noteMessage = sprintf(
/* translators: Placeholder 1: Currency. Placeholder 2: Refund amount. Placeholder 3: Reason. Placeholder 4: Refund id.*/
__('Amount refund of %1$s%2$s refunded in WooCommerce and at Mollie.%3$s Refund ID: %4$s.', 'mollie-payments-for-woocommerce'),
__('Amount refund of %1$s%2$s refunded in WooCommerce and at Mollie.%3$s Refund ID: %4$s.', 'mollie-payments-for-woocommerce'),
$this->dataHelper->getOrderCurrency($order),
$amount,
( ! empty($reason) ? ' Reason: ' . $reason . '.' : '' ),
Expand Down Expand Up @@ -936,7 +936,7 @@ protected function processOrderItemsRefund(
if ($refund === null) {
$noteMessage = sprintf(
/* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount.*/
__(
__(
'%1$sx %2$s cancelled for %3$s%4$s in WooCommerce and at Mollie.',
'mollie-payments-for-woocommerce'
),
Expand All @@ -960,7 +960,7 @@ protected function processOrderItemsRefund(
);
$noteMessage = sprintf(
/* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount. Placeholder 5: Reason. Placeholder 6: Refund Id. */
__(
__(
'%1$sx %2$s refunded for %3$s%4$s in WooCommerce and at Mollie.%5$s Refund ID: %6$s.',
'mollie-payments-for-woocommerce'
),
Expand Down
4 changes: 2 additions & 2 deletions src/Payment/MollieOrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ protected function processChargebacks(WC_Order $order, $payment)
$order->add_order_note(
sprintf(
/* translators: Placeholder 1: Chargeback to process id. */
__(
__(
'New chargeback %s processed! Order note and order status updated.',
'mollie-payments-for-woocommerce'
),
Expand Down Expand Up @@ -819,7 +819,7 @@ protected function notifyProcessedRefunds(array $refundsToProcess, string $logId
$order->add_order_note(
sprintf(
/* translators: Placeholder 1: Refund to process id. */
__(
__(
'New refund %s processed in Mollie Dashboard! Order note added, but order not updated.',
'mollie-payments-for-woocommerce'
),
Expand Down
5 changes: 3 additions & 2 deletions src/Payment/PaymentModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ public function addOrderNoteForRefundCreated(
WC_Order $order,
array $data
) {

$orderNote = sprintf(
/* translators: Placeholder 1: number of items. */
__(
__(
'%1$s items refunded in WooCommerce and at Mollie.',
'mollie-payments-for-woocommerce'
),
Expand All @@ -236,7 +237,7 @@ public function addOrderNoteForCancelledLineItems(array $data, WC_Order $order)
{
$orderNote = sprintf(
/* translators: Placeholder 1: number of items. */
__(
__(
'%1$s items cancelled in WooCommerce and at Mollie.',
'mollie-payments-for-woocommerce'
),
Expand Down
2 changes: 1 addition & 1 deletion src/Payment/RefundLineItemsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function buildLineItems(
throw new UnexpectedValueException(
sprintf(
/* translators: Placeholder 1: item id. */
esc_html__(
esc_html__(
'Cannot refund %s item because it was not found in Mollie order. Aborting refund process. Try to do a refund by amount.',
'mollie-payments-for-woocommerce'
),
Expand Down
4 changes: 2 additions & 2 deletions src/PaymentMethods/Giftcard.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function debugGiftcardDetails(
foreach ($details->giftcards as $giftcard) {
$orderNoteLine .= sprintf(
/* translators: Placeholder 1: giftcard issuer, Placeholder 2: amount value, Placeholder 3: currency */
esc_html_x(
esc_html_x(
'Mollie - Giftcard details: %1$s %2$s %3$s.',
'Placeholder 1: giftcard issuer, Placeholder 2: amount value, Placeholder 3: currency',
'mollie-payments-for-woocommerce'
Expand All @@ -41,7 +41,7 @@ public function debugGiftcardDetails(
if ($details->remainderMethod) {
$orderNoteLine .= sprintf(
/* translators: Placeholder 1: Method Placeholder 2: Value Placeholder 3: currency */
esc_html_x(
esc_html_x(
' Remainder: %1$s %2$s %3$s.',
'Placeholder 1: remainder method, Placeholder 2: amount value, Placeholder 3: currency',
'mollie-payments-for-woocommerce'
Expand Down
2 changes: 1 addition & 1 deletion src/PaymentMethods/Giropay.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function getFormFields($generalFormFields): array
'title' =>
sprintf(
/* translators: Placeholder 1: paragraph opening tag Placeholder 2: link url Placeholder 3: closing tags */
__(
__(
'%1$s Paydirekt, the owner of Giropay, has decided to deprecate Giropay. On Monday, 24 June 2024, Mollie was informed that Giropay would cease onboarding new merchants and processing new payments after 30 June 2024. No action is needed from your side. Mollie will automatically remove Giropay as a payment option from your Checkout by 30 June.
Subscription renewals and refunds will continue to be processed as usual beyond June 30. More details can be found in the %2$s Giropay Deprecation FAQ. %3$s',
'mollie-payments-for-woocommerce'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function execute(
if ($payment->isPaid() && $payment->details) {
return sprintf(
/* translators: Placeholder 1: Mollie_WC_Gateway_MyBank consumer name, placeholder 2: Consumer Account number */
__(
__(
'Payment completed by <strong>%1$s</strong> - %2$s',
'mollie-payments-for-woocommerce'
),
Expand Down
26 changes: 13 additions & 13 deletions src/Settings/General/MollieGeneralSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ public function gatewayFormFields(
'type' => 'file',
'custom_attributes' => ['accept' => '.png, .jpeg, .svg, image/png, image/jpeg'],
'description' => __(
'Upload a custom icon for this gateway. The feature must be enabled.',
'mollie-payments-for-woocommerce'
),
'Upload a custom icon for this gateway. The feature must be enabled.',
'mollie-payments-for-woocommerce'
),
'desc_tip' => true,
],
'description' => [
Expand Down Expand Up @@ -191,9 +191,9 @@ public function gatewayFormFields(
'title' => __('Payment surcharge percentage amount %', 'mollie-payments-for-woocommerce'),
'type' => 'number',
'description' => __(
'Control the percentage fee added on checkout. Default 0.00',
'mollie-payments-for-woocommerce'
),
'Control the percentage fee added on checkout. Default 0.00',
'mollie-payments-for-woocommerce'
),
'custom_attributes' => ['step' => '0.01', 'min' => '0.00', 'max' => '999'],
'default' => '0.00',
'desc_tip' => true,
Expand Down Expand Up @@ -223,9 +223,9 @@ public function gatewayFormFields(
),
'type' => 'number',
'description' => __(
'Maximum order amount to apply surcharge. If the order is above this number the surcharge will not apply. Default 0, means no maximum',
'mollie-payments-for-woocommerce'
),
'Maximum order amount to apply surcharge. If the order is above this number the surcharge will not apply. Default 0, means no maximum',
'mollie-payments-for-woocommerce'
),
'custom_attributes' => ['step' => '0.01', 'min' => '0.00', 'max' => '999'],
'default' => '0.00',
'desc_tip' => true,
Expand Down Expand Up @@ -260,7 +260,7 @@ public function gatewayFormFields(
'default' => SharedDataDictionary::STATUS_ON_HOLD,
'description' => sprintf(
/* translators: Placeholder 1: Default order status, placeholder 2: Link to 'Hold Stock' setting */
__(
__(
'Some payment methods take longer than a few hours to complete. The initial order state is then set to \'%1$s\'. This ensures the order is not cancelled when the setting %2$s is used. This will also prevent the order to be canceled when expired.',
'mollie-payments-for-woocommerce'
),
Expand Down Expand Up @@ -289,9 +289,9 @@ public function gatewayFormFields(
'type' => 'number',
'custom_attributes' => ['step' => '1', 'min' => '10', 'max' => '526000'],
'description' => __(
'Number of MINUTES after the order will expire and will be canceled at Mollie and WooCommerce.',
'mollie-payments-for-woocommerce'
),
'Number of MINUTES after the order will expire and will be canceled at Mollie and WooCommerce.',
'mollie-payments-for-woocommerce'
),
'default' => '10',
'desc_tip' => false,
];
Expand Down
2 changes: 1 addition & 1 deletion src/Settings/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ protected function validateUploadedFile(string $fileName, string $fileTempName,
if ($invalidFileSize) {
$message = sprintf(
/* translators: Placeholder 1: opening tag Placeholder 2: closing tag */
esc_html__(
esc_html__(
'%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Size must be under 500kb.',
'mollie-payments-for-woocommerce'
),
Expand Down
4 changes: 2 additions & 2 deletions src/Shared/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ public function getFilters(
throw new InvalidArgumentException(
sprintf(
/* translators: Placeholder 1: amount value */
esc_html__('Amount %s is not valid.', 'mollie-payments-for-woocommerce'),
esc_html($amountValue)
esc_html__('Amount %s is not valid.', 'mollie-payments-for-woocommerce'),
esc_html($amountValue)
)
);
}
Expand Down
Loading

0 comments on commit 240aaed

Please sign in to comment.