From 1f470cdc0275b6aaf3e633bf7b4d5e9b853144c1 Mon Sep 17 00:00:00 2001
From: inpsyde-maticluznar ' . __('The following options are required to use the plugin and are used by all Mollie payment methods', 'mollie-payments-for-woocommerce') . '%1$s
. Required if WooCommerce Subscriptions is being used! Read more about %2$s and how it improves your conversion.',
- 'mollie-payments-for-woocommerce'
- ),
- strtolower(__('Enabled', 'mollie-payments-for-woocommerce')),
- __('Single Click Payments', 'mollie-payments-for-woocommerce')
- ),
- 'type' => 'checkbox',
- 'default' => 'yes',
-
- ],
- [
- 'id' => $pluginName . '_api_switch',
- 'title' => __(
- 'Select API Method',
- 'mollie-payments-for-woocommerce'
- ),
- 'type' => 'select',
- 'options' => [
- PaymentService::PAYMENT_METHOD_TYPE_ORDER => ucfirst(
- PaymentService::PAYMENT_METHOD_TYPE_ORDER
- ) . ' (' . __('default', 'mollie-payments-for-woocommerce')
- . ')',
- PaymentService::PAYMENT_METHOD_TYPE_PAYMENT => ucfirst(
- PaymentService::PAYMENT_METHOD_TYPE_PAYMENT
- ),
- ],
- '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'
- ),
- '',
- ''
- ),
- ],
- [
- 'id' => $pluginName . '_api_payment_description',
- 'title' => __(
- 'API Payment Description',
- 'mollie-payments-for-woocommerce'
- ),
- 'type' => 'text',
- 'default' => '{orderNumber}',
- 'desc' => sprintf(
- '
%3$s', - _x('Available variables', 'Payment description options', 'mollie-payments-for-woocommerce'), - implode('', array_map( - static function ($label, $label_description) { - return sprintf( - '
', - '
' - ) - ), - ], - [ - 'id' => $pluginName . '_gatewayFeeLabel', - 'title' => __( - 'Surcharge gateway fee label', - 'mollie-payments-for-woocommerce' - ), - 'type' => 'text', - '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' - ), - ], - [ - 'id' => $pluginName . '_removeOptionsAndTransients', - 'title' => __( - 'Remove Mollie data from Database on uninstall', - 'mollie-payments-for-woocommerce' - ), - 'type' => 'checkbox', - 'default' => 'no', - 'desc' => __("Remove options and scheduled actions from database when uninstalling the plugin.", "mollie-payments-for-woocommerce") . ' (' . strtolower( - __('Clear now', 'mollie-payments-for-woocommerce') - ) . ')', - ], - [ - 'id' => $pluginName . '_sectionend', - 'type' => 'sectionend', - ], -]; - -return apply_filters('inpsyde.mollie-advanced-settings', $mollieAdvancedSettings, $pluginName); diff --git a/inc/settings/mollie_applepay_settings.php b/inc/settings/mollie_applepay_settings.php deleted file mode 100644 index 2ef1c3fa0..000000000 --- a/inc/settings/mollie_applepay_settings.php +++ /dev/null @@ -1,122 +0,0 @@ - $title . '_' . 'title', - 'title' => __('Apple Pay', 'mollie-payments-for-woocommerce'), - 'type' => 'title', - 'desc' => '' . __('The following options are required to use the Apple Pay gateway', 'mollie-payments-for-woocommerce') . '
', - ], - - [ - 'id' => 'enabled', - 'title' => __('Enable/Disable', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: Gateway title */ - 'desc' => sprintf(__('Enable %s', 'mollie-payments-for-woocommerce'), $title), - 'type' => 'checkbox', - 'default' => 'yes', - 'value' => isset($applePayOption['enabled']) ? $applePayOption['enabled'] : 'yes', - - ], - [ - 'id' => 'title', - 'title' => __('Title', 'mollie-payments-for-woocommerce'), - 'desc' => sprintf( - /* translators: Placeholder 1: Gateway title */ - __( - 'This controls the title which the user sees during checkout. Default%s
',
- 'mollie-payments-for-woocommerce'
- ),
- $title
- ),
- 'desc_tip' => true,
- 'type' => 'text',
- 'default' => $title,
- 'value' => isset($applePayOption['title']) ? $applePayOption['title'] : $title,
-
- ],
- [
- 'id' => 'display_logo',
- 'title' => __('Display logo', 'mollie-payments-for-woocommerce'),
- 'desc' => __(
- 'Display logo',
- 'mollie-payments-for-woocommerce'
- ),
- 'desc_tip' => true,
- 'type' => 'checkbox',
- 'default' => 'yes',
- 'value' => isset($applePayOption['display_logo']) ? $applePayOption['display_logo'] : 'yes',
-
- ],
- [
- 'id' => 'description',
- 'title' => __('Description', 'mollie-payments-for-woocommerce'),
- 'desc' => sprintf(
- /* translators: Placeholder 1: Gateway description */
- __(
- 'Payment method description that the customer will see on your checkout. Default %s
',
- 'mollie-payments-for-woocommerce'
- ),
- $description
- ),
- 'desc_tip' => true,
- 'type' => 'text',
- 'default' => $description,
- 'value' => isset($applePayOption['description']) ? $applePayOption['description'] : $description,
- ],
- [
- 'id' => $pluginId . '_' . 'sectionend',
- 'type' => 'sectionend',
- ],
- [
- 'id' => $title . '_' . 'title_button',
- 'title' => __(
- 'Apple Pay button settings',
- 'mollie-payments-for-woocommerce'
- ),
- 'type' => 'title',
- 'desc' => '' . __('The following options are required to use the Apple Pay Direct Button', 'mollie-payments-for-woocommerce') . '
', - ], - [ - 'id' => 'mollie_apple_pay_button_enabled_cart', - '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' - ), - $description - ), - 'type' => 'checkbox', - 'default' => 'no', - 'value' => isset($applePayOption['mollie_apple_pay_button_enabled_cart']) ? $applePayOption['mollie_apple_pay_button_enabled_cart'] : 'no', - - ], - [ - 'id' => 'mollie_apple_pay_button_enabled_product', - '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' - ), - $description - ), - 'type' => 'checkbox', - 'default' => 'no', - 'value' => isset($applePayOption['mollie_apple_pay_button_enabled_product']) ? $applePayOption['mollie_apple_pay_button_enabled_product'] : 'no', - - ], - [ - 'id' => $pluginName . '_' . 'sectionend', - 'type' => 'sectionend', - ], -]; diff --git a/inc/settings/mollie_components.php b/inc/settings/mollie_components.php deleted file mode 100644 index ac81476d9..000000000 --- a/inc/settings/mollie_components.php +++ /dev/null @@ -1,170 +0,0 @@ - 'title', - 'id' => 'mollie_components_styles', - 'title' => _x( - 'Base Styles', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - ], - StylesPropertiesDictionary::BACKGROUND_COLOR => [ - 'type' => 'color', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::BACKGROUND_COLOR, - 'title' => _x('Background Color', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'default' => '#ffffff', - ], - StylesPropertiesDictionary::TEXT_COLOR => [ - 'type' => 'color', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::TEXT_COLOR, - 'title' => _x('Text Color', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'default' => '#000000', - ], - StylesPropertiesDictionary::INPUT_PLACEHOLDER => [ - 'type' => 'color', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::INPUT_PLACEHOLDER, - 'title' => _x('Placeholder Color', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'default' => '#cccccc', - ], - StylesPropertiesDictionary::FONT_SIZE => [ - 'type' => 'text', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::FONT_SIZE, - 'title' => _x('Font Size', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'desc_tip' => _x( - 'Defines the component font size. Allowed units: \'em\', \'px\', \'rem\'.', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - 'default' => '16px', - ], - StylesPropertiesDictionary::FONT_WEIGHT => [ - 'type' => 'select', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::FONT_WEIGHT, - 'title' => _x('Font Weight', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'default' => 'normal', - 'options' => [ - 'lighter' => _x('Lighter', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'normal' => _x('Regular', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'bolder' => _x('Bold', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - ], - ], - StylesPropertiesDictionary::LETTER_SPACING => [ - 'type' => 'number', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::LETTER_SPACING, - 'title' => _x('Letter Spacing', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'default' => '0', - ], - StylesPropertiesDictionary::LINE_HEIGHT => [ - 'type' => 'number', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::LINE_HEIGHT, - 'title' => _x('Line Height', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'default' => '1.2', - 'custom_attributes' => [ - 'step' => '.1', - ], - ], - StylesPropertiesDictionary::PADDING => [ - 'type' => 'text', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::PADDING, - 'title' => _x('Padding', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'desc_tip' => _x( - 'Add padding to the components. Allowed units include `16px 16px 16px 16px` and `em`, `px`, `rem`.', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - 'default' => '.63em', - ], - StylesPropertiesDictionary::TEXT_ALIGN => [ - 'type' => 'select', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::TEXT_ALIGN, - 'title' => _x('Align Text', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'default' => 'left', - 'options' => [ - 'left' => _x('Left', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'right' => _x('Right', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'center' => _x('Center', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'justify' => _x('Justify', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - ], - ], - StylesPropertiesDictionary::TEXT_TRANSFORM => [ - 'type' => 'select', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::TEXT_TRANSFORM, - 'title' => _x('Transform Text ', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'default' => 'none', - 'options' => [ - 'none' => _x( - 'None', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - 'capitalize' => _x( - 'Capitalize', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - 'uppercase' => _x( - 'Uppercase', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - 'lowercase' => _x( - 'Lowercase', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - 'full-width' => _x( - 'Full Width', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - 'full-size-kana' => _x( - 'Full Size Kana', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - ], - ], - [ - 'type' => 'sectionend', - 'id' => 'mollie_components_styles', - ], - [ - 'type' => 'title', - 'id' => 'mollie_components_invalid_styles', - 'title' => _x( - 'Invalid Status Styles', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - ], - StylesPropertiesDictionary::INVALID_TEXT_COLOR => [ - 'type' => 'color', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::INVALID_TEXT_COLOR, - 'title' => _x('Text Color', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'desc_tip' => _x( - 'Text Color for invalid input.', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - 'default' => '#000000', - ], - StylesPropertiesDictionary::INVALID_BACKGROUND_COLOR => [ - 'type' => 'color', - 'id' => 'mollie_components_' . StylesPropertiesDictionary::INVALID_BACKGROUND_COLOR, - 'title' => _x('Background Color', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'), - 'desc_tip' => _x( - 'Background Color for invalid input.', - 'Mollie Components Settings', - 'mollie-payments-for-woocommerce' - ), - 'default' => '#FFF0F0', - ], - [ - 'type' => 'sectionend', - 'id' => 'mollie_components_invalid_styles', - ], -]; diff --git a/src/Settings/MollieSettingsPage.php b/src/Settings/MollieSettingsPage.php index 04be819e0..6e225d5e7 100644 --- a/src/Settings/MollieSettingsPage.php +++ b/src/Settings/MollieSettingsPage.php @@ -10,8 +10,6 @@ use Mollie\WooCommerce\Settings\Page\PageNoApiKey; use Mollie\WooCommerce\Settings\Page\PagePaymentMethods; use Mollie\WooCommerce\Shared\Data; -use Mollie\WooCommerce\PaymentMethods\Constants; -use WC_Gateway_BACS; use WC_Settings_Page; class MollieSettingsPage extends WC_Settings_Page @@ -143,54 +141,4 @@ public function get_settings($currentSection = '') $currentSection ); } - - protected function checkDirectDebitStatus($content): string - { - $hasCustomSepaSettings = $this->paymentMethods["directdebit"]->getProperty('enabled') !== false; - $isSepaEnabled = !$hasCustomSepaSettings || $this->paymentMethods["directdebit"]->getProperty('enabled') === 'yes'; - $sepaGatewayAllowed = !empty($this->registeredGateways["mollie_wc_gateway_directdebit"]); - if ($sepaGatewayAllowed && !$isSepaEnabled) { - $warning_message = __( - "You have WooCommerce Subscriptions activated, but not SEPA Direct Debit. Enable SEPA Direct Debit if you want to allow customers to pay subscriptions with iDEAL and/or other 'first' payment methods.", - 'mollie-payments-for-woocommerce' - ); - - $content .= ''; - $content .= $warning_message; - $content .= '
'; - $content .= __( - 'You have the WooCommerce default Direct Bank Transfer (BACS) payment gateway enabled in WooCommerce. Mollie strongly advices only using Bank Transfer via Mollie and disabling the default WooCommerce BACS payment gateway to prevent possible conflicts.', - 'mollie-payments-for-woocommerce' - ); - $content .= '