id = 'efarem'; $this->icon = plugin_dir_url(__FILE__) . '/assets/images/efarem.png'; $this->has_fields = true; $this->method_title = '{Title of Gateway}'; $this->method_description = 'Description of gateway'; $this->init_form_fields(); $this->init_settings(); $this->title = $this->get_option('title'); $this->vendor_name = $this->get_option('vendor-name'); add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); } /** * Add form fields to the WooCommerce Gateway settings page * * @return void **/ public function init_form_fields() { $this->form_fields = array( 'enabled' => array( 'title' => __('Enable/Disable', 'woocommerce'), 'type' => 'checkbox', 'label' => __('Enable {Title of Gateway}', 'woocommerce'), 'default' => 'yes', ), 'title' => array( 'title' => __('Title', 'woocommerce'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce'), 'default' => __($this->method_title, 'woocommerce'), 'desc_tip' => true, ), 'mode' => array( 'title' => __('Mode', 'woocommerce'), 'type' => 'select', 'decription' => __('Choose the payment mode', 'woocommerce'), 'options' => array('simulator' => __('Simulator', 'woocommerce'), 'test' => __('Test', 'woocommerce'), 'live' => __('Live', 'woocommerce')), 'desc_tip' => true, ), ); } }