"Google Pay", ]; public function boot() { $extra_fields = []; $extra_fields['merchant_id'] = [ 'title' => __('Merchant ID', 'hyperpay-gateways'), 'type' => 'text', 'default' => '' ]; $this->form_fields = array_merge(array_slice($this->form_fields, 0, 7), $extra_fields, array_slice($this->form_fields, 7)); $this->merchant_id = $this->get_option('merchant_id'); } public function renderPaymentForm(WC_Order $order, $result) { $token = $result['response']['id']; $postBackURL = $result['postBackURL']; $payment_brands = $this->brands; if (is_array($this->brands)) $payment_brands = implode(' ', $this->brands); $dataObj = [ 'is_arabic' => esc_js($this->is_arabic), 'style' => esc_html($this->payment_style), 'postBackURL' => ($postBackURL), 'payment_brands' => esc_html($payment_brands), 'custom_style' => esc_html($this->custom_style), 'scriptURL' => esc_html($this->script_url), 'checkoutId' => $token, 'integrity' => esc_html($result['integrity'] ?? ''), 'orderId' => $order->id, 'nonce' => $this->NONCE, 'id' => $this->id, 'entityId' => $this->entityId, 'merchantId' => $this->merchant_id ]; if ($this->supported_network) { $dataObj['supported_network'] = $this->supported_network; } add_action('wp_head', [$this, 'custom_add_to_head']); $scriptSrc = "googlepay-script.js"; return View::render('copy-and-pay.html', compact('dataObj', 'scriptSrc')); } }