Skip to content

Commit

Permalink
Add missing method with translations
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Jan 17, 2025
1 parent 02606ca commit a38af39
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
6 changes: 5 additions & 1 deletion .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions src/Gateway/GatewayModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,6 @@ static function () {
$this->molliePayPalButtonHandling($paypalGateway, $notice, $logger, $pluginUrl);
}



$maybeDisableVoucher = new MaybeDisableGateway();
$dataService = $container->get('settings.data_helper');
assert($dataService instanceof Data);
Expand Down
37 changes: 27 additions & 10 deletions src/PaymentMethods/Billie.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ protected function getConfig(): array
{
return [
'id' => 'billie',
'defaultTitle' => __('Billie', 'mollie-payments-for-woocommerce'),
'settingsDescription' => __(
'To accept payments via Billie, all default WooCommerce checkout fields should be enabled and required.',
'mollie-payments-for-woocommerce'
),
'defaultTitle' => 'Billie',
'settingsDescription' => 'To accept payments via Billie, all default WooCommerce checkout fields should be enabled and required.',
'defaultDescription' => '',
'paymentFields' => true,
'instructions' => false,
Expand All @@ -36,15 +33,35 @@ protected function getConfig(): array
'confirmationDelayed' => false,
'SEPA' => false,
'orderMandatory' => true,
'errorMessage' => __(
'Company field is empty. The company field is required.',
'mollie-payments-for-woocommerce'
),
'companyPlaceholder' => __('Please enter your company name here.', 'mollie-payments-for-woocommerce'),
'errorMessage' => 'Company field is empty. The company field is required.',
'companyPlaceholder' => 'Please enter your company name here.',
'docs' => 'https://www.mollie.com/gb/payments/billie',
];
}

// Replace translatable strings after the 'after_setup_theme' hook
public function initializeTranslations(): void
{
if ($this->translationsInitialized) {
return;
}
$this->config['defaultTitle'] = __('Billie', 'mollie-payments-for-woocommerce');
$this->config['settingsDescription'] = __(
'To accept payments via Billie, all default WooCommerce checkout fields should be enabled and required.',
'mollie-payments-for-woocommerce'
);
$this->config['errorMessage'] = __(
'Company field is empty. The company field is required.',
'mollie-payments-for-woocommerce'
);
$this->config['companyPlaceholder'] = __(
'Please enter your company name here.',
'mollie-payments-for-woocommerce'
);

$this->translationsInitialized = true;
}

/**
* Add filters and actions for the Billie payment method.
* This will be added during constructor
Expand Down

0 comments on commit a38af39

Please sign in to comment.