Example #1
0
 /**
  * Return an instance of this class.
  *
  * @return object A single instance of this class.
  */
 public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 /**
  * Initialise Gateway Settings Form Fields.
  */
 public function init_form_fields()
 {
     $this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'stelo-woocommerce'), 'type' => 'checkbox', 'label' => __('Habilitar Stelo', 'stelo-woocommerce'), 'default' => 'no'), 'title' => array('title' => __('Title', 'stelo-woocommerce'), 'type' => 'text', 'description' => __('This controls the title which the user sees during checkout.', 'stelo-woocommerce'), 'desc_tip' => true, 'default' => __('Stelo Gateway', 'stelo-woocommerce')), 'description' => array('title' => __('Description', 'stelo-woocommerce'), 'type' => 'textarea', 'description' => __('This controls the description which the user sees during checkout.', 'stelo-woocommerce'), 'default' => __('Pay with Stelo', 'stelo-woocommerce')), 'integration' => array('title' => __('Integration Settings', 'stelo-woocommerce'), 'type' => 'title', 'description' => ''), 'client_id' => array('title' => __('Client ID', 'stelo-woocommerce'), 'type' => 'text', 'description' => sprintf(__('Por favor, digite o ID da sua conta. Isto é necessário para receber pagamentos. É possível encontrar o seu ID de conta nas %s.', 'stelo-woocommerce'), '<a href="http://www.stelo.com.br/cadastre-se/" target="_blank">' . __('Stelo carteira digital', 'stelo-woocommerce') . '</a>'), 'default' => '', 'custom_attributes' => array('required' => 'required')), 'client_secret' => array('title' => __('Client Secret', 'stelo-woocommerce'), 'type' => 'text', 'description' => sprintf(__('Por favor, digite o seu Client Secret. Isto é necessário para receber pagamentos. É possível gerar um novo Client Secret em %s.', 'stelo-woocommerce'), '<a href="http://www.stelo.com.br/cadastre-se/" target="_blank">' . __('Stelo carteira digital', 'stelo-woocommerce') . '</a>'), 'default' => '', 'custom_attributes' => array('required' => 'required')), 'payment' => array('title' => __('Payment Options', 'stelo-woocommerce'), 'type' => 'title', 'description' => ''), 'installments' => array('title' => __('Number of credit card Installments', 'stelo-woocommerce'), 'type' => 'number', 'description' => __('The maximum number of installments allowed for credit cards. Put a number bigger than 1 to enable the field. This cannot be greater than the number allowed in your Stelo account.', 'stelo-woocommerce'), 'desc_tip' => true, 'default' => '1', 'custom_attributes' => array('step' => '1', 'min' => '1', 'max' => '12')), 'testing' => array('title' => __('Gateway Testing', 'stelo-woocommerce'), 'type' => 'title', 'description' => ''), 'sandbox' => array('title' => __('Stelo Sandbox', 'stelo-woocommerce'), 'type' => 'checkbox', 'label' => __('Habilitar Stelo Sandbox', 'stelo-woocommerce'), 'default' => 'no', 'description' => sprintf(__('Stelo pode ser usado em modo sandbox', 'stelo-woocommerce'))), 'debug' => array('title' => __('Debug Log', 'stelo-woocommerce'), 'type' => 'checkbox', 'label' => __('Enable logging', 'stelo-woocommerce'), 'default' => 'no', 'description' => sprintf(__('Log de eventos do Stelo tais como requests da API, poderam ser verificados em %s.', 'stelo-woocommerce'), WC_Stelo::get_log_view($this->id))));
 }