id = static::GATEWAY_ID; $this->method_title = $wc_pay_spec->title; if ( property_exists( $wc_pay_spec, 'sub_title' ) ) { $this->title = sprintf( '%s', $wc_pay_spec->sub_title ); } $this->method_description = $wc_pay_spec->content; $this->has_fields = false; // Get setting values. $this->enabled = false; // Load the settings. $this->init_form_fields(); $this->init_settings(); } /** * Initialise Gateway Settings Form Fields. */ public function init_form_fields() { $this->form_fields = array( 'is_dismissed' => array( 'title' => __( 'Dismiss', 'woocommerce-admin' ), 'type' => 'checkbox', 'label' => __( 'Dismiss the gateway', 'woocommerce-admin' ), 'default' => 'no', ), ); } /** * Check if the promotional gateaway has been dismissed. * * @return bool */ public static function is_dismissed() { $settings = get_option( 'woocommerce_' . self::GATEWAY_ID . '_settings', array() ); return isset( $settings['is_dismissed'] ) && 'yes' === $settings['is_dismissed']; } }