Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- class PAGALOCARD_Payment_Gateway extends WC_Payment_Gateway
- {
- // Setup our Gateway's id, description and other values
- function __construct()
- {
- // The global ID for this Payment method
- $this->id = "pagalocard_payment";
- // The Title shown on the top of the Payment Gateways Page next to all the other Payment Gateways
- $this->method_title = __("PAGALOCARD GATEWAY", 'PAGALOCARD-payment');
- // The description for this Payment Gateway, shown on the actual Payment options page on the PAGALOCARDkend
- $this->method_description = __("Pagalocard Payment Gateway Plug-in for WooCommerce", 'PAGALOCARD-payment');
- // The title to be used for the vertical tabs that can be ordered top to bottom
- $this->title = __("PAGALOCARD Payment Gateway", 'PAGALOCARD-payment');
- // If you want to show an image next to the gateway's name on the frontend, enter a URL to an image.
- $this->icon = plugin_dir_url( __FILE__ ).'assets/images/tarjetas.png';
- // Bool. Can be set to true if you want payment fields to show on the checkout
- // if doing a direct integration, which we are doing in this case
- $this->has_fields = true;
- // Supports the default credit card form
- $this->supports = array('default_credit_card_form');
- // This basically defines your settings which are then loaded with init_settings()
- $this->init_form_fields();
- // After init_settings() is called, you can get the settings and load them into variables, e.g:
- // $this->title = $this->get_option( 'title' );
- $this->init_settings();
- // Turn these settings into variables we can use
- foreach ($this->settings as $setting_key => $value) {
- $this->$setting_key = $value;
- }
- // Lets check for SSL
- add_action('admin_notices', array($this, 'do_ssl_check'));
- // Save settings
- if (is_admin()) {
- // Versions over 2.0
- // Save our administration options. Since we are not going to be doing anything special
- // we have not defined 'process_admin_options' in this class so the method in the parent
- // class will be used instead
- add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
- }
- } // End __construct()
- // Build the administration fields for this specific Gateway
- public function init_form_fields()
- {
- $domain = $_SERVER['SERVER_NAME'];
- $this->form_fields = array(
- 'enabled' => array(
- 'title' => __('Activar / Desactivar', 'PAGALOCARD-payment'),
- 'label' => __('Activar este metodo de pago', 'PAGALOCARD-payment'),
- 'type' => 'checkbox',
- 'default' => 'no',
- ),
- 'title' => array(
- 'title' => __('Título', 'PAGALOCARD-payment'),
- 'type' => 'text',
- 'desc_tip' => __('Título de pago que el cliente verá durante el proceso de pago.', 'PAGALOCARD-payment'),
- 'default' => __('Tarjeta de crédito', 'PAGALOCARD-payment'),
- ),
- 'description' => array(
- 'title' => __('Descripción', 'PAGALOCARD-payment'),
- 'type' => 'textarea',
- 'desc_tip' => __('Descripción de pago que el cliente verá durante el proceso de pago.', 'PAGALOCARD-payment'),
- 'default' => __('Pague con seguridad usando su tarjeta de crédito.', 'PAGALOCARD-payment'),
- 'css' => 'max-width:350px;'
- ),
- 'developer' => array(
- 'title' => __('Credenciales NWORLDT.NET', 'PAGALOCARD-payment'),
- 'type' => 'title',
- 'description' => 'Ingresa a tu cuenta de NWORLDT.NET para obtener NUMERO DE ORDEN <a href="https://www.nworldt.net" target="_blank">Ir a NWORLDT.NET</a> ',
- ),
- 'domain' => array(
- 'title' => __('Domiain', 'PAGALOCARD-payment'),
- 'type' => 'text',
- 'desc_tip' => __('Url de dominio.', 'PAGALOCARD-payment'),
- 'default' => __($domain, 'PAGALOCARD-payment'),
- ),
- 'orderIdNWT' => array(
- 'title' => __('No. de Orden NWORLDT.NET', 'PAGALOCARD-payment'),
- 'type' => 'text',
- 'desc_tip' => __('No. de Orden. de NWORLDT.NET', 'PAGALOCARD-payment'),
- 'default' => __('', 'PAGALOCARD-payment'),
- ),
- 'PAGALO' => array(
- 'title' => __('Credenciales PAGALO', 'PAGALOCARD-payment'),
- 'type' => 'title',
- 'description' => 'Ingresa a tu cuenta de PAGALO para obtener las credenciales <a href="https://app.pagalocard.com" target="_blank">Ir a PAGALO</a> ',
- ),
- 'id_en_empresa' => array(
- 'title' => __('IdenEmpresa', 'PAGALOCARD-payment'),
- 'type' => 'text',
- 'desc_tip' => __('Clave IdenEmpresa.', 'PAGALOCARD-payment'),
- 'default' => '',
- ),
- 'token' => array(
- 'title' => __('Token', 'PAGALOCARD-payment'),
- 'type' => 'text',
- 'desc_tip' => __('Token de seguridad del panel de control del comerciante.', 'PAGALOCARD-payment'),
- 'default' => '',
- ),
- 'public_api_key' => array(
- 'title' => __('Public Key', 'PAGALOCARD-payment'),
- ...............................................................................
- ..........................................
- .................
Add Comment
Please, Sign In to add comment