| @@ -11,9 +11,9 @@ | ||
| 11 | 11 | use Payplug\PayplugWoocommerce\Admin\Metabox; |
| 12 | 12 | use Payplug\PayplugWoocommerce\Admin\Notices; |
| 13 | 13 | use Payplug\PayplugWoocommerce\Admin\SetupCallback; |
| 14 | 14 | use Payplug\PayplugWoocommerce\Admin\WoocommerceActions; |
| 15 | -use Payplug\PayplugWoocommerce\Front\PayplugOney\Requests\OneyAnimation; | |
| 15 | +use Payplug\PayplugWoocommerce\Front\Oney\OneyDisplay; | |
| 16 | 16 | use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugAmex; |
| 17 | 17 | use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugApplePay; |
| 18 | 18 | use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugBancontact; |
| 19 | 19 | use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugBizum; |
| @@ -103,9 +103,9 @@ | ||
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | 105 | * Singleton instance can't be serialized. |
| 106 | 106 | */ |
| 107 | - public function __wakeup() | |
| 107 | + public function __wakeup(): void | |
| 108 | 108 | { |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
| @@ -114,9 +114,9 @@ | ||
| 114 | 114 | private function __construct() |
| 115 | 115 | { |
| 116 | 116 | // Bail early if WooCommerce is not activated |
| 117 | 117 | if (!defined('WC_VERSION')) { |
| 118 | - add_action('admin_notices', function () { | |
| 118 | + add_action('admin_notices', function (): void { | |
| 119 | 119 | ?> |
| 120 | 120 | <div id="message" class="notice notice-error"> |
| 121 | 121 | <p><?php _e('PayPlug requires an active version of WooCommerce', 'payplug'); ?></p> |
| 122 | 122 | </div> |
| @@ -196,51 +196,22 @@ | ||
| 196 | 196 | |
| 197 | 197 | return array_merge($plugin_links, $links); |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - public function animationHandlers() | |
| 200 | + public function animationHandlers(): void | |
| 201 | 201 | { |
| 202 | - $options = get_option('woocommerce_payplug_settings', []); | |
| 203 | - | |
| 204 | - //if live and don't have country setted on the option | |
| 205 | - if (!isset($options['company_iso'])) { | |
| 206 | - $options['company_iso'] = PayplugWoocommerceHelper::UpdateCountryOption($options); | |
| 207 | - } | |
| 208 | - | |
| 209 | - //failsafe | |
| 210 | - if (empty($options['company_iso']) || !isset($options['payment_methods']['configuration']['oney']['with_fees'])) { | |
| 211 | - return; | |
| 212 | - } | |
| 213 | - | |
| 214 | - if (!class_exists('\\Payplug\\PayplugWoocommerce\\Front\\PayplugOney\\Country\\Oney' . $options['company_iso'])) { | |
| 215 | - return; | |
| 216 | - } | |
| 217 | - | |
| 218 | - $oney_type = $options['payment_methods']['configuration']['oney']['with_fees'] | |
| 219 | - ? 'with_fees' | |
| 220 | - : 'without_fees'; | |
| 221 | - | |
| 222 | - switch ($oney_type) { | |
| 223 | - case 'without_fees' : | |
| 224 | - $class = 'PayplugGatewayOney3xWithoutFees'; | |
| 225 | - break; | |
| 226 | - default: | |
| 227 | - $class = 'PayplugGatewayOney3x'; | |
| 228 | - break; | |
| 229 | - } | |
| 230 | - | |
| 231 | - new OneyAnimation($oney_type, $class); | |
| 202 | + new OneyDisplay(); | |
| 232 | 203 | } |
| 233 | 204 | |
| 234 | 205 | /** |
| 235 | 206 | * Registers WooCommerce Blocks integration. |
| 236 | 207 | */ |
| 237 | - public function woocommerce_gateways_block_support() | |
| 208 | + public function woocommerce_gateways_block_support(): void | |
| 238 | 209 | { |
| 239 | 210 | if (class_exists('Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType')) { |
| 240 | 211 | add_action( |
| 241 | 212 | 'woocommerce_blocks_payment_method_type_registration', |
| 242 | - function (\Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry) { | |
| 213 | + function (\Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry): void { | |
| 243 | 214 | $payment_method_registry->register(new PayplugCreditCard()); |
| 244 | 215 | $payment_method_registry->register(new PayplugBancontact()); |
| 245 | 216 | $payment_method_registry->register(new PayplugSatispay()); |
| 246 | 217 | $payment_method_registry->register(new PayplugAmex()); |