id = 'bacs'; $this->icon = apply_filters('woocommerce_bacs_icon', ''); $this->has_fields = false; $this->method_title = __( 'Bacs', 'woocommerce' ); // Load the settings. $this->init_form_fields(); $this->init_settings(); // Define user set variables $this->title = $this->get_option( 'title' ); $this->description = $this->get_option( 'description' ); // BACS account fields shown on the thanks page and in emails $this->account_fields = array( 'account_name' => array( 'label' => __( 'Account Name', 'woocommerce' ), 'value' => $this->get_option( 'account_name' ) ), 'account_number'=> array( 'label' => __( 'Account Number', 'woocommerce' ), 'value' => $this->get_option( 'account_number' ) ), 'sort_code' => array( 'label' => __( 'Sort Code', 'woocommerce' ), 'value' => $this->get_option( 'sort_code' ) ), 'bank_name' => array( 'label' => __( 'Bank Name', 'woocommerce' ), 'value' => $this->get_option( 'bank_name' ) ), 'iban' => array( 'label' => __( 'IBAN', 'woocommerce' ), 'value' => $this->get_option( 'iban' ) ), 'bic' => array( 'label' => __( 'BIC', 'woocommerce' ), 'value' => $this->get_option( 'bic' ) ) ); // Actions add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); add_action( 'woocommerce_thankyou_bacs', array( $this, 'thankyou_page' ) ); // Customer Emails add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 2 ); } /** * Initialise Gateway Settings Form Fields * * @access public * @return void */ function init_form_fields() { $this->form_fields = array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'woocommerce' ), 'type' => 'checkbox', 'label' => __( 'Enable Bank Transfer', 'woocommerce' ), 'default' => 'yes' ), 'title' => array( 'title' => __( 'Title', 'woocommerce' ), 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), 'default' => __( 'Direct Bank Transfer', 'woocommerce' ), 'desc_tip' => true, ), 'description' => array( 'title' => __( 'Customer Message', 'woocommerce' ), 'type' => 'textarea', 'description' => __( 'Give the customer instructions for paying via BACS, and let them know that their order won\'t be shipping until the money is received.', 'woocommerce' ), 'default' => __( 'Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order won\'t be shipped until the funds have cleared in our account.', 'woocommerce' ) ), 'account_details' => array( 'title' => __( 'Account Details', 'woocommerce' ), 'type' => 'title', 'description' => __( 'Optionally enter your bank details below for customers to pay into.', 'woocommerce' ), 'default' => '' ), 'account_name' => array( 'title' => __( 'Account Name', 'woocommerce' ), 'type' => 'text', 'description' => '', 'default' => '' ), 'account_number' => array( 'title' => __( 'Account Number', 'woocommerce' ), 'type' => 'text', 'description' => '', 'default' => '' ), 'sort_code' => array( 'title' => __( 'Sort Code', 'woocommerce' ), 'type' => 'text', 'description' => '', 'default' => '' ), 'bank_name' => array( 'title' => __( 'Bank Name', 'woocommerce' ), 'type' => 'text', 'description' => '', 'default' => '' ), 'iban' => array( 'title' => __( 'IBAN', 'woocommerce' ), 'type' => 'text', 'default' => '' ), 'bic' => array( 'title' => __( 'BIC (formerly Swift)', 'woocommerce' ), 'type' => 'text', 'default' => '' ), ); } /** * Admin Panel Options * - Options for bits like 'title' and availability on a country-by-country basis * * @access public * @return void */ public function admin_options() { ?>