| @@ -14,9 +14,8 @@ | ||
| 14 | 14 | protected $name = 'vipps_card'; |
| 15 | 15 | protected $payment_method_name = ""; |
| 16 | 16 | protected $description = ""; |
| 17 | 17 | |
| 18 | - /** Read card gateway settings and labels for the Blocks registration. */ | |
| 19 | 18 | public function initialize() { |
| 20 | 19 | $gw = \WC_Gateway_VippsCard::instance(); |
| 21 | 20 | $this->settings = get_option( 'woocommerce_vipps_card_settings', [] ); |
| 22 | 21 | $this->payment_method_name = $gw->get_title(); |
| @@ -23,9 +22,8 @@ | ||
| 23 | 22 | $this->description = $gw->get_option('description'); |
| 24 | 23 | } |
| 25 | 24 | |
| 26 | 25 | // Register this payment method IOK 2020-08-10 |
| 27 | - /** Register the card integration separately from the Vipps widget method. */ | |
| 28 | 26 | public static function register() { |
| 29 | 27 | add_action( 'woocommerce_blocks_payment_method_type_registration', |
| 30 | 28 | function ($registry) { |
| 31 | 29 | $registry->register(new static()); |
| @@ -31,13 +29,11 @@ | ||
| 31 | 29 | $registry->register(new static()); |
| 32 | 30 | }); |
| 33 | 31 | } |
| 34 | 32 | |
| 35 | - /** Only offer the method when the card gateway is enabled. */ | |
| 36 | 33 | public function is_active() { |
| 37 | 34 | return filter_var( $this->get_setting( 'enabled', false ), FILTER_VALIDATE_BOOLEAN ); |
| 38 | 35 | } |
| 39 | - /** Load the card presentation component after shared gateway code, with cache invalidation. */ | |
| 40 | 36 | public function get_payment_method_script_handles() { |
| 41 | 37 | |
| 42 | 38 | $version = filemtime(dirname(__FILE__) . "/js/wc-payment-method-vipps-card.js"); |
| 43 | 39 | $path = plugins_url('js/wc-payment-method-vipps-card.js', __FILE__); |
| @@ -55,12 +51,8 @@ | ||
| 55 | 51 | |
| 56 | 52 | return [ 'wc-payment-method-vipps-card' ]; |
| 57 | 53 | } |
| 58 | 54 | |
| 59 | - /** | |
| 60 | - * Supply vipps_card_data to the JS component. Payment processing stays with | |
| 61 | - * WooCommerce's legacy gateway adapter; this class does not take over redirects. | |
| 62 | - */ | |
| 63 | 55 | public function get_payment_method_data() { |
| 64 | 56 | $logo = $src = plugins_url('../../img/cclogos.svg',__FILE__); |
| 65 | 57 | |
| 66 | 58 | return [ |
| @@ -69,4 +61,5 @@ | ||
| 69 | 61 | 'iconsrc' => apply_filters('woo_vipps_card_block_logo_url', $logo) |
| 70 | 62 | ]; |
| 71 | 63 | } |
| 72 | 64 | } |
| 65 | + | |