'ApplePay', 'APPLEPAYTKN' => 'ApplePay Token', ]; protected $button_types = [ "buy" => "buy", "donate" => "donate", "plain" => "plain", "book" => "book", "check-out" => "check-out", "subscribe" => "subscribe", "add-money" => "add-money", "order" => "order", "reload" => "reload", "rent" => "rent", "support" => "support", ]; public function boot() { /** * add supported_network field to position number 6 */ $extra_fields['supported_network'] = [ 'title' => __('Supported Network', 'hyperpay-gateways'), 'type' => 'multiselect', 'options' => [ "visa" => "Visa", "masterCard" => "Master", "amex" => "Amex", "mada" => "Mada" ], 'default' => ["visa", "masterCard", "amex"] ]; $extra_fields['icon'] = [ 'title' => __('Preview action button', 'hyperpay-gateways'), 'type' => 'icon', 'tip' => __('This will be the apple pay style on checkout', 'hyperpay-gateways'), ]; $extra_fields['action_type'] = [ 'title' => __('Action button', 'hyperpay-gateways'), 'type' => 'select', 'options' => $this->button_types, 'default' => "plain", ]; $extra_fields['action_style'] = [ 'title' => __('Action style', 'hyperpay-gateways'), 'type' => 'select', 'options' => ["black" => "black", "white-with-line" => "white"], 'default' => "white-with-line" ]; $this->form_fields = array_merge(array_slice($this->form_fields, 0, 7), $extra_fields, array_slice($this->form_fields, 7)); $this->supported_network = $this->get_option('supported_network'); $this->action_type = $this->get_option('action_type'); $this->action_style = $this->get_option('action_style'); $this->action_button = HYPERPAY_PLUGIN_DIR . "/src/assets/images/applePayButtons/button-{$this->action_type}-{$this->action_style}-min.png"; } public function extraScriptData() { return [ "action_type" => $this->action_type, "action_style" => $this->action_style, 'testMode' => $this->testMode ]; } public function generate_icon_html($key, $data) { ob_start(); View::render('fields/icon.html', compact('data')); return ob_get_clean(); } }