Plugin Directory

Changeset 3099513


Ignore:
Timestamp:
06/07/2024 04:48:53 PM (20 months ago)
Author:
eupagoip
Message:

v4.1.4

Location:
eupago-gateway-for-woocommerce/trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • eupago-gateway-for-woocommerce/trunk/eupago-gateway-for-woocommerce.php

    r3092023 r3099513  
    33* Plugin Name: Eupago Gateway For Woocommerce
    44* Plugin URI:
    5 * Description: Eupago Gateway🌍  (Multibanco, MB Way, Credit Card, Cofidis Pay e Payshop).
    6 * Version: 4.1.3
     5* Description: This plugin allows customers to pay their orders with Multibanco, MB WAY, Payshop, Credit Card and CofidisPay with Eupago’s gateway.
     6* Version: 4.1.4
    77* Author: Eupago
    88* Author URI: https://www.eupago.pt/
     
    2626         * @var string
    2727         */
    28         public const VERSION = '4.1.3';
     28        public const VERSION = '4.1.4';
    2929
    3030        /**
  • eupago-gateway-for-woocommerce/trunk/includes/class-wc-eupago-api.php

    r3092023 r3099513  
    301301  }
    302302
    303   public function cofidispay_create($order_id){
    304 
    305     $nonce = wp_create_nonce('wp_rest');
     303  public function cofidispay_create($order_id)
     304  {
    306305
    307306    $order = wc_get_order( $order_id );
     
    361360        'price' => (float) $item->get_total() / $item->get_quantity(),
    362361        'quantity' => $item->get_quantity(),
    363         'tax' => $item_rate,
     362        'tax' => $item_rate, // TODO: Ver taxas iva
    364363        'discount' => 0,
    365         'description' => $item->get_name(),
     364        'description' => $item->get_name(), // TODO: Ver o que é esta description
    366365      ];
    367366    }
     
    383382        'tax' => 23,
    384383        'discount' => 0,
    385         'description' => 'Custos de expedição',
     384        'description' => 'Custos de expedição', // TODO: Ver o que é esta description
    386385      ];
    387386    }
    388387
    389 
    390388    $response = wp_remote_request(
    391         $this->get_cofidis_url(),
    392         [
    393             'method' => 'POST',
    394             'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0',
    395             'headers' => [
    396                 'Content-Type' => 'application/json',
    397                 'Cache-Control' => 'no-cache',
    398                 'X-WP-Nonce' => $nonce,
    399                 'Authorization' => 'ApiKey ' . $this->get_api_key(),
    400             ],
    401             'body' => json_encode($data),
    402         ]
     389      $this->get_cofidis_url(),
     390      [
     391        'method' => 'POST',
     392        'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0',
     393        'headers'     => array(
     394          'Content-Type' => 'application/json',
     395          'Cache-Control' => 'no-cache',
     396          'Authorization' => 'ApiKey ' . $this->get_api_key(),
     397        ),
     398        'body' => json_encode($data)
     399      ]
    403400    );
    404401
  • eupago-gateway-for-woocommerce/trunk/includes/class-wc-eupago-cc.php

    r3092023 r3099513  
    122122                $language_description = esc_html(__('Seleccione el idioma para el proceso de pago.', 'eupago-gateway-for-woocommerce'));
    123123            }
    124             $enable_disable_title = __('Enable/Disable', 'eupago-gateway-for-woocommerce');
    125 
    126             // Translate title based on the selected language
    127             if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    128                 $enable_disable_title = __('Ativar/Desativar', 'eupago-gateway-for-woocommerce');
    129             } elseif ($admin_language === 'es_ES') {
    130                 $enable_disable_title = __('Activar/Desactivar', 'eupago-gateway-for-woocommerce');
    131                 $instructions_text = __('Instrucciones', 'eupago-gateway-for-woocommerce');
    132                 $description_instructions_text = __('Instrucciones que se añadirán a la página de agradecimiento y al correo electrónico enviado al cliente.', 'eupago-gateway-for-woocommerce');
    133                 $duplicated_payments_text = __('Pagos duplicados', 'eupago-gateway-for-woocommerce');
    134                 $allow_duplicated_text = __('Permitir pagos duplicados.', 'eupago-gateway-for-woocommerce');
    135                 $no_text = __('No', 'eupago-gateway-for-woocommerce');
    136                 $yes_text = __('Sí', 'eupago-gateway-for-woocommerce');
    137                 $data_expirada_text = __('Fecha de vencimiento', 'eupago-gateway-for-woocommerce');
    138                 $numero_dias_expirado = __('Número de días para que caduque el pago.', 'eupago-gateway-for-woocommerce');
    139                 $apenas_portugueses = __('¿Solo para clientes portugueses?', 'eupago-gateway-for-woocommerce');
    140                 $endereço_português = __('Habilitar solo para clientes cuya dirección esté en Portugal', 'eupago-gateway-for-woocommerce');
    141                 $orders_acima = __('Solo para pedidos superiores a', 'eupago-gateway-for-woocommerce');
    142                 $orders_description = __('Activar solo para pedidos superiores a x &euro; (exclusivo). Deje en blanco (o cero) para permitir cualquier valor de pedido.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('Por diseño, Multibanco solo permite pagos de 1 a 999999 &euro; (inclusive). Puede usar esta opción para limitar aún más este rango.', 'eupago-gateway-for-woocommerce');
    143                 $orders_abaixo = __('Solo para pedidos inferiores a', 'eupago-gateway-for-woocommerce');
    144                 $orders_abaixo_description = __('Activar solo para pedidos inferiores a x &euro; (exclusivo). Deje en blanco (o cero) para permitir cualquier valor de pedido.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('Por diseño, Multibanco solo permite pagos de 1 a 999999 &euro; (inclusive). Puede usar esta opción para limitar aún más este rango.', 'eupago-gateway-for-woocommerce');
    145                 $reduzir_stock = __('Reducir el stock', 'eupago-gateway-for-woocommerce');
    146                 $escolher_reduzir_stock = __('Elegir cuándo reducir el stock.', 'eupago-gateway-for-woocommerce');
    147                 $quando_order_paga = __('cuando el pedido se paga (requiere callback activo)', 'eupago-gateway-for-woocommerce');
    148                 $quando_order_colocada = __('cuando el pedido se realiza (antes del pago)', 'eupago-gateway-for-woocommerce');
    149             }
    150 
    151                 $this->form_fields = [
     124
     125            $this->form_fields = [
    152126                'enabled' => [
    153                     'title' => esc_html($enable_disable_title),
     127                    'title' => esc_html(__('Enable/Disable', 'eupago-gateway-for-woocommerce')),
    154128                    'type' => 'checkbox',
     129                    'label' => esc_html(__('Enable Credit Card (using Eupago)', 'eupago-gateway-for-woocommerce')),
    155130                    'default' => 'no',
    156131                ],
     132                'title' => [
     133                    'title' => esc_html(__('Title', 'eupago-gateway-for-woocommerce')),
     134                    'type' => 'text',
     135                    'description' => esc_html(__('This controls the title which the user sees during checkout.', 'eupago-gateway-for-woocommerce')),
     136                    'default' => esc_html__('Credit Card', 'eupago-gateway-for-woocommerce'),
     137                ],
     138                'description' => [
     139                    'title' => esc_html(__('Description', 'eupago-gateway-for-woocommerce')),
     140                    'type' => 'textarea',
     141                    'description' => esc_html(__('This controls the description which the user sees during checkout.', 'eupago-gateway-for-woocommerce')),
     142                    'default' => esc_html__('Pay with credit card', 'eupago-gateway-for-woocommerce'),
     143                ],
     144                'logo_url' => [
     145                    'title' => esc_html(__('Logo', 'eupago-gateway-for-woocommerce')),
     146                    'type' => 'text',
     147                    'description' => esc_html(__('Shop Logo for payment page', 'eupago-gateway-for-woocommerce')),
     148                    'default' => '',
     149                ],
    157150                'instructions' => [
    158                     'title' => esc_html($instructions_text),
     151                    'title' => esc_html(__('Instructions', 'eupago-gateway-for-woocommerce')),
    159152                    'type' => 'textarea',
    160                     'description' => esc_html($description_instructions_text),
    161                   ],
     153                    'description' => esc_html(__('Instructions that will be added to the thank you page and email sent to customer.', 'eupago-gateway-for-woocommerce')),
     154                ],
    162155                'only_portugal' => [
    163                     'title' => esc_html($apenas_portugueses),
     156                    'title' => esc_html(__('Only for Portuguese customers?', 'eupago-gateway-for-woocommerce')),
    164157                    'type' => 'checkbox',
    165                     'label' => esc_html($endereço_português),
     158                    'label' => esc_html(__('Enable only for customers whose address is in Portugal', 'eupago-gateway-for-woocommerce')),
    166159                    'default' => 'no',
    167                   ],
     160                ],
    168161                'only_above' => [
    169                     'title' => esc_html($orders_acima),
     162                    'title' => esc_html(__('Only for orders above', 'eupago-gateway-for-woocommerce')),
    170163                    'type' => 'number',
    171                     'description' => esc_html($orders_description),
    172                     'default' => '60',
    173                     'custom_attributes' => [
    174                        'min' => 60,
    175                        'max' => 2500,
    176                       ],
    177                   ],
     164                    'description' => esc_html(__('Enable only for orders above x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce')) . ' <br/> ' . esc_html(__('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce')),
     165                    'default' => 0,
     166                ],
    178167                'only_below' => [
    179                     'title' => esc_html($orders_abaixo),
     168                    'title' => esc_html(__('Only for orders below', 'eupago-gateway-for-woocommerce')),
    180169                    'type' => 'number',
    181                     'description' => esc_html($orders_abaixo_description),
    182                     'default' => '2500',
    183                     'custom_attributes' => [
    184                         'min' => 60,
    185                         'max' => 2500,
    186                     ]
    187                   ],
     170                    'description' => esc_html(__('Enable only for orders below x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce')) . ' <br/> ' . esc_html(__('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce')),
     171                    'default' => 0,
     172                ],
    188173                'stock_when' => [
    189                     'title' => esc_html ($reduzir_stock),
     174                    'title' => esc_html(__('Reduce stock', 'eupago-gateway-for-woocommerce')),
    190175                    'type' => 'select',
    191                     'description' =>esc_html ($escolher_reduzir_stock),
     176                    'description' => esc_html(__('Choose when to reduce stock.', 'eupago-gateway-for-woocommerce')),
    192177                    'default' => '',
    193178                    'options' => [
    194                       '' => esc_html($quando_order_paga),
    195                       'order' => esc_html($quando_order_colocada),
     179                        '' => esc_html(__('when order is paid (requires active callback)', 'eupago-gateway-for-woocommerce')),
     180                        'order' => esc_html(__('when order is placed (before payment)', 'eupago-gateway-for-woocommerce')),
    196181                    ],
     182                ],
     183                'language' => [
     184                    'title' => $language_title,
     185                    'type' => 'select',
     186                    'description' => $language_description,
     187                    'default' => 'default',
     188                    'options' => $language_options,
    197189                ],
    198190            ];
  • eupago-gateway-for-woocommerce/trunk/includes/class-wc-eupago-cofidispay.php

    r3092023 r3099513  
    8484        public function init_form_fields()
    8585        {
    86             $admin_language = get_locale();
    87             $enable_disable_title = __('Enable/Disable', 'eupago-gateway-for-woocommerce');
    88 
    89             // Translate title based on the selected language
    90             if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    91                 $enable_disable_title = __('Ativar/Desativar', 'eupago-gateway-for-woocommerce');
    92             } elseif ($admin_language === 'es_ES') {
    93                 $enable_disable_title = __('Activar/Desactivar', 'eupago-gateway-for-woocommerce');
    94             }
    95 
    96        
    97             // Default language options
    98             $language_options = [
    99                 'default' => __('Default', 'eupago-gateway-for-woocommerce'),
    100                 'pt' => __('Portuguese', 'eupago-gateway-for-woocommerce'),
    101                 'en' => __('English', 'eupago-gateway-for-woocommerce'),
    102                 'es' => __('Spanish', 'eupago-gateway-for-woocommerce'),
    103             ];
    104 
    105             // Translate language options if the admin language is not English
    106             if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    107                 $language_options['default'] = __('Por padrão', 'eupago-gateway-for-woocommerce');
    108                 $language_options['pt'] = __('Português', 'eupago-gateway-for-woocommerce');
    109                 $language_options['en'] = __('Inglês', 'eupago-gateway-for-woocommerce');
    110                 $language_options['es'] = __('Espanhol', 'eupago-gateway-for-woocommerce');
    111             } elseif ($admin_language === 'es_ES') {
    112                 $language_options['default'] = __('Default', 'eupago-gateway-for-woocommerce');
    113                 $language_options['pt'] = __('Portuguese', 'eupago-gateway-for-woocommerce');
    114                 $language_options['en'] = __('English', 'eupago-gateway-for-woocommerce');
    115                 $language_options['es'] = __('Spanish', 'eupago-gateway-for-woocommerce');
    116             }
    117 
    118             $texts = [
    119                 'enable_disable' => __('Enable/Disable', 'woocommerce'),
    120                 'enable_label' => __('Enable CofidisPay (using Eupago)', 'eupago-for-woocommerce'),
     86            $this->form_fields = [
     87              'enabled' => [
     88                'title' => __('Enable/Disable', 'woocommerce'),
     89                'type' => 'checkbox',
     90                'label' => __('Enable CofidisPay (using Eupago)', 'eupago-for-woocommerce'),
     91                'default' => 'no',
     92              ],
     93              'title' => [
    12194                'title' => __('Title', 'woocommerce'),
    122                 'title_description' => __('This controls the title which the user sees during checkout.', 'woocommerce'),
    123                 'title_default' => __('Cofidis Pay', 'eupago-for-woocommerce'),
    124                 'instructions' => __('Instructions', 'eupago-for-woocommerce'),
    125                 'instructions_description' => __('Instructions that will be added to the thank you page and email sent to customer.', 'eupago-for-woocommerce'),
    126                 'only_portugal' => __('Only for Portuguese customers?', 'eupago-for-woocommerce'),
    127                 'only_portugal_label' => __('Enable only for customers whose address is in Portugal', 'eupago-for-woocommerce'),
    128                 'only_above' => __('Only for orders above', 'eupago-gateway-for-woocommerce'),
    129                 'only_above_description' => __('Enable only for orders above x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('The order value must fall within the limits set by Cofidis.', 'eupago-gateway-for-woocommerce'),
    130                 'only_below' => __('Only for orders below', 'eupago-gateway-for-woocommerce'),
    131                 'only_below_description' => __('Enable only for orders below x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('The order value must fall within the limits set by Cofidis.', 'eupago-gateway-for-woocommerce'),
    132                 'reduce_stock' => __('Reduce stock', 'eupago-for-woocommerce'),
    133                 'reduce_stock_description' => __('Choose when to reduce stock.', 'eupago-for-woocommerce'),
    134                 'when_order_is_paid' => __('when order is paid (requires active callback)', 'eupago-gateway-for-woocommerce'),
    135                 'when_order_is_placed' =>  __('when order is placed (before payment)', 'eupago-gateway-for-woocommerce'),
    136                 'zero_tax_code' => __('Code for Zero Tax', 'eupago-for-woocommerce'),
    137                 'zero_tax_code_description' => __('Select the code justification for enabling zero tax, keep disabled for default', 'eupago-for-woocommerce'),
    138                 'zero_tax_options' => [
    139                     'null' => __('Disable zero tax justification', 'eupago-for-woocommerce'),
    140                     'M01' => __('M01 - Article 16º no. 6 of the VAT Code.', 'eupago-for-woocommerce'),
    141                     'M02' => __('M02 - Article 6º of Decree-Law no. 198/90, of June 19.', 'eupago-for-woocommerce'),
    142                     'M03' => __('M03 - Cash demand.', 'eupago-for-woocommerce'),
    143                     'M04' => __('M04 - Exempt Article 13º of the VAT Code.', 'eupago-for-woocommerce'),
    144                     'M05' => __('M05 - Exempt Article 14º of the VAT Code.', 'eupago-for-woocommerce'),
    145                     'M06' => __('M06 - Exempt Article 15º of the VAT Code.', 'eupago-for-woocommerce'),
    146                     'M07' => __('M07 - Exempt Article 9º of the VAT Code.', 'eupago-for-woocommerce'),
    147                     'M08' => __('M08 - VAT is self-assessment.', 'eupago-for-woocommerce'),
    148                     'M09' => __('M09 - VAT - does not confer right to deduction.', 'eupago-for-woocommerce'),
    149                     'M10' => __('M10 - VAT is Exemption Regime.', 'eupago-for-woocommerce'),
    150                     'M11' => __('M11 - Special tobacco regime.', 'eupago-for-woocommerce'),
    151                     'M12' => __('M12 - Profit margin scheme - Travel agencies.', 'eupago-for-woocommerce'),
    152                     'M13' => __('M13 - Profit margin scheme - Second-hand goods.', 'eupago-for-woocommerce'),
    153                     'M14' => __('M14 - Profit margin scheme - Works of art.', 'eupago-for-woocommerce'),
    154                     'M15' => __('M15 - Profit margin scheme - Collection items and antiques.', 'eupago-for-woocommerce'),
    155                     'M16' => __('M16 - Exempt Article 14º of the RITI.', 'eupago-for-woocommerce'),
    156                     'M19' => __('M19 - Other exemptions', 'eupago-for-woocommerce'),
    157                     'M20' => __('M20 - VAT - flat-rate scheme', 'eupago-for-woocommerce'),
    158                     'M21' => __('M21 - VAT - does not confer right to deduction (or similar expression)', 'eupago-for-woocommerce'),
    159                     'M25' => __('M25 - Goods on consignment', 'eupago-for-woocommerce'),
    160                     'M26' => __('M26 - VAT exemption with right to deduction in the food basket', 'eupago-for-woocommerce'),
    161                     'M30' => __('M30 - VAT is self-assessment.', 'eupago-for-woocommerce'),
    162                     'M31' => __('M31 - VAT is self-assessment.', 'eupago-for-woocommerce'),
    163                     'M32' => __('M32 - VAT is self-assessment.', 'eupago-for-woocommerce'),
    164                     'M33' => __('M33 - VAT is self-assessment.', 'eupago-for-woocommerce'),
    165                     'M34' => __('M34 - VAT is self-assessment.', 'eupago-for-woocommerce'),
    166                     'M40' => __('M40 - VAT is self-assessment.', 'eupago-for-woocommerce'),
    167                     'M41' => __('M41 - VAT is self-assessment.', 'eupago-for-woocommerce'),
    168                     'M42' => __('M42 - VAT is self-assessment.', 'eupago-for-woocommerce'),
    169                     'M43' => __('M43 - VAT is self-assessment.', 'eupago-for-woocommerce'),
    170                     'M99' => __('M99 - Not subject; not taxed (or similar).', 'eupago-for-woocommerce')
     95                'type' => 'text',
     96                'description' => __('This controls the title which the user sees during checkout.', 'woocommerce'),
     97                'default' => __('Cofidis Pay', 'eupago-for-woocommerce'),
     98              ],
     99              'instructions' => [
     100                'title' => __('Instructions', 'eupago-for-woocommerce'),
     101                'type' => 'textarea',
     102                'description' => __('Instructions that will be added to the thank you page and email sent to customer.', 'eupago-for-woocommerce'),
     103              ],
     104              'only_portugal' => [
     105                'title' => __('Only for Portuguese customers?', 'eupago-for-woocommerce'),
     106                'type' => 'checkbox',
     107                'label' => __('Enable only for customers whose address is in Portugal', 'eupago-for-woocommerce'),
     108                'default' => 'no',
     109              ],
     110              'only_above' => [
     111                'title' => __('Only for orders above', 'eupago-gateway-for-woocommerce'),
     112                'type' => 'number',
     113                'description' => __('Enable only for orders above x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('The order value must fall within the limits set by Cofidis.', 'eupago-gateway-for-woocommerce'),
     114                'default' => '60',
     115                'custom_attributes' => [
     116                  'min' => 60,
     117                  'max' => 2500,
    171118                ],
    172                 'max_installments' => __('Maximum Amount of Installments', 'eupago-for-woocommerce'),
    173                 'max_installments_description' => __('Change the text for Cofidis Pay to display a maximum amount of installments', 'eupago-for-woocommerce'),
    174                 'installment_options' => [
    175                     '0' => __('Disable this option', 'eupago-for-woocommerce'),
    176                     '3' => __('x3', 'eupago-for-woocommerce'),
    177                     '4' => __('x4', 'eupago-for-woocommerce'),
    178                     '5' => __('x5', 'eupago-for-woocommerce'),
    179                     '6' => __('x6', 'eupago-for-woocommerce'),
    180                     '7' => __('x7', 'eupago-for-woocommerce'),
    181                     '8' => __('x8', 'eupago-for-woocommerce'),
    182                     '9' => __('x9', 'eupago-for-woocommerce'),
    183                     '10' => __('x10', 'eupago-for-woocommerce'),
    184                     '11' => __('x11', 'eupago-for-woocommerce'),
    185                     '12' => __('x12', 'eupago-for-woocommerce'),
     119              ],
     120              'only_below' => [
     121                'title' => __('Only for orders below', 'eupago-gateway-for-woocommerce'),
     122                'type' => 'number',
     123                'description' => __('Enable only for orders below x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('The order value must fall within the limits set by Cofidis.', 'eupago-gateway-for-woocommerce'),
     124                'default' => '2500',
     125                'custom_attributes' => [
     126                  'min' => 60,
     127                  'max' => 2500,
    186128                ],
    187             ];
    188             // Traduzir com base no idioma selecionado
    189             if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    190                 $texts = [
    191                     'enable_disable' => 'Ativar/Desativar',
    192                     'enable_label' => 'Ativar CofidisPay (usando Eupago)',
    193                     'title' => 'Título',
    194                     'title_description' => 'Controla o título que o usuário vê durante o checkout.',
    195                     'title_default' => 'Cofidis Pay',
    196                     'instructions' => 'Instruções',
    197                     'instructions_description' => 'Instruções que serão adicionadas à página de agradecimento e ao e-mail enviado ao cliente.',
    198                     'only_portugal' => 'Apenas para clientes portugueses?',
    199                     'only_portugal_label' => 'Ativar apenas para clientes cujo endereço é em Portugal',
    200                     'only_above' => 'Apenas para pedidos acima de',
    201                     'only_above_description' => 'Ativar apenas para pedidos acima de x € (exclusivo). Deixe em branco (ou zero) para permitir qualquer valor de pedido. O valor do pedido deve estar dentro dos limites estabelecidos pela Cofidis.',
    202                     'only_below' => 'Apenas para pedidos abaixo de',
    203                     'only_below_description' => 'Ativar apenas para pedidos abaixo de x € (exclusivo). Deixe em branco (ou zero) para permitir qualquer valor de pedido. O valor do pedido deve estar dentro dos limites estabelecidos pela Cofidis.',
    204                     'reduce_stock' => 'Reduzir o stock',
    205                     'reduce_stock_description' => 'Escolha quando reduzir o stock.',
    206                     'when_order_is_paid' => __('quando o pedido é pago (requer callback ativo)', 'eupago-for-woocommerce'),
    207                     'when_order_is_placed' => __('quando o pedido é feito (antes do pagamento)', 'eupago-for-woocommerce'),
    208                     'zero_tax_code' => 'Código para Imposto Zero',
    209                     'zero_tax_code_description' => 'Selecione a justificação do código para habilitar o imposto zero, mantenha desativado para o padrão.',
    210                     'zero_tax_options' => [
    211                         'null' => 'Desativar justificação de imposto zero',
    212                         'M01' => 'M01 - Artigo 16º nº 6 do CIVA.',
    213                         'M02' => 'M02 - Artigo 6º do Decreto-Lei nº 198/90, de 19 de Junho.',
    214                         'M03' => 'M03 - Exigibilidade de caixa.',
    215                         'M04' => 'M04 - Isento Artigo 13º do CIVA.',
    216                         'M05' => 'M05 - Isento Artigo 14º do CIVA.',
    217                         'M06' => 'M06 - Isento Artigo 15º do CIVA.',
    218                         'M07' => 'M07 - Isento Artigo 9º do CIVA.',
    219                         'M08' => 'M08 - IVA é autoliquidação.',
    220                         'M09' => 'M09 - IVA - não confere direito à dedução.',
    221                         'M10' => 'M10 - IVA é Regime de Isenção.',
    222                         'M11' => 'M11 - Regime especial de tabaco.',
    223                         'M12' => 'M12 - Esquema de margem de lucro - Agências de viagens.',
    224                         'M13' => 'M13 - Esquema de margem de lucro - Artigos de segunda mão.',
    225                         'M14' => 'M14 - Esquema de margem de lucro - Obras de arte.',
    226                         'M15' => 'M15 - Esquema de margem de lucro - Itens de coleção e antiguidades.',
    227                         'M16' => 'M16 - Isento Artigo 14º do RITI.',
    228                         'M19' => 'M19 - Outras isenções',
    229                         'M20' => 'M20 - IVA - regime de taxa fixa',
    230                         'M21' => 'M21 - IVA - não confere direito à dedução (ou expressão similar)',
    231                         'M25' => 'M25 - Mercadorias em consignação',
    232                         'M26' => 'M26 - Isenção de IVA com direito à dedução na cesta de alimentos',
    233                         'M30' => 'M30 - IVA é autoliquidação.',
    234                         'M31' => 'M31 - IVA é autoliquidação.',
    235                         'M32' => 'M32 - IVA é autoliquidação.',
    236                         'M33' => 'M33 - IVA é autoliquidação.',
    237                         'M34' => 'M34 - IVA é autoliquidação.',
    238                         'M40' => 'M40 - IVA é autoliquidação.',
    239                         'M41' => 'M41 - IVA é autoliquidação.',
    240                         'M42' => 'M42 - IVA é autoliquidação.',
    241                         'M43' => 'M43 - IVA é autoliquidação.',
    242                         'M99' => 'M99 - Não sujeito; não tributado (ou similar).',
    243 
    244                     ],
    245                     'max_installments' => 'Valor Máximo de Parcelas',
    246                     'max_installments_description' => 'Altere o texto para Cofidis Pay para exibir um valor máximo de parcelas.',
    247                     'installment_options' => [
    248                         '0' => 'Desativar esta opção',
    249                         '3' => 'x3',
    250                         '4' => 'x4',
    251                         '5' => 'x5',
    252                         '6' => 'x6',
    253                         '7' => __('x7', 'eupago-for-woocommerce'),
    254                         '8' => __('x8', 'eupago-for-woocommerce'),
    255                         '9' => __('x9', 'eupago-for-woocommerce'),
    256                         '10' => __('x10', 'eupago-for-woocommerce'),
    257                         '11' => __('x11', 'eupago-for-woocommerce'),
    258                         '12' => __('x12', 'eupago-for-woocommerce'),
    259                     ],
    260                 ];
    261                
    262                
    263             } elseif ($admin_language ==='es_ES') {
    264                 $texts = [
    265                     'enable_disable' => 'Activar/Desactivar',
    266                     'enable_label' => 'Activar CofidisPay (usando Eupago)',
    267                     'title' => 'Título',
    268                     'title_description' => 'Controla el título que el usuario ve durante el proceso de pago.',
    269                     'title_default' => 'Cofidis Pay',
    270                     'instructions' => 'Instrucciones',
    271                     'instructions_description' => 'Instrucciones que se añadirán a la página de agradecimiento y al correo electrónico enviado al cliente.',
    272                     'only_portugal' => '¿Solo para clientes portugueses?',
    273                     'only_portugal_label' => 'Activar solo para clientes cuya dirección está en Portugal',
    274                     'only_above' => 'Solo para pedidos superiores a',
    275                     'only_above_description' => 'Activar solo para pedidos superiores a x € (exclusivo). Deje en blanco (o cero) para permitir cualquier valor de pedido. El valor del pedido debe estar dentro de los límites establecidos por Cofidis.',
    276                     'only_below' => 'Solo para pedidos inferiores a',
    277                     'only_below_description' => 'Activar solo para pedidos inferiores a x € (exclusivo). Deje en blanco (o cero) para permitir cualquier valor de pedido. El valor del pedido debe estar dentro de los límites establecidos por Cofidis.',
    278                     'reduce_stock' => 'Reducir el stock',
    279                     'reduce_stock_description' => 'Elija cuándo reducir el stock.',
    280                     'when_order_is_paid' => __('cuando el pedido está pagado (requiere callback activo)', 'eupago-for-woocommerce'),
    281                     'when_order_is_placed' => __('cuando se realiza el pedido (antes del pago)', 'eupago-for-woocommerce'),
    282                     'zero_tax_code' => 'Código para Impuesto Cero',
    283                     'zero_tax_code_description' => 'Seleccione la justificación del código para habilitar el impuesto cero, mantenga desactivado para el valor predeterminado.',
    284                     'zero_tax_options' => [
    285                         'null' => 'Desactivar justificación de impuesto cero',
    286                         'M01' => 'M01 - Artículo 16º nº 6 del CIVA.',
    287                         'M02' => 'M02 - Artículo 6º del Decreto-Ley nº 198/90, de 19 de Junio.',
    288                         'M03' => 'M03 - Exigibilidad de caja.',
    289                         'M04' => 'M04 - Exento Artículo 13º del CIVA.',
    290                         'M05' => 'M05 - Exento Artículo 14º del CIVA.',
    291                         'M06' => 'M06 - Exento Artículo 15º del CIVA.',
    292                         'M07' => 'M07 - Exento Artículo 9º del CIVA.',
    293                         'M08' => 'El IVA es autoretenido.',
    294                         'M09' => 'M09 - IVA - no confiere derecho a deducción.',
    295                         'M10' => 'M10 - IVA es Régimen de Exención.',
    296                         'M11' => 'M11 - Régimen especial de tabaco.',
    297                         'M12' => 'M12 - Esquema de margen de beneficio - Agencias de viajes.',
    298                         'M13' => 'M13 - Esquema de margen de beneficio - Artículos de segunda mano.',
    299                         'M14' => 'M14 - Esquema de margen de beneficio - Obras de arte.',
    300                         'M15' => 'M15 - Esquema de margen de beneficio - Artículos de colección y antigüedades.',
    301                         'M16' => 'M16 - Exento Artículo 14º del RITI.',
    302                         'M19' => 'M19 - Otras exenciones',
    303                         'M20' => 'M20 - IVA - régimen de tasa fija',
    304                         'M21' => 'M21 - IVA - no confiere derecho a deducción (o expresión similar)',
    305                         'M25' => 'M25 - Mercancías en consignación',
    306                         'M26' => 'M26 - Exención de IVA con derecho a deducción en la cesta de alimentos',
    307                         'M30' => 'M30 - El IVA es autoretenido.',
    308                         'M31' => 'M31 - El IVA es autoretenido.',
    309                         'M32' => 'M32 - El IVA es autoretenido.',
    310                         'M33' => 'M33 - El IVA es autoretenido.',
    311                         'M34' => 'M34 - El IVA es autoretenido.',
    312                         'M40' => 'M40 - El IVA es autoretenido.',
    313                         'M41' => 'M41 - El IVA es autoretenido.',
    314                         'M42' => 'M42 - El IVA es autoretenido.',
    315                         'M43' => 'M43 - El IVA es autoretenido.',
    316                         'M99' => 'M99 - No sujeto; no gravado (o similar).',
    317                     ],
    318                     'max_installments' => 'Valor Máximo de Cuotas',
    319                     'max_installments_description' => 'Cambie el texto para Cofidis Pay para mostrar un valor máximo de cuotas.',
    320                     'installment_options' => [
    321                         '0' => 'Desactivar esta opción',
    322                         '3' => 'x3',
    323                         '4' => 'x4',
    324                         '5' => 'x5',
    325                         '6' => 'x6',
    326                         '7' => __('x7', 'eupago-for-woocommerce'),
    327                         '8' => __('x8', 'eupago-for-woocommerce'),
    328                         '9' => __('x9', 'eupago-for-woocommerce'),
    329                         '10' => __('x10', 'eupago-for-woocommerce'),
    330                         '11' => __('x11', 'eupago-for-woocommerce'),
    331                         '12' => __('x12', 'eupago-for-woocommerce'),
    332                     ],
    333                 ];
    334                
    335             }
    336    
    337             $this->form_fields = [
    338                 'enabled' => [
    339                     'title' => $texts['enable_disable'],
    340                     'type' => 'checkbox',
    341                     'label' => $texts['enable_label'],
    342                     'default' => 'no',
     129              ],
     130              'stock_when' => [
     131                'title' => __('Reduce stock', 'eupago-for-woocommerce'),
     132                'type' => 'select',
     133                'description' => __('Choose when to reduce stock.', 'eupago-for-woocommerce'),
     134                'default' => '',
     135                'options' => [
     136                  '' => __('when order is paid (requires active callback)', 'eupago-for-woocommerce'),
     137                  'order' => __('when order is placed (before payment)', 'eupago-for-woocommerce'),
    343138                ],
    344                 'title' => [
    345                     'title' => $texts['title'],
    346                     'type' => 'text',
    347                     'description' => $texts['title_description'],
    348                     'default' => $texts['title_default'],
     139              ],
     140              'zero_tax_code' => [
     141                'title' => __('Code for Zero Tax', 'eupago-for-woocommerce'),
     142                'type' => 'select',
     143                'description' => __('Select the code justification for enabling zero tax, keep disabled for default', 'eupago-for-woocommerce'),
     144                'default' => '',
     145                'options' => [
     146                'null' => __('Disable zero tax justification', 'eupago-for-woocommerce'),
     147                'M01' => __('M01 - Artigo 16º nº 6 do CIVA.', 'eupago-for-woocommerce'),
     148                'M02' => __('M02 - Artigo 6º do Decreto ‐ Lei nº 198/90, de 19 de Junho.', 'eupago-for-woocommerce'),
     149                'M03' => __('M03 - Exigibilidade de caixa.', 'eupago-for-woocommerce'),
     150                'M04' => __('M04 - Isento Artigo 13º do CIVA.', 'eupago-for-woocommerce'),
     151                'M05' => __('M05 - Isento Artigo 14º do CIVA.', 'eupago-for-woocommerce'),
     152                'M06' => __('M06 - Isento Artigo 15º do CIVA.', 'eupago-for-woocommerce'),
     153                'M07' => __('M07 - Isento Artigo 9º do CIVA.', 'eupago-for-woocommerce'),
     154                'M08' => __('M08 - IVA – autoliquidação.', 'eupago-for-woocommerce'),
     155                'M09' => __('M09 - IVA - não confere direito a dedução.', 'eupago-for-woocommerce'),
     156                'M10' => __('M10 - IVA – Regime de isenção.', 'eupago-for-woocommerce'),
     157                'M11' => __('M11 - Regime particular do tabaco.', 'eupago-for-woocommerce'),
     158                'M12' => __('M12 - Regime da margem de lucro – Agências de viagens.', 'eupago-for-woocommerce'),
     159                'M13' => __('M13 - Regime da margem de lucro – Bens em segunda mão.', 'eupago-for-woocommerce'),
     160                'M14' => __('M14 - Regime da margem de lucro – Objetos de arte.', 'eupago-for-woocommerce'),
     161                'M15' => __('M15 - Regime da margem de lucro – Objetos de coleção e antiguidades.', 'eupago-for-woocommerce'),
     162                'M16' => __('M16 - Isento Artigo 14º do RITI.', 'eupago-for-woocommerce'),
     163                'M19' => __('M19 - Outras isenções', 'eupago-for-woocommerce'),
     164                'M20' => __('M20 - IVA -regime forfetário', 'eupago-for-woocommerce'),
     165                'M21' => __('M21 - IVA - não confere direito à dedução (ou expressão similar)', 'eupago-for-woocommerce'),
     166                'M25' => __('M25 - Mercadorias à consignação', 'eupago-for-woocommerce'),
     167                'M26' => __('M26 - Isenção de IVA com direito à dedução no cabaz alimentar', 'eupago-for-woocommerce'),
     168                'M30' => __('M30 - IVA – autoliquidação.', 'eupago-for-woocommerce'),
     169                'M31' => __('M31 - IVA – autoliquidação.', 'eupago-for-woocommerce'),
     170                'M32' => __('M32 - IVA – autoliquidação.', 'eupago-for-woocommerce'),
     171                'M33' => __('M33 - IVA – autoliquidação.', 'eupago-for-woocommerce'),
     172                'M34' => __('M34 - IVA – autoliquidação.', 'eupago-for-woocommerce'),
     173                'M40' => __('M40 - IVA – autoliquidação.', 'eupago-for-woocommerce'),
     174                'M41' => __('M41 - IVA – autoliquidação.', 'eupago-for-woocommerce'),
     175                'M42' => __('M42 - IVA – autoliquidação.', 'eupago-for-woocommerce'),
     176                'M43' => __('M43 - IVA – autoliquidação.', 'eupago-for-woocommerce'),
     177                'M99' => __('M99 - Não sujeito; não tributado (ou similar).', 'eupago-for-woocommerce'),
    349178                ],
    350                 'instructions' => [
    351                     'title' => $texts['instructions'],
    352                     'type' => 'textarea',
    353                     'description' => $texts['instructions_description'],
     179              ],
     180              'max_installments' => [
     181                'title' => __('Maximum Amount of Installments', 'eupago-for-woocommerce'),
     182                'type' => 'select',
     183                'description' => __('Change the text for Cofidis Pay to display a maximum amount of installments', 'eupago-for-woocommerce'),
     184                'default' => '',
     185                'options' => [
     186                '0' => __('Disable this option', 'eupago-for-woocommerce'),
     187                '3' => __('x3', 'eupago-for-woocommerce'),
     188                '4' => __('x4', 'eupago-for-woocommerce'),
     189                '5' => __('x5', 'eupago-for-woocommerce'),
     190                '6' => __('x6', 'eupago-for-woocommerce'),
     191                '7' => __('x7', 'eupago-for-woocommerce'),
     192                '8' => __('x8', 'eupago-for-woocommerce'),
     193                '9' => __('x9', 'eupago-for-woocommerce'),
     194                '10' => __('x10', 'eupago-for-woocommerce'),
     195                '11' => __('x11', 'eupago-for-woocommerce'),
     196                '12' => __('x12', 'eupago-for-woocommerce'),
    354197                ],
    355                 'only_portugal' => [
    356                     'title' => $texts['only_portugal'],
    357                     'type' => 'checkbox',
    358                     'label' => $texts['only_portugal_label'],
    359                     'default' => 'no',
    360                 ],
    361                 'only_above' => [
    362                     'title' => $texts['only_above'],
    363                     'type' => 'number',
    364                     'description' => $texts['only_above_description'],
    365                     'default' => '60',
    366                     'custom_attributes' => [
    367                         'min' => 60,
    368                         'max' => 2500,
    369                     ],
    370                 ],
    371                 'only_below' => [
    372                     'title' => $texts['only_below'],
    373                     'type' => 'number',
    374                     'description' => $texts['only_below_description'],
    375                     'default' => '2500',
    376                     'custom_attributes' => [
    377                         'min' => 60,
    378                         'max' => 2500,
    379                     ],
    380                 ],
    381                 'stock_when' => [
    382                     'title' => $texts['reduce_stock'],
    383                     'type' => 'select',
    384                     'description' => $texts['reduce_stock_description'],
    385                     'default' => '',
    386                     'options' => [
    387                         '' => $texts['when_order_is_paid'],
    388                         'order' => $texts['when_order_is_placed'],
    389                     ],
    390                 ],
    391                 'zero_tax_code' => [
    392                     'title' => $texts['zero_tax_code'],
    393                     'type' => 'select',
    394                     'description' => $texts['zero_tax_code_description'],
    395                     'default' => '',
    396                     'options' => $texts['zero_tax_options'],
    397                 ],
    398                 'max_installments' => [
    399                     'title' => $texts['max_installments'],
    400                     'type' => 'select',
    401                     'description' => $texts['max_installments_description'],
    402                     'default' => '',
    403                     'options' => $texts['installment_options'],
    404                 ],
     198              ],
    405199            ];
    406200        }
     
    464258                  'referencia' => $order->get_meta('_eupago_cofidispay_referencia', true),
    465259                  'order_total' => $order_total,
    466                 ], 'woocommerce/eupago/', (new WC_Eupago())->get_templates_path());
     260                ], 'woocommerce/eupago/', WC_Eupago::get_templates_path());
    467261            }
    468262        }
     
    499293                  'referencia' => $order->get_meta('_eupago_cofidispay_referencia', true),
    500294                  'order_total' => $order_total,
    501                 ], 'woocommerce/eupago/', (new WC_Eupago())->get_templates_path());
     295                ], 'woocommerce/eupago/', WC_Eupago::get_templates_path());
    502296            } else {
    503297                wc_get_template('emails/html-instructions.php', [
     
    507301                  'referencia' => $order->get_meta('_eupago_cofidispay_referencia', true),
    508302                  'order_total' => $order_total,
    509                 ], 'woocommerce/eupago/', (new WC_Eupago())->get_templates_path());
     303                ], 'woocommerce/eupago/', WC_Eupago::get_templates_path());
    510304            }
    511305        }
     
    517311            // }
    518312
    519             echo '<p>' . __('Será redirecionado para uma página segura a fim de efetuar o pagamento.<br/>O pagamento das prestações com 0% de juros e encargos serão efetuado no cartão de débito ou crédito do cliente através da solução de pagamento assente em contrato de factoring entre a Cofidis e o comerciante. Informe-se na <a href="https://www.cofidis.pt/cofidispay" target="_blank">Cofidis</a>, registada no Banco de Portugal com o N. 921.', 'eupago-for-woocommerce') . '</p>';
     313            echo '<p>' . __('Será redirecionado para uma página segura a fim de efetuar o pagamento.<br/>O pagamento das prestações com 0% de juros e encargos será efetuado no cartão de débito ou crédito do cliente através da solução de pagamento assente em contrato de factoring entre a Cofidis e o comerciante. Informe-se na <a href="https://www.cofidis.pt/cofidispay" target="_blank">Cofidis</a>, registada no Banco de Portugal com o N.º 921.', 'eupago-for-woocommerce') . '</p>';
    520314            $this->cofidispay_form();
    521315        }
     
    666460
    667461            if ($order->get_payment_method() == $this->id) {
    668                 return (new WC_Eupago())->woocommerce_payment_complete_reduce_order_stock($bool, $order, $this->id, $this->stock_when);
     462                return WC_Eupago::woocommerce_payment_complete_reduce_order_stock($bool, $order, $this->id, $this->stock_when);
    669463            } else {
    670464                return $bool;
  • eupago-gateway-for-woocommerce/trunk/includes/class-wc-eupago-mbway.php

    r3092023 r3099513  
    4141            // User settings
    4242            $this->title = $this->get_option('title');
     43            $this->description = $this->get_option('description');
    4344            $this->instructions = $this->get_option('instructions');
    4445            $this->only_portugal = $this->get_option('only_portugal');
     
    8788        }
    8889
    89         public function init_form_fields(){
    90                 // Get the current language of the WooCommerce admin page
    91                 $admin_language = get_locale();
    92                 // Default language options
    93                 $language_options = [
    94                     'default' => __('Default', 'eupago-gateway-for-woocommerce'),
    95                     'pt' => __('Portuguese', 'eupago-gateway-for-woocommerce'),
    96                     'en' => __('English', 'eupago-gateway-for-woocommerce'),
    97                     'es' => __('Spanish', 'eupago-gateway-for-woocommerce'),
    98                 ];
    99    
    100                 // Translate language options if the admin language is not English
    101                 if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    102                     $language_options['default'] = __('Por padrão', 'eupago-gateway-for-woocommerce');
    103                     $language_options['pt'] = __('Português', 'eupago-gateway-for-woocommerce');
    104                     $language_options['en'] = __('Inglês', 'eupago-gateway-for-woocommerce');
    105                     $language_options['es'] = __('Espanhol', 'eupago-gateway-for-woocommerce');
    106                 } elseif ($admin_language === 'es_ES') {
    107                     $language_options['default'] = __('Default', 'eupago-gateway-for-woocommerce');
    108                     $language_options['pt'] = __('Portuguese', 'eupago-gateway-for-woocommerce');
    109                     $language_options['en'] = __('English', 'eupago-gateway-for-woocommerce');
    110                     $language_options['es'] = __('Spanish', 'eupago-gateway-for-woocommerce');
    111                 }
    112    
    113                 // Translate title based on the selected language
    114                 $language_title = esc_html(__('Language', 'eupago-gateway-for-woocommerce'));
    115                 $language_description = esc_html(__('Select the language for the payment process.', 'eupago-gateway-for-woocommerce'));
    116    
    117                 if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    118                     $language_title = esc_html(__('Idioma', 'eupago-gateway-for-woocommerce'));
    119                     $language_description = esc_html(__('Selecione o idioma para o processo de pagamento.', 'eupago-gateway-for-woocommerce'));
    120                 } elseif ($admin_language === 'es_ES') {
    121                     $language_title = esc_html(__('Idioma', 'eupago-gateway-for-woocommerce'));
    122                     $language_description = esc_html(__('Seleccione el idioma para el proceso de pago.', 'eupago-gateway-for-woocommerce'));
    123                 }
    124    
    125                 $enable_disable_title = __('Enable/Disable', 'eupago-gateway-for-woocommerce');
    126                 $instructions_text = __('Instructions', 'eupago-gateway-for-woocommerce');
    127                 $description_instructions_text = __('Instructions that will be added to the thank you page and email sent to customer.','eupago-gateway-for-woocommerce');
    128                 $duplicated_payments_text = __('Duplicate payments', 'eupago-gateway-for-woocommerce');
    129                 $allow_duplicated_text = __('Allow duplicate payments.', 'eupago-gateway-for-woocommerce');
    130                 $no_text = __('No', 'eupago-gateway-for-woocommerce');
    131                 $yes_text = __('Yes', 'eupago-gateway-for-woocommerce');
    132                 $data_expirada_text = __('Expire Date', 'eupago-gateway-for-woocommerce');
    133                 $numero_dias_expirado = __('Number of days to payment expire.', 'eupago-gateway-for-woocommerce');
    134                 $apenas_portugueses = __('Only for Portuguese customers?', 'eupago-gateway-for-woocommerce');
    135                 $endereço_português = __('Enable only for customers whose address is in Portugal', 'eupago-gateway-for-woocommerce');
    136                 $orders_acima = __('Only for orders above', 'eupago-gateway-for-woocommerce');
    137                 $orders_description .= __('Enable only for orders above x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce');
    138                 $orders_abaixo = __('Only for orders below', 'eupago-gateway-for-woocommerce');
    139                 $orders_abaixo_description = __('Enable only for orders below x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce');
    140                 $reduzir_stock = __('Reduce stock', 'eupago-gateway-for-woocommerce');
    141                 $escolher_reduzir_stock = __('Choose when to reduce stock.', 'eupago-gateway-for-woocommerce');
    142                 $quando_order_paga = __('when order is paid (requires active callback)', 'eupago-gateway-for-woocommerce');
    143                 $quando_order_colocada =  __('when order is placed (before payment)', 'eupago-gateway-for-woocommerce');
    144    
    145                 // Translate title based on the selected language
    146                 if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    147                     $enable_disable_title = __('Ativar/Desativar', 'eupago-gateway-for-woocommerce');
    148                    
    149                 } elseif ($admin_language === 'es_ES') {
    150                     $enable_disable_title = __('Activar/Desactivar', 'eupago-gateway-for-woocommerce');
    151                     $instructions_text = __('Instrucciones', 'eupago-gateway-for-woocommerce');
    152                     $description_instructions_text = __('Instrucciones que se añadirán a la página de agradecimiento y al correo electrónico enviado al cliente.', 'eupago-gateway-for-woocommerce');
    153                     $duplicated_payments_text = __('Pagos duplicados', 'eupago-gateway-for-woocommerce');
    154                     $allow_duplicated_text = __('Permitir pagos duplicados.', 'eupago-gateway-for-woocommerce');
    155                     $no_text = __('No', 'eupago-gateway-for-woocommerce');
    156                     $yes_text = __('Sí', 'eupago-gateway-for-woocommerce');
    157                     $data_expirada_text = __('Fecha de vencimiento', 'eupago-gateway-for-woocommerce');
    158                     $numero_dias_expirado = __('Número de días para que caduque el pago.', 'eupago-gateway-for-woocommerce');
    159                     $apenas_portugueses = __('¿Solo para clientes portugueses?', 'eupago-gateway-for-woocommerce');
    160                     $endereço_português = __('Habilitar solo para clientes cuya dirección esté en Portugal', 'eupago-gateway-for-woocommerce');
    161                     $orders_acima = __('Solo para pedidos superiores a', 'eupago-gateway-for-woocommerce');
    162                     $orders_description = __('Activar solo para pedidos superiores a x &euro; (exclusivo). Deje en blanco (o cero) para permitir cualquier valor de pedido.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('Por diseño, Multibanco solo permite pagos de 1 a 999999 &euro; (inclusive). Puede usar esta opción para limitar aún más este rango.', 'eupago-gateway-for-woocommerce');
    163                     $orders_abaixo = __('Solo para pedidos inferiores a', 'eupago-gateway-for-woocommerce');
    164                     $orders_abaixo_description = __('Activar solo para pedidos inferiores a x &euro; (exclusivo). Deje en blanco (o cero) para permitir cualquier valor de pedido.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('Por diseño, Multibanco solo permite pagos de 1 a 999999 &euro; (inclusive). Puede usar esta opción para limitar aún más este rango.', 'eupago-gateway-for-woocommerce');
    165                     $reduzir_stock = __('Reducir el stock', 'eupago-gateway-for-woocommerce');
    166                     $escolher_reduzir_stock = __('Elegir cuándo reducir el stock.', 'eupago-gateway-for-woocommerce');
    167                     $quando_order_paga = __('cuando el pedido se paga (requiere callback activo)', 'eupago-gateway-for-woocommerce');
    168                     $quando_order_colocada = __('cuando el pedido se realiza (antes del pago)', 'eupago-gateway-for-woocommerce');
    169    
    170                 }
    171    
    172                 $this->form_fields = [
    173                   'enabled' => [
    174                     'title' => esc_html($enable_disable_title),
    175                     'type' => 'checkbox',
    176                     'default' => 'no',
    177                   ],
    178                   'instructions' => [
    179                     'title' => esc_html($instructions_text),
    180                     'type' => 'textarea',
    181                     'description' => esc_html($description_instructions_text),
    182                   ],
    183                   'only_portugal' => [
    184                     'title' => esc_html($apenas_portugueses),
    185                     'type' => 'checkbox',
    186                     'label' => esc_html($endereço_português),
    187                     'default' => 'no',
    188                   ],
    189                   'only_above' => [
    190                     'title' => esc_html($orders_acima),
    191                     'type' => 'number',
    192                     'description' => esc_html($orders_description),
    193                     'default' => '',
    194                   ],
    195                   'only_below' => [
    196                     'title' => esc_html($orders_abaixo),
    197                     'type' => 'number',
    198                     'description' => esc_html($orders_abaixo_description),
    199                     'default' => '',
    200                   ],
    201                   'stock_when' => [
    202                     'title' => esc_html ($reduzir_stock),
    203                     'type' => 'select',
    204                     'description' =>esc_html ($escolher_reduzir_stock),
    205                     'default' => '',
    206                     'options' => [
    207                       '' => esc_html($quando_order_paga),
    208                       'order' => esc_html($quando_order_colocada),
    209                     ],
    210                   ],
    211                 ];
     90        public function init_form_fields()
     91        {
     92            $this->form_fields = [
     93              'enabled' => [
     94                'title' => __('Enable/Disable', 'eupago-gateway-for-woocommerce'),
     95                'type' => 'checkbox',
     96                'label' => __('Enable MBWAY (using Eupago)', 'eupago-gateway-for-woocommerce'),
     97                'default' => 'no',
     98              ],
     99              'title' => [
     100                'title' => __('Title', 'eupago-gateway-for-woocommerce'),
     101                'type' => 'text',
     102                'description' => __('This controls the title which the user sees during checkout.', 'eupago-gateway-for-woocommerce'),
     103                'default' => __('MBWAY', 'eupago-gateway-for-woocommerce'),
     104              ],
     105              'description' => [
     106                'title' => __('Description', 'eupago-gateway-for-woocommerce'),
     107                'type' => 'textarea',
     108                'description' => __('This controls the description which the user sees during checkout.', 'eupago-gateway-for-woocommerce'),
     109                'default' => __('', 'eupago-gateway-for-woocommerce'),
     110              ],
     111              'instructions' => [
     112                'title' => __('Instructions', 'eupago-gateway-for-woocommerce'),
     113                'type' => 'textarea',
     114                'description' => __('Instructions that will be added to the thank you page and email sent to customer.', 'eupago-gateway-for-woocommerce'),
     115              ],
     116              'only_portugal' => [
     117                'title' => __('Only for Portuguese customers?', 'eupago-gateway-for-woocommerce'),
     118                'type' => 'checkbox',
     119                'label' => __('Enable only for customers whose address is in Portugal', 'eupago-gateway-for-woocommerce'),
     120                'default' => 'no',
     121              ],
     122              'only_above' => [
     123                'title' => __('Only for orders above', 'eupago-gateway-for-woocommerce'),
     124                'type' => 'number',
     125                'description' => __('Enable only for orders above x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce'),
     126                'default' => '',
     127              ],
     128              'only_below' => [
     129                'title' => __('Only for orders below', 'eupago-gateway-for-woocommerce'),
     130                'type' => 'number',
     131                'description' => __('Enable only for orders below x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce'),
     132                'default' => '',
     133              ],
     134              'stock_when' => [
     135                'title' => __('Reduce stock', 'eupago-gateway-for-woocommerce'),
     136                'type' => 'select',
     137                'description' => __('Choose when to reduce stock.', 'eupago-gateway-for-woocommerce'),
     138                'default' => '',
     139                'options' => [
     140                  '' => __('when order is paid (requires active callback)', 'eupago-gateway-for-woocommerce'),
     141                  'order' => __('when order is placed (before payment)', 'eupago-gateway-for-woocommerce'),
     142                ],
     143              ],
     144            ];
    212145        }
    213146
  • eupago-gateway-for-woocommerce/trunk/includes/class-wc-eupago-multibanco.php

    r3092023 r3099513  
    9191        public function init_form_fields()
    9292        {
    93             // Get the current language of the WooCommerce admin page
    94             $admin_language = get_locale();
    95             // Default language options
    96             $language_options = [
    97                 'default' => __('Default', 'eupago-gateway-for-woocommerce'),
    98                 'pt' => __('Portuguese', 'eupago-gateway-for-woocommerce'),
    99                 'en' => __('English', 'eupago-gateway-for-woocommerce'),
    100                 'es' => __('Spanish', 'eupago-gateway-for-woocommerce'),
    101             ];
    102 
    103             // Translate language options if the admin language is not English
    104             if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    105                 $language_options['default'] = __('Por padrão', 'eupago-gateway-for-woocommerce');
    106                 $language_options['pt'] = __('Português', 'eupago-gateway-for-woocommerce');
    107                 $language_options['en'] = __('Inglês', 'eupago-gateway-for-woocommerce');
    108                 $language_options['es'] = __('Espanhol', 'eupago-gateway-for-woocommerce');
    109             } elseif ($admin_language === 'es_ES') {
    110                 $language_options['default'] = __('Default', 'eupago-gateway-for-woocommerce');
    111                 $language_options['pt'] = __('Portuguese', 'eupago-gateway-for-woocommerce');
    112                 $language_options['en'] = __('English', 'eupago-gateway-for-woocommerce');
    113                 $language_options['es'] = __('Spanish', 'eupago-gateway-for-woocommerce');
    114             }
    115 
    116             // Translate title based on the selected language
    117             $language_title = esc_html(__('Language', 'eupago-gateway-for-woocommerce'));
    118             $language_description = esc_html(__('Select the language for the payment process.', 'eupago-gateway-for-woocommerce'));
    119 
    120             if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    121                 $language_title = esc_html(__('Idioma', 'eupago-gateway-for-woocommerce'));
    122                 $language_description = esc_html(__('Selecione o idioma para o processo de pagamento.', 'eupago-gateway-for-woocommerce'));
    123             } elseif ($admin_language === 'es_ES') {
    124                 $language_title = esc_html(__('Idioma', 'eupago-gateway-for-woocommerce'));
    125                 $language_description = esc_html(__('Seleccione el idioma para el proceso de pago.', 'eupago-gateway-for-woocommerce'));
    126             }
    127 
    128             $enable_disable_title = __('Enable/Disable', 'eupago-gateway-for-woocommerce');
    129             $instructions_text = __('Instructions', 'eupago-gateway-for-woocommerce');
    130             $description_instructions_text = __('Instructions that will be added to the thank you page and email sent to customer.','eupago-gateway-for-woocommerce');
    131             $duplicated_payments_text = __('Duplicate payments', 'eupago-gateway-for-woocommerce');
    132             $allow_duplicated_text = __('Allow duplicate payments.', 'eupago-gateway-for-woocommerce');
    133             $no_text = __('No', 'eupago-gateway-for-woocommerce');
    134             $yes_text = __('Yes', 'eupago-gateway-for-woocommerce');
    135             $data_expirada_text = __('Expire Date', 'eupago-gateway-for-woocommerce');
    136             $numero_dias_expirado = __('Number of days to payment expire.', 'eupago-gateway-for-woocommerce');
    137             $apenas_portugueses = __('Only for Portuguese customers?', 'eupago-gateway-for-woocommerce');
    138             $endereço_português = __('Enable only for customers whose address is in Portugal', 'eupago-gateway-for-woocommerce');
    139             $orders_acima = __('Only for orders above', 'eupago-gateway-for-woocommerce');
    140             $orders_description .= __('Enable only for orders above x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce');
    141             $orders_abaixo = __('Only for orders below', 'eupago-gateway-for-woocommerce');
    142             $orders_abaixo_description = __('Enable only for orders below x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce');
    143             $reduzir_stock = __('Reduce stock', 'eupago-gateway-for-woocommerce');
    144             $escolher_reduzir_stock = __('Choose when to reduce stock.', 'eupago-gateway-for-woocommerce');
    145             $quando_order_paga = __('when order is paid (requires active callback)', 'eupago-gateway-for-woocommerce');
    146             $quando_order_colocada =  __('when order is placed (before payment)', 'eupago-gateway-for-woocommerce');
    147 
    148             // Translate title based on the selected language
    149             if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    150                 $enable_disable_title = __('Ativar/Desativar', 'eupago-gateway-for-woocommerce');
    151                
    152             } elseif ($admin_language === 'es_ES') {
    153                 $enable_disable_title = __('Activar/Desactivar', 'eupago-gateway-for-woocommerce');
    154                 $instructions_text = __('Instrucciones', 'eupago-gateway-for-woocommerce');
    155                 $description_instructions_text = __('Instrucciones que se añadirán a la página de agradecimiento y al correo electrónico enviado al cliente.', 'eupago-gateway-for-woocommerce');
    156                 $duplicated_payments_text = __('Pagos duplicados', 'eupago-gateway-for-woocommerce');
    157                 $allow_duplicated_text = __('Permitir pagos duplicados.', 'eupago-gateway-for-woocommerce');
    158                 $no_text = __('No', 'eupago-gateway-for-woocommerce');
    159                 $yes_text = __('Sí', 'eupago-gateway-for-woocommerce');
    160                 $data_expirada_text = __('Fecha de vencimiento', 'eupago-gateway-for-woocommerce');
    161                 $numero_dias_expirado = __('Número de días para que caduque el pago.', 'eupago-gateway-for-woocommerce');
    162                 $apenas_portugueses = __('¿Solo para clientes portugueses?', 'eupago-gateway-for-woocommerce');
    163                 $endereço_português = __('Habilitar solo para clientes cuya dirección esté en Portugal', 'eupago-gateway-for-woocommerce');
    164                 $orders_acima = __('Solo para pedidos superiores a', 'eupago-gateway-for-woocommerce');
    165                 $orders_description = __('Activar solo para pedidos superiores a x &euro; (exclusivo). Deje en blanco (o cero) para permitir cualquier valor de pedido.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('Por diseño, Multibanco solo permite pagos de 1 a 999999 &euro; (inclusive). Puede usar esta opción para limitar aún más este rango.', 'eupago-gateway-for-woocommerce');
    166                 $orders_abaixo = __('Solo para pedidos inferiores a', 'eupago-gateway-for-woocommerce');
    167                 $orders_abaixo_description = __('Activar solo para pedidos inferiores a x &euro; (exclusivo). Deje en blanco (o cero) para permitir cualquier valor de pedido.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('Por diseño, Multibanco solo permite pagos de 1 a 999999 &euro; (inclusive). Puede usar esta opción para limitar aún más este rango.', 'eupago-gateway-for-woocommerce');
    168                 $reduzir_stock = __('Reducir el stock', 'eupago-gateway-for-woocommerce');
    169                 $escolher_reduzir_stock = __('Elegir cuándo reducir el stock.', 'eupago-gateway-for-woocommerce');
    170                 $quando_order_paga = __('cuando el pedido se paga (requiere callback activo)', 'eupago-gateway-for-woocommerce');
    171                 $quando_order_colocada = __('cuando el pedido se realiza (antes del pago)', 'eupago-gateway-for-woocommerce');
    172 
    173             }
    174 
    17593            $this->form_fields = [
    17694              'enabled' => [
    177                 'title' => esc_html($enable_disable_title),
     95                'title' => __('Enable/Disable', 'eupago-gateway-for-woocommerce'),
    17896                'type' => 'checkbox',
     97                'label' => __('Enable "Pagamento de Serviços no Multibanco" (using Eupago)', 'eupago-gateway-for-woocommerce'),
    17998                'default' => 'no',
    18099              ],
     100              'title' => [
     101                'title' => __('Title', 'eupago-gateway-for-woocommerce'),
     102                'type' => 'text',
     103                'description' => __('This controls the title which the user sees during checkout.', 'eupago-gateway-for-woocommerce'),
     104                'default' => __('Pagamento de Serviços no Multibanco', 'eupago-gateway-for-woocommerce'),
     105              ],
     106              'description' => [
     107                'title' => __('Description', 'eupago-gateway-for-woocommerce'),
     108                'type' => 'textarea',
     109                'description' => __('This controls the description which the user sees during checkout.', 'eupago-gateway-for-woocommerce'),
     110                'default' => __('Easy and simple payment using "Pagamento de Serviços" at any "Multibanco" ATM terminal or your Home Banking service. (Only available to customers of Portuguese banks. Payment service provided by eupago.)', 'eupago-gateway-for-woocommerce'),
     111              ],
    181112              'instructions' => [
    182                 'title' => esc_html($instructions_text),
     113                'title' => __('Instructions', 'eupago-gateway-for-woocommerce'),
    183114                'type' => 'textarea',
    184                 'description' => esc_html($description_instructions_text),
     115                'description' => __('Instructions that will be added to the thank you page and email sent to customer.', 'eupago-gateway-for-woocommerce'),
    185116              ],
    186117              'duplicate_payments' => [
    187                 'title' => esc_html($duplicated_payments_text),
     118                'title' => __('Duplicate payments', 'eupago-gateway-for-woocommerce'),
    188119                'type' => 'select',
    189                 'description' => esc_html($allow_duplicated_text),
     120                'description' => __('Allow duplicate payments.', 'eupago-gateway-for-woocommerce'),
    190121                'default' => 0,
    191122                'options' => [
    192                   '0' => esc_html($no_text),
    193                   '1' => esc_html($yes_text),
     123                  '0' => __('No', 'eupago-gateway-for-woocommerce'),
     124                  '1' => __('Yes', 'eupago-gateway-for-woocommerce'),
    194125                ],
    195126              ],
    196127              'deadline' => [
    197                 'title' => esc_html($data_expirada_text),
     128                'title' => __('Expire Date', 'eupago-gateway-for-woocommerce'),
    198129                'type' => 'number',
    199                 'description' => esc_html($numero_dias_expirado),
     130                'description' => __('Number of days to payment expire.', 'eupago-gateway-for-woocommerce'),
    200131                'default' => 0,
    201132              ],
    202133              'only_portugal' => [
    203                 'title' => esc_html($apenas_portugueses),
     134                'title' => __('Only for Portuguese customers?', 'eupago-gateway-for-woocommerce'),
    204135                'type' => 'checkbox',
    205                 'label' => esc_html($endereço_português),
     136                'label' => __('Enable only for customers whose address is in Portugal', 'eupago-gateway-for-woocommerce'),
    206137                'default' => 'no',
    207138              ],
    208139              'only_above' => [
    209                 'title' => esc_html($orders_acima),
     140                'title' => __('Only for orders above', 'eupago-gateway-for-woocommerce'),
    210141                'type' => 'number',
    211                 'description' => esc_html($orders_description),
     142                'description' => __('Enable only for orders above x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce'),
    212143                'default' => '',
    213144              ],
    214145              'only_below' => [
    215                 'title' => esc_html($orders_abaixo),
     146                'title' => __('Only for orders below', 'eupago-gateway-for-woocommerce'),
    216147                'type' => 'number',
    217                 'description' => esc_html($orders_abaixo_description),
     148                'description' => __('Enable only for orders below x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce'),
    218149                'default' => '',
    219150              ],
    220151              'stock_when' => [
    221                 'title' => esc_html ($reduzir_stock),
     152                'title' => __('Reduce stock', 'eupago-gateway-for-woocommerce'),
    222153                'type' => 'select',
    223                 'description' =>esc_html ($escolher_reduzir_stock),
     154                'description' => __('Choose when to reduce stock.', 'eupago-gateway-for-woocommerce'),
    224155                'default' => '',
    225156                'options' => [
    226                   '' => esc_html($quando_order_paga),
    227                   'order' => esc_html($quando_order_colocada),
     157                  '' => __('when order is paid (requires active callback)', 'eupago-gateway-for-woocommerce'),
     158                  'order' => __('when order is placed (before payment)', 'eupago-gateway-for-woocommerce'),
    228159                ],
    229160              ],
  • eupago-gateway-for-woocommerce/trunk/includes/class-wc-eupago-payshop.php

    r3092023 r3099513  
    7878    */
    7979    function init_form_fields() {
    80     // Get the current language of the WooCommerce admin page
    81     $admin_language = get_locale();
    82     // Default language options
    83     $language_options = [
    84         'default' => __('Default', 'eupago-gateway-for-woocommerce'),
    85         'pt' => __('Portuguese', 'eupago-gateway-for-woocommerce'),
    86         'en' => __('English', 'eupago-gateway-for-woocommerce'),
    87         'es' => __('Spanish', 'eupago-gateway-for-woocommerce'),
    88     ];
    89 
    90     // Translate language options if the admin language is not English
    91     if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    92         $language_options['default'] = __('Por padrão', 'eupago-gateway-for-woocommerce');
    93         $language_options['pt'] = __('Português', 'eupago-gateway-for-woocommerce');
    94         $language_options['en'] = __('Inglês', 'eupago-gateway-for-woocommerce');
    95         $language_options['es'] = __('Espanhol', 'eupago-gateway-for-woocommerce');
    96     } elseif ($admin_language === 'es_ES') {
    97         $language_options['default'] = __('Default', 'eupago-gateway-for-woocommerce');
    98         $language_options['pt'] = __('Portuguese', 'eupago-gateway-for-woocommerce');
    99         $language_options['en'] = __('English', 'eupago-gateway-for-woocommerce');
    100         $language_options['es'] = __('Spanish', 'eupago-gateway-for-woocommerce');
    101     }
    102 
    103     // Translate title based on the selected language
    104     $language_title = esc_html(__('Language', 'eupago-gateway-for-woocommerce'));
    105     $language_description = esc_html(__('Select the language for the payment process.', 'eupago-gateway-for-woocommerce'));
    106 
    107     if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    108         $language_title = esc_html(__('Idioma', 'eupago-gateway-for-woocommerce'));
    109         $language_description = esc_html(__('Selecione o idioma para o processo de pagamento.', 'eupago-gateway-for-woocommerce'));
    110     } elseif ($admin_language === 'es_ES') {
    111         $language_title = esc_html(__('Idioma', 'eupago-gateway-for-woocommerce'));
    112         $language_description = esc_html(__('Seleccione el idioma para el proceso de pago.', 'eupago-gateway-for-woocommerce'));
    113     }
    114 
    115     $enable_disable_title = __('Enable/Disable', 'eupago-gateway-for-woocommerce');
    116     $instructions_text = __('Instructions', 'eupago-gateway-for-woocommerce');
    117     $description_instructions_text = __('Instructions that will be added to the thank you page and email sent to customer.','eupago-gateway-for-woocommerce');
    118     $duplicated_payments_text = __('Duplicate payments', 'eupago-gateway-for-woocommerce');
    119     $allow_duplicated_text = __('Allow duplicate payments.', 'eupago-gateway-for-woocommerce');
    120     $no_text = __('No', 'eupago-gateway-for-woocommerce');
    121     $yes_text = __('Yes', 'eupago-gateway-for-woocommerce');
    122     $data_expirada_text = __('Expire Date', 'eupago-gateway-for-woocommerce');
    123     $numero_dias_expirado = __('Number of days to payment expire.', 'eupago-gateway-for-woocommerce');
    124     $apenas_portugueses = __('Only for Portuguese customers?', 'eupago-gateway-for-woocommerce');
    125     $endereço_português = __('Enable only for customers whose address is in Portugal', 'eupago-gateway-for-woocommerce');
    126     $orders_acima = __('Only for orders above', 'eupago-gateway-for-woocommerce');
    127     $orders_description .= __('Enable only for orders above x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce');
    128     $orders_abaixo = __('Only for orders below', 'eupago-gateway-for-woocommerce');
    129     $orders_abaixo_description = __('Enable only for orders below x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce');
    130     $reduzir_stock = __('Reduce stock', 'eupago-gateway-for-woocommerce');
    131     $escolher_reduzir_stock = __('Choose when to reduce stock.', 'eupago-gateway-for-woocommerce');
    132     $quando_order_paga = __('when order is paid (requires active callback)', 'eupago-gateway-for-woocommerce');
    133     $quando_order_colocada =  __('when order is placed (before payment)', 'eupago-gateway-for-woocommerce');
    134 
    135     // Translate title based on the selected language
    136     if ($admin_language === 'pt_PT' || $admin_language === 'pt_BR') {
    137         $enable_disable_title = __('Ativar/Desativar', 'eupago-gateway-for-woocommerce');
    138        
    139     } elseif ($admin_language === 'es_ES') {
    140         $enable_disable_title = __('Activar/Desactivar', 'eupago-gateway-for-woocommerce');
    141         $instructions_text = __('Instrucciones', 'eupago-gateway-for-woocommerce');
    142         $description_instructions_text = __('Instrucciones que se añadirán a la página de agradecimiento y al correo electrónico enviado al cliente.', 'eupago-gateway-for-woocommerce');
    143         $duplicated_payments_text = __('Pagos duplicados', 'eupago-gateway-for-woocommerce');
    144         $allow_duplicated_text = __('Permitir pagos duplicados.', 'eupago-gateway-for-woocommerce');
    145         $no_text = __('No', 'eupago-gateway-for-woocommerce');
    146         $yes_text = __('Sí', 'eupago-gateway-for-woocommerce');
    147         $data_expirada_text = __('Fecha de vencimiento', 'eupago-gateway-for-woocommerce');
    148         $numero_dias_expirado = __('Número de días para que caduque el pago.', 'eupago-gateway-for-woocommerce');
    149         $apenas_portugueses = __('¿Solo para clientes portugueses?', 'eupago-gateway-for-woocommerce');
    150         $endereço_português = __('Habilitar solo para clientes cuya dirección esté en Portugal', 'eupago-gateway-for-woocommerce');
    151         $orders_acima = __('Solo para pedidos superiores a', 'eupago-gateway-for-woocommerce');
    152         $orders_description = __('Activar solo para pedidos superiores a x &euro; (exclusivo). Deje en blanco (o cero) para permitir cualquier valor de pedido.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('Por diseño, Multibanco solo permite pagos de 1 a 999999 &euro; (inclusive). Puede usar esta opción para limitar aún más este rango.', 'eupago-gateway-for-woocommerce');
    153         $orders_abaixo = __('Solo para pedidos inferiores a', 'eupago-gateway-for-woocommerce');
    154         $orders_abaixo_description = __('Activar solo para pedidos inferiores a x &euro; (exclusivo). Deje en blanco (o cero) para permitir cualquier valor de pedido.', 'eupago-gateway-for-woocommerce') . ' <br/> ' . __('Por diseño, Multibanco solo permite pagos de 1 a 999999 &euro; (inclusive). Puede usar esta opción para limitar aún más este rango.', 'eupago-gateway-for-woocommerce');
    155         $reduzir_stock = __('Reducir el stock', 'eupago-gateway-for-woocommerce');
    156         $escolher_reduzir_stock = __('Elegir cuándo reducir el stock.', 'eupago-gateway-for-woocommerce');
    157         $quando_order_paga = __('cuando el pedido se paga (requiere callback activo)', 'eupago-gateway-for-woocommerce');
    158         $quando_order_colocada = __('cuando el pedido se realiza (antes del pago)', 'eupago-gateway-for-woocommerce');
    159 
    160     }
    161 
    162     $this->form_fields = [
    163       'enabled' => [
    164         'title' => esc_html($enable_disable_title),
    165         'type' => 'checkbox',
    166         'default' => 'no',
    167       ],
    168       'instructions' => [
    169         'title' => esc_html($instructions_text),
    170         'type' => 'textarea',
    171         'description' => esc_html($description_instructions_text),
    172       ],
    173       'only_portugal' => [
    174         'title' => esc_html($apenas_portugueses),
    175         'type' => 'checkbox',
    176         'label' => esc_html($endereço_português),
    177         'default' => 'no',
    178       ],
    179       'only_above' => [
    180         'title' => esc_html($orders_acima),
    181         'type' => 'number',
    182         'description' => esc_html($orders_description),
    183         'default' => '',
    184       ],
    185       'only_below' => [
    186         'title' => esc_html($orders_abaixo),
    187         'type' => 'number',
    188         'description' => esc_html($orders_abaixo_description),
    189         'default' => '',
    190       ],
    191       'stock_when' => [
    192         'title' => esc_html ($reduzir_stock),
    193         'type' => 'select',
    194         'description' =>esc_html ($escolher_reduzir_stock),
    195         'default' => '',
    196         'options' => [
    197           '' => esc_html($quando_order_paga),
    198           'order' => esc_html($quando_order_colocada),
    199         ],
    200       ],
    201     ];
    202 }
     80      $this->form_fields = array(
     81        'enabled' => array(
     82          'title' => __('Enable/Disable', 'eupago-gateway-for-woocommerce'),
     83          'type' => 'checkbox',
     84          'label' => __( 'Enable PayShop (using Eupago)', 'eupago-gateway-for-woocommerce'),
     85          'default' => 'no'
     86        ),
     87        'title' => array(
     88          'title' => __('Title', 'eupago-gateway-for-woocommerce' ),
     89          'type' => 'text',
     90          'description' => __('This controls the title which the user sees during checkout.', 'eupago-gateway-for-woocommerce'),
     91          'default' => __('PayShop', 'eupago-gateway-for-woocommerce')
     92        ),
     93        'description' => array(
     94          'title' => __('Description', 'eupago-gateway-for-woocommerce' ),
     95          'type' => 'textarea',
     96          'description' => __('This controls the description which the user sees during checkout.', 'eupago-gateway-for-woocommerce' ),
     97          'default' => __('Pay at PayShop agent', 'eupago-gateway-for-woocommerce')
     98        ),
     99        'instructions' => array(
     100          'title'       => __( 'Instructions', 'eupago-gateway-for-woocommerce' ),
     101          'type'        => 'textarea',
     102          'description' => __( 'Instructions that will be added to the thank you page and email sent to customer.', 'eupago-gateway-for-woocommerce' ),
     103        ),
     104        'only_portugal' => array(
     105          'title' => __('Only for Portuguese customers?', 'eupago-gateway-for-woocommerce'),
     106          'type' => 'checkbox',
     107          'label' => __( 'Enable only for customers whose address is in Portugal', 'eupago-gateway-for-woocommerce'),
     108          'default' => 'no'
     109        ),
     110        'only_above' => array(
     111          'title' => __('Only for orders above', 'eupago-gateway-for-woocommerce'),
     112          'type' => 'number',
     113          'description' => __( 'Enable only for orders above x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce').' <br/> '.__( 'By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce'),
     114          'default' => ''
     115        ),
     116        'only_below' => array(
     117          'title' => __('Only for orders below', 'eupago-gateway-for-woocommerce'),
     118          'type' => 'number',
     119          'description' => __( 'Enable only for orders below x &euro; (exclusive). Leave blank (or zero) to allow for any order value.', 'eupago-gateway-for-woocommerce').' <br/> '.__( 'By design, Mulitibanco only allows payments from 1 to 999999 &euro; (inclusive). You can use this option to further limit this range.', 'eupago-gateway-for-woocommerce'),
     120          'default' => ''
     121        ),
     122        'stock_when' => array(
     123          'title' => __('Reduce stock', 'eupago-gateway-for-woocommerce'),
     124          'type' => 'select',
     125          'description' => __( 'Choose when to reduce stock.', 'eupago-gateway-for-woocommerce'),
     126          'default' => '',
     127          'options' => array(
     128            ''      => __('when order is paid (requires active callback)', 'eupago-gateway-for-woocommerce'),
     129            'order' => __('when order is placed (before payment)', 'eupago-gateway-for-woocommerce'),
     130          ),
     131        ),
     132      );
     133    }
    203134
    204135    public function admin_options() {
  • eupago-gateway-for-woocommerce/trunk/includes/hooks/hooks-refund.php

    r3092023 r3099513  
    1616    $trid = $order->get_meta('_transaction_id', true);
    1717
    18     $payment_method = $order->get_payment_method();
    19 
    20     if (!empty(sanitize_text_field($_POST['refund_amount']))) {
     18    if (!empty(sanitize_text_field($_POST['refund_name'])) && !empty(sanitize_text_field($_POST['refund_iban'])) && !empty(sanitize_text_field($_POST['refund_bic'])) && !empty(sanitize_text_field($_POST['refund_amount'])) && !empty(sanitize_text_field($_POST['refund_reason']))) {
    2119        // Token
    2220        $url = 'https://' . $endpoint . '.eupago.pt/api/auth/token';
     
    3836        $responseData = json_decode($response, true);
    3937        // Check if the request was successful
    40 
    4138        if ($responseData['transactionStatus'] === 'Rejected') {
    4239            // Handle the error
     
    5148                    'Authorization: Bearer ' . $accessToken,
    5249                ];
    53 
    5450                $dataRefund = [
     51                    'name' => sanitize_text_field($_POST['refund_name']),
     52                    'iban' => sanitize_text_field($_POST['refund_iban']),
     53                    'bic' => sanitize_text_field($_POST['refund_bic']),
    5554                    'amount' => floatval(sanitize_text_field($_POST['refund_amount'])),
     55                    'reason' => sanitize_text_field($_POST['refund_reason']),
    5656                ];
    57 
    58                 if (!empty($_POST['refund_reason'])) {
    59                     $dataRefund['reason'] = sanitize_text_field($_POST['refund_reason']);
    60                 }
    61 
    62                 if ($payment_method !== "eupago_mbway" && $payment_method !== 'eupago_cc') {
    63                     $dataRefund['iban'] = sanitize_text_field($_POST['refund_iban']);
    64                     $dataRefund['bic'] = sanitize_text_field($_POST['refund_bic']);
    65                 }
    66 
    67                 if (!empty($_POST['refund_bic']) || !empty($_POST['refund_iban'])) {
    68                     $dataRefund['bic'] = sanitize_text_field($_POST['refund_bic']);
    69                     $dataRefund['iban'] = sanitize_text_field($_POST['refund_iban']);
    70                 }
    71 
    72                 if (!empty($_POST['refund_name'])) {
    73                     $dataRefund['name'] = sanitize_text_field($_POST['refund_name']);
    74                 }
    75 
    7657                $url_refund = 'https://' . $endpoint . '.eupago.pt/api/management/v1.02/refund/' . $trid;
    77 
    7858                // Convert the new payload to JSON
    7959                $dataRefundJson = json_encode($dataRefund);
     
    166146   </form>
    167147
    168     <div class="eupago-refund-response"></div>
     148   <div class="eupago-refund-response"></div>
    169149<?php
    170150}
     
    175155    $order       = wc_get_order($order_id);
    176156    $order_total = $order->get_total();
    177 ?>
     157    ?>
    178158
    179159    <div class="eupago-site-url">
  • eupago-gateway-for-woocommerce/trunk/includes/views/eupago-admin-page.php

    r3092023 r3099513  
    244244              <!-- Add the nonce field -->
    245245              <?php wp_nonce_field('eupago_settings_nonce', '_wpnonce'); ?>
    246              
    247246
    248247            <table class="form-table" role="presentation">
    249             <?php
    250                 $texto_traduzido = esc_html__('Each account has at least a channel. Each channel has an API Key that identifies your Eupago\'s account.', 'eupago-gateway-for-woocommerce');
    251                 $texto_callback = esc_html__('Please activate callback to this url on Eupago dashboard: <code>%s</code>', 'eupago-gateway-for-woocommerce');
    252                 $texto_enable = esc_html__('Enable', 'eupago-gateway-for-woocommerce');
    253                 $texto_enable_login = esc_html__('Enable loggin', 'eupago-gateway-for-woocommerce');
    254                 $texto_antepenultimo = esc_html__('Please make sure that the field with Client ID and Client Secret is properly filled above to update the callback successfully.','eupago-gateway-for-woocommerce');
    255                 $texto_ultimo = esc_html__('The generated URL is the default callback for a Woocommece store. If your store has a different file path please use the Eupago Backoffice.', 'eupago-gateway-for-woocommerce');
    256                 $callback = esc_html__('Update Callback','eupago-gateway-for-woocommerce');
    257                 $order = esc_html__('In order to use Eupago plugin for WooCommerce you must have an Eupago account.', 'eupago-gateway-for-woocommerce');
    258                 //Primeira linha do ficheiro para traduzir
    259                 $channel_name = esc_html__('Channel Name:', 'eupago-gateway-for-woocommerce');
    260                 $channel = esc_html__('What is a channel?', 'eupago-gateway-for-woocommerce');
    261                 $order_api = esc_html__('In order to find your API Key and channel name please follow this guide on our', 'eupago-gateway-for-woocommerce');
    262                 $help_center = esc_html__('Help Center','eupago-gateway-for-woocommerce');
    263                 $api_key_text = esc_html__('Api Key: ', 'eupago-gateway-for-woocommerce');
    264                 $end_point_text = esc_html__('Enpoint: ','eupago-gateway-for-woocommerce');
    265                 $live_text = esc_html__('Live','eupago-gateway-for-woocommerce');
    266                 $sandbox_text = esc_html__('Sandbox', 'eupago-gateway-for-woocommerce');
    267                 $reminder_faiolver = esc_html__('Reminder(FailOver):', 'eupago-gateway-for-woocommerce');
    268                 $see_reminder = esc_html__('Do you want to send a reminder to your customer to inform him he has a pending order? Activate this option. Read more about this reminder', 'eupago-gateway-for-woocommerce');
    269                 $here = esc_html__('here','eupago-gateway-for-woocommerce');
    270                 $debug_log = esc_html__('Debug Log: ' ,'eupago-gateway-for-woocommerce');
    271                 $log_plugins = esc_html('Log plugin events, such as callback requests, inside', 'eupago-gateway-for-woocommerce');
    272                 $refund_text = esc_html('Refund:','eupago-gateway-for-woocommerce');
    273                 $user_text = esc_html__('User: ','eupago-gateway-for-woocommerce');
    274                 $password_text = esc_html__('Password','eupagp-gateway-for-woocommerce');
    275                 $notificacoes_sms = esc_html__('Nofitications Biziq: ','eupago-gateway-for-woocommerce');
    276                 $payment_on_hold = esc_html__('SMS Payment On Hold:', 'eupago-gateway-for-woocommerce');
    277                 $sms_order_confirmation = esc_html('SMS Order Confirmation:', 'eupago-gateway-for-woocommerce');
    278                 $payment_confirmation = esc_html__('SMS Payment Confirmation:', 'eupago-gateway-for-woocommerce');
    279                 $callback_url_text = esc_html__('Callback url: ','eupago-gateway-for-woocommerce');
    280                 $doyounedd_account = esc_html__('Do you need an account? You may sign up at', 'eupago-gateway-for-woocommerce');
    281                 $demo_account = esc_html__('Do you already have a demo account and need to finish your real account? Please reach out by email:', 'eupago-gateway-for-woocommerce');
    282                 $save_changes_text = esc_html__('Save Changes', 'eupago-gateway-for-woocommerce');
    283                 if (get_locale() == 'pt_BR' || get_locale() == 'pt_PT') {
    284                     $texto_traduzido = 'Cada conta tem pelo menos um canal. Cada canal possui uma Chave de API que identifica a sua conta do Eupago.';
    285                     $texto_callback = 'Por favor, ative o callback para este URL no painel da Eupago:';
    286                     $texto_enable = 'Ativar';
    287                     $texto_enable_login = 'Ativar login';
    288                     $texto_antepenultimo = 'Por favor, certifique-se de que o campo com o ID do Cliente e o Segredo do Cliente esteja corretamente preenchido acima para atualizar o callback com sucesso.';
    289                     $texto_ultimo = 'O URL gerado é o callback padrão para uma loja Woocommerce. Se a sua loja tiver um caminho de arquivo diferente, por favor, utilize o Backoffice da Eupago.';
    290                     $callback = 'Atualizar callback';
    291                     $order = 'Para usar o plugin da Eupago para WooCommerce, você deve ter uma conta na Eupago.';
    292                     //Primeira linha do ficheiro para traduzir
    293                     $channel_name = esc_html__('Nome do Canal:', 'eupago-gateway-for-woocommerce');
    294                     $channel = esc_html__('O que é um canal?', 'eupago-gateway-for-woocommerce');
    295                     $order_api = esc_html__('Para encontrar sua Chave de API e nome do canal, siga este guia em nosso', 'eupago-gateway-for-woocommerce');
    296                     $help_center = esc_html__('Centro de Ajuda','eupago-gateway-for-woocommerce');
    297                     $api_key_text = esc_html__('Chave de API: ', 'eupago-gateway-for-woocommerce');
    298                     $end_point_text = esc_html__('Ponto de extremidade: ','eupago-gateway-for-woocommerce');
    299                     $live_text = esc_html__('Produção','eupago-gateway-for-woocommerce');
    300                     $sandbox_text = esc_html__('Sandbox', 'eupago-gateway-for-woocommerce');
    301                     $reminder_faiolver = esc_html__('Lembrete (FailOver):', 'eupago-gateway-for-woocommerce');
    302                     $see_reminder = esc_html__('Quer enviar um lembrete para seu cliente informando que ele tem um pedido pendente? Ative esta opção. Leia mais sobre este lembrete', 'eupago-gateway-for-woocommerce');
    303                     $here = esc_html__('aqui','eupago-gateway-for-woocommerce');
    304                     $debug_log = esc_html__('Log de Depuração: ' ,'eupago-gateway-for-woocommerce');
    305                     $log_plugins = esc_html__('Registre eventos do plugin, como solicitações de retorno, dentro', 'eupago-gateway-for-woocommerce');
    306                     $refund_text = esc_html__('Reembolso:','eupago-gateway-for-woocommerce');
    307                     $user_text = esc_html__('Usuário: ','eupago-gateway-for-woocommerce');
    308                     $password_text = esc_html__('Senha','eupagp-gateway-for-woocommerce');
    309                     $notificacoes_sms = esc_html__('Notificações Biziq: ','eupago-gateway-for-woocommerce');
    310                     $payment_on_hold = esc_html__('Pagamento SMS em Espera:', 'eupago-gateway-for-woocommerce');
    311                     $sms_order_confirmation = esc_html__('Confirmação de Pedido por SMS:', 'eupago-gateway-for-woocommerce');
    312                     $payment_confirmation = esc_html__('Confirmação de Pagamento por SMS:', 'eupago-gateway-for-woocommerce');
    313                     $callback_url_text = esc_html__('URL de Retorno: ','eupago-gateway-for-woocommerce');
    314                     $doyounedd_account = esc_html__('Precisa de uma conta? Você pode se inscrever em', 'eupago-gateway-for-woocommerce');
    315                     $demo_account = esc_html__('Já tem uma conta de demonstração e precisa concluir sua conta real? Entre em contato por e-mail:', 'eupago-gateway-for-woocommerce');
    316                     $save_changes_text = esc_html__('Guardar Alterações', 'eupago-gateway-for-woocommerce');
    317                }else if(get_locale()== 'es_ES'){
    318                     $texto_traduzido = 'Cada cuenta tiene al menos un canal. Cada canal tiene una Clave de API que identifica su cuenta de Eupago.';
    319                     $texto_callback = 'Por favor, active la devolución de llamada para esta URL en el panel de Eupago:';
    320                     $texto_enable = 'Habilitar';
    321                     $texto_enable_login = 'Habilitar inicio de sesión';
    322                     $texto_antepenultimo = 'Por favor, asegúrese de que el campo con el ID de Cliente y el Secreto de Cliente estén completados correctamente arriba para actualizar la devolución de llamada correctamente.';
    323                     $texto_ultimo = 'La URL generada es la devolución de llamada predeterminada para una tienda Woocommerce. Si su tienda tiene una ruta de archivo diferente, por favor, utilice el Backoffice de Eupago.';
    324                     $callback = 'Actualizar devolución de llamada';
    325                     $order = 'Para utilizar el plugin de Eupago para WooCommerce, debe tener una cuenta en Eupago.';
    326                     //Primeira linha do ficheiro para traduzir
    327                     $channel_name = esc_html__('Nombre del canal:', 'eupago-gateway-for-woocommerce');
    328                     $channel = esc_html__('¿Qué es un canal?', 'eupago-gateway-for-woocommerce');
    329                     $order_api = esc_html__('Para encontrar su Clave de API y nombre de canal, siga esta guía en nuestro', 'eupago-gateway-for-woocommerce');
    330                     $help_center = esc_html__('Centro de ayuda','eupago-gateway-for-woocommerce');
    331                     $api_key_text = esc_html__('Clave de API: ', 'eupago-gateway-for-woocommerce');
    332                     $end_point_text = esc_html__('Punto final: ','eupago-gateway-for-woocommerce');
    333                     $live_text = esc_html__('En vivo','eupago-gateway-for-woocommerce');
    334                     $sandbox_text = esc_html__('Sandbox', 'eupago-gateway-for-woocommerce');
    335                     $reminder_faiolver = esc_html__('Recordatorio (FailOver):', 'eupago-gateway-for-woocommerce');
    336                     $see_reminder = esc_html__('¿Desea enviar un recordatorio a su cliente para informarle que tiene un pedido pendiente? Active esta opción. Lea más sobre este recordatorio', 'eupago-gateway-for-woocommerce');
    337                     $here = esc_html__('aquí','eupago-gateway-for-woocommerce');
    338                     $debug_log = esc_html__('Registro de depuración: ' ,'eupago-gateway-for-woocommerce');
    339                     $log_plugins = esc_html__('Registrar eventos del plugin, como solicitudes de devolución de llamada, dentro', 'eupago-gateway-for-woocommerce');
    340                     $refund_text = esc_html__('Reembolso:','eupago-gateway-for-woocommerce');
    341                     $user_text = esc_html__('Usuario: ','eupago-gateway-for-woocommerce');
    342                     $password_text = esc_html__('Contraseña','eupagp-gateway-for-woocommerce');
    343                     $notificacoes_sms = esc_html__('Notificaciones Biziq: ','eupago-gateway-for-woocommerce');
    344                     $payment_on_hold = esc_html__('Pago SMS en espera:', 'eupago-gateway-for-woocommerce');
    345                     $sms_order_confirmation = esc_html__('Confirmación de pedido SMS:', 'eupago-gateway-for-woocommerce');
    346                     $payment_confirmation = esc_html__('Confirmación de pago SMS:', 'eupago-gateway-for-woocommerce');
    347                     $callback_url_text = esc_html__('URL de devolución de llamada: ','eupago-gateway-for-woocommerce');
    348                     $doyounedd_account = esc_html__('¿Necesita una cuenta? Puede registrarse en', 'eupago-gateway-for-woocommerce');
    349                     $demo_account = esc_html__('¿Ya tiene una cuenta de demostración y necesita terminar su cuenta real? Por favor, contáctenos por correo electrónico:', 'eupago-gateway-for-woocommerce');
    350                     $save_changes_text = esc_html__('Guardar Cambios','eupago-gateway-for-woocomerce');
    351                }
    352             ?><tbody>
    353                     <tr>
    354                         <th scope="row"><label for="channel"><?php esc_html_e($channel_name); ?></label></th>
     248                <tbody>
     249                    <tr>
     250                        <th scope="row"><label for="channel"><?php esc_html_e('Channel Name:', 'eupago-gateway-for-woocommerce'); ?></label></th>
    355251                        <td>
    356252                            <input class="regular-text" type="text" name="channel" value="<?php echo esc_attr(get_option('eupago_channel')); ?>">
    357                             <h4><?php esc_html_e($chanell); ?></h4>
    358                             <p><?php esc_html_e($texto_traduzido); ?></p>
     253                            <h4><?php esc_html_e('What is a channel?', 'eupago-gateway-for-woocommerce'); ?></h4>
     254                            <p><?php esc_html_e('Each account has at least a channel. Each channel has an API Key that identifies your Eupago\'s account.', 'eupago-gateway-for-woocommerce'); ?></p>
    359255                            <p>
    360                                 <?php esc_html_e($order_api); ?>
    361                                 <a href="https://eupago.atlassian.net/servicedesk/customer/portal/2/article/224297034?src=1875300770" target="_BLANK"><?php esc_html_e($help_center); ?></a>.
     256                                <?php esc_html_e('In order to find your API Key and channel name please follow this guide on our', 'eupago-gateway-for-woocommerce'); ?>
     257                                <a href="https://eupago.atlassian.net/servicedesk/customer/portal/2/article/224297034?src=1875300770" target="_BLANK"><?php esc_html_e('Help Center', 'eupago-gateway-for-woocommerce'); ?></a>.
    362258                            </p>
    363259                        </td>
    364260                    </tr>
    365261                    <tr>
    366                         <th scope="row"><label for="api_key"><?php esc_html_e($api_key_text); ?></label></th>
     262                        <th scope="row"><label for="api_key"><?php esc_html_e('API Key:', 'eupago-gateway-for-woocommerce'); ?></label></th>
    367263                        <td>
    368264                            <input class="regular-text" type="text" name="api_key" value="<?php echo esc_attr(get_option('eupago_api_key')); ?>">
    369265                            <p>
    370                                <?php esc_html_e($texto_callback); ?> <?php echo get_option('permalink_structure') == '' ? home_url('/') . '?wc-api=WC_euPago' : home_url('/') . 'wc-api/WC_euPago/'; ?>
     266                                <?php
     267                                echo sprintf(__('Please activate callback to this url on Eupago dashboard: <code>%s</code>', 'eupago-gateway-for-woocommerce'), get_option('permalink_structure') == '' ? home_url('/') . '?wc-api=WC_euPago' : home_url('/') . 'wc-api/WC_euPago/');
     268    ?>
    371269                            </p>
    372270                        </td>
    373271                    </tr>
    374272                    <tr>
    375                         <th scope="row"><label for="endpoint"><?php esc_html_e($endpoint_text); ?></label></th>
     273                        <th scope="row"><label for="endpoint"><?php esc_html_e('Endpoint:', 'eupago-gateway-for-woocommerce'); ?></label></th>
    376274                        <td>
    377275                            <select name="endpoint">
    378276                                <?php if (get_option('eupago_endpoint') == 'clientes') { ?>
    379                                     <option value="clientes" selected><?php esc_html_e($live_text); ?></option>
     277                                    <option value="clientes" selected><?php esc_html_e('Live', 'eupago-gateway-for-woocommerce'); ?></option>
    380278                                <?php } else { ?>
    381                                     <option value="clientes"><?php esc_html_e($live_text); ?></option>
     279                                    <option value="clientes"><?php esc_html_e('Live', 'eupago-gateway-for-woocommerce'); ?></option>
    382280                                <?php } ?>
    383281                                <?php if (get_option('eupago_endpoint') == 'sandbox') { ?>
    384                                     <option value="sandbox" selected><?php esc_html_e($sandbox_text); ?></option>
     282                                    <option value="sandbox" selected><?php esc_html_e('Sandbox', 'eupago-gateway-for-woocommerce'); ?></option>
    385283                                <?php } else { ?>
    386                                     <option value="sandbox"><?php esc_html_e($sandbox_text); ?></option>
     284                                    <option value="sandbox"><?php esc_html_e('Sandbox', 'eupago-gateway-for-woocommerce'); ?></option>
    387285                                <?php } ?>
    388286                            </select>
     
    390288                    </tr>
    391289                    <tr>
    392                         <th scope="row"><label for="reminder"><?php esc_html_e($reminder_faiolver); ?></label></th>
     290                        <th scope="row"><label for="reminder"><?php esc_html_e('Reminder(Failover):', 'eupago-gateway-for-woocommerce'); ?></label></th>
    393291                        <td>
    394                             <input type="checkbox" name="reminder" value="1" <?php echo $reminder_checked; ?>><?php esc_html_e($texto_enable); ?>
     292                            <input type="checkbox" name="reminder" value="1" <?php echo $reminder_checked; ?>><?php esc_html_e('Enable', 'eupago-gateway-for-woocommerce'); ?>
    395293                            <p>
    396                                 <?php esc_html_e($see_reminder); ?>
    397                                 <a href="https://eupago.atlassian.net/servicedesk/customer/portal/2/article/652967937" target="_BLANK"><?php esc_html_e($here); ?></a>
     294                                <?php esc_html_e('Do you want to send a reminder to your customer to inform him he has a pending order? Activate this option. Read more about this reminder', 'eupago-gateway-for-woocommerce'); ?>
     295                                <a href="https://eupago.atlassian.net/servicedesk/customer/portal/2/article/652967937" target="_BLANK"><?php esc_html_e('here', 'eupago-gateway-for-woocommerce'); ?></a>
    398296                            </p>
    399297                        </td>
    400298                    </tr>
    401299                    <tr>
    402                         <th scope="row"><label for="debug"><?php esc_html_e($debug_log); ?></label></th>
     300                        <th scope="row"><label for="debug"><?php esc_html_e('Debug Log:', 'eupago-gateway-for-woocommerce'); ?></label></th>
    403301                        <td>
    404                             <input type="checkbox" name="debug" value="yes" <?php echo $debug_checked; ?>><?php esc_html_e($texto_enable_login); ?>
     302                            <input type="checkbox" name="debug" value="yes" <?php echo $debug_checked; ?>><?php esc_html_e('Enable logging', 'eupago-gateway-for-woocommerce'); ?>
    405303                            <p>
    406                                 <?php esc_html_e($log_plugins); ?>
     304                                <?php esc_html_e('Log plugin events, such as callback requests, inside', 'eupago-gateway-for-woocommerce'); ?>
    407305                                <?php $uploads = wp_upload_dir(); ?>
    408306                                <code><?php echo wp_basename($uploads['baseurl']) . '/wc-logs/'; ?></code>
     
    413311            </table>
    414312
    415             <h3><?php esc_html_e($refund_text); ?></h3>
     313            <h3><?php esc_html_e('Refund', 'eupago-gateway-for-woocommerce'); ?></h3>
    416314            <table class="form-table" role="presentation">
    417315                <tbody>
     
    425323                    </tr>
    426324                    <tr>
    427                         <th scope="row"><label for="user_eupago"><?php esc_html_e($user_text); ?></label></th>
     325                        <th scope="row"><label for="user_eupago"><?php esc_html_e('User:', 'eupago-gateway-for-woocommerce'); ?></label></th>
    428326                        <td><input class="regular-text" type="text" name="user_eupago" value="<?php echo esc_attr(get_option('eupago_user')); ?>"></td>
    429327                    </tr>
    430328                    <tr>
    431                         <th scope="row"><label for="password_eupago"><?php esc_html_e($password_text); ?></label></th>
     329                        <th scope="row"><label for="password_eupago"><?php esc_html_e('Password:', 'eupago-gateway-for-woocommerce'); ?></label></th>
    432330                        <td><input class="regular-text" type="password" name="password_eupago" value="<?php echo esc_attr(get_option('eupago_password')); ?>"></td>
    433331                    </tr>
     
    438336                <tbody>
    439337                    <tr >
    440                         <th scope="row"><label for="sms_enable"><?php esc_html_e($notificacoes_sms); ?></label></th>
    441                         <td><input type="checkbox" name="sms_enable" value="yes" <?php echo $sms_enable_checked; ?>><?php esc_html_e($texto_enable); ?></td>
     338                        <th scope="row"><label for="sms_enable"><?php esc_html_e('SMS Notifications:', 'eupago-gateway-for-woocommerce'); ?></label></th>
     339                        <td><input type="checkbox" name="sms_enable" value="yes" <?php echo $sms_enable_checked; ?>><?php esc_html_e('Enable', 'eupago-gateway-for-woocommerce'); ?></td>
    442340                    </tr>
    443341                    <?php
     
    449347    ?>
    450348                    <tr class="<?php echo esc_html($sms_enabled); ?>">
    451                         <th scope="row"><label for="sms_payment_hold"><?php esc_html_e($payment_on_hold); ?></label></th>
    452                         <td><input type="checkbox" name="sms_payment_hold" value="yes" <?php echo $sms_payment_hold_checked; ?>><?php esc_html_e($texto_enable); ?></td>
    453                     </tr>
    454                     <tr class="<?php echo esc_html($sms_enabled); ?>">
    455                         <th scope="row"><label for="sms_payment_confirmation"><?php esc_html_e($payment_confirmation); ?></label></th>
    456                         <td><input type="checkbox" name="sms_payment_confirmation" value="yes" <?php echo $sms_payment_confirmation_checked; ?>><?php esc_html_e($texto_enable); ?></td>
    457                     </tr>
    458                     <tr class="<?php echo esc_html($sms_enabled); ?>">
    459                         <th scope="row"><label for="sms_order_confirmation"><?php esc_html_e($sms_order_confirmation); ?></label></th>
    460                         <td><input type="checkbox" name="sms_order_confirmation" value="yes" <?php echo $sms_order_confirmation_checked; ?>><?php esc_html_e($texto_enable); ?></td>
     349                        <th scope="row"><label for="sms_payment_hold"><?php esc_html_e('SMS Payment On Hold:', 'eupago-gateway-for-woocommerce'); ?></label></th>
     350                        <td><input type="checkbox" name="sms_payment_hold" value="yes" <?php echo $sms_payment_hold_checked; ?>><?php esc_html_e('Enable', 'eupago-gateway-for-woocommerce'); ?></td>
     351                    </tr>
     352                    <tr class="<?php echo esc_html($sms_enabled); ?>">
     353                        <th scope="row"><label for="sms_payment_confirmation"><?php esc_html_e('SMS Payment Confirmation:', 'eupago-gateway-for-woocommerce'); ?></label></th>
     354                        <td><input type="checkbox" name="sms_payment_confirmation" value="yes" <?php echo $sms_payment_confirmation_checked; ?>><?php esc_html_e('Enable', 'eupago-gateway-for-woocommerce'); ?></td>
     355                    </tr>
     356                    <tr class="<?php echo esc_html($sms_enabled); ?>">
     357                        <th scope="row"><label for="sms_order_confirmation"><?php esc_html_e('SMS Order Confirmation:', 'eupago-gateway-for-woocommerce'); ?></label></th>
     358                        <td><input type="checkbox" name="sms_order_confirmation" value="yes" <?php echo $sms_order_confirmation_checked; ?>><?php esc_html_e('Enable', 'eupago-gateway-for-woocommerce'); ?></td>
    461359                    </tr>
    462360                    <tr class="<?php echo esc_html($sms_enabled); ?>">
     
    484382            </table>
    485383            <p>
    486                 <input class="button button-primary" type="submit" name="eupago_save" value="<?php esc_html_e($save_changes_text); ?>">
     384                <input class="button button-primary" type="submit" name="eupago_save" value="<?php esc_html_e('Save Changes', 'eupago-gateway-for-woocommerce'); ?>">
    487385            </p>
    488386        </form>
     
    490388        <form id="update-callback-form" method="POST" action="">
    491389    <div class="eupago-callback">
    492         <h3><?php esc_html_e($callback); ?></h3>
     390        <h3><?php esc_html_e('Update Callback', 'eupago-gateway-for-woocommerce'); ?></h3>
    493391        <table class="form-table" role="presentation">
    494392            <tbody>
    495393                <tr>
    496                     <th scope="row"><label for="callback_api_key"><?php esc_html_e($api_key_text); ?></label></th>
     394                    <th scope="row"><label for="callback_api_key"><?php esc_html_e('API Key:', 'eupago-gateway-for-woocommerce'); ?></label></th>
    497395                    <td><input class="regular-text" type="text" id='callback_api_key' name="callback_api_key"></td>
    498396                </tr>
    499397                <tr>
    500                     <th scope="row"><label for="callback_url"><?php esc_html_e($callback_url_text); ?></label></th>
     398                    <th scope="row"><label for="callback_url"><?php esc_html_e('Callback URL:', 'eupago-gateway-for-woocommerce'); ?></label></th>
    501399                    <td><input class="regular-text" type="text" id='callback_url' name="callback_url" value="<?php echo esc_attr($callback_url); ?>" readonly></td>
    502400                </tr>
     
    504402        </table>
    505403        <p>
    506             <?php esc_html_e($texto_antepenultimo); ?>
     404            <?php esc_html_e('Please make sure that the field with Client ID and Client Secret is properly filled above to update the callback successfully.', 'eupago-gateway-for-woocommerce'); ?>
    507405            <p></p>
    508             <?php esc_html_e($texto_ultimo); ?>
     406            <?php esc_html_e('The generated URL is the default callback for a Woocommece store. If your store has a different file path please use the Eupago Backoffice.
     407 ', 'eupago-gateway-for-woocommerce'); ?>
    509408
    510409        </p>
    511410        <p>
    512             <input class="button button-primary" type="submit" name="eupago_update" id='updateCallback' value="<?php esc_html_e($callback); ?>">
     411            <input class="button button-primary" type="submit" name="eupago_update" id='updateCallback' value="<?php esc_html_e('Update Callback', 'eupago-gateway-for-woocommerce'); ?>">
    513412        </p>
    514413    </div>
     
    517416        <div class="eupago-sidebar">
    518417            <img src="<?php echo esc_attr(plugins_url('images/eupago_logo.png', __FILE__)); ?>" alt="Eupago Logo">
    519             <p><?php esc_html_e($order); ?></p>
    520             <p><?php esc_html_e($doyounedd_account); ?> <a href="https://www.eupago.pt/registo" target="_BLANK">https://www.eupago.pt/registo</a>.</p>
    521             <p><?php esc_html_e($demo_account); ?>  <a href="mailto:[email protected]">[email protected]</a>.</p>
     418            <p><?php esc_html_e('In order to use Eupago\'s plugin for WooCommerce you must have an Eupago\'s account.', 'eupago-gateway-for-woocommerce'); ?></p>
     419            <p><?php esc_html_e('Do you need an account? You may sign up at', 'eupago-gateway-for-woocommerce'); ?> <a href="https://www.eupago.pt/registo" target="_BLANK">https://www.eupago.pt/registo</a>.</p>
     420            <p><?php esc_html_e('Do you already have a demo account and need to finish your real account? Please reach out by email:', 'eupago-gateway-for-woocommerce'); ?>  <a href="mailto:[email protected]">[email protected]</a>.</p>
    522421        </div>
    523422    </div>
  • eupago-gateway-for-woocommerce/trunk/includes/views/html-admin-page.php

    r3092023 r3099513  
    22<div id="wc_eupago">
    33  <div id="wc_eupago_settings">
    4     <?php
    5     $admin_language = get_locale();
    6     $payment_method_text = __('How can I provide this payment method?', 'eupago-gateway-for-woocommerce');
    7     $request_method_text = __('You must first request its activation on your account by email:','eupago-gateway-for-woocommerce');
    8     $request_compliance_text = __('This request is subject to the approval of Eupago\'s compliance department.', 'eupago-gateway-for-woocommerce');
    9     if ($admin_language == "es_ES"){
    10       $payment_method_text = __('¿Cómo puedo ofrecer este método de pago?', 'eupago-gateway-for-woocommerce');   
    11       $request_method_text = __('Primero debes solicitar su activación en tu cuenta por correo electrónico:', 'eupago-gateway-for-woocommerce');
    12       $request_compliance_text = __('Esta solicitud está sujeta a la aprobación del departamento de cumplimiento de Eupago.', 'eupago-gateway-for-woocommerce');
    13     }
    14     ?>
    154    <h3><?php echo $this->method_title; ?> <span style="font-size: 75%;">v.<?php echo WC_Eupago::VERSION; ?></span></h3>
    165   
     
    2211      <?php } ?>
    2312
    24       <h4><?php echo esc_html($payment_method_text); ?></h4>
     13      <h4><?php esc_html_e('How can I provide this payment method?', 'eupago-gateway-for-woocommerce'); ?></h4>
    2514      <p>
    26         <?php echo esc_html($request_method_text); ?>
     15        <?php esc_html_e('You must first request its activation on your account by email:', 'eupago-gateway-for-woocommerce'); ?>
    2716        <a href="mailto:[email protected]" target="_BLANK">[email protected]</a>
    2817      </p>
    29       <p><?php echo esc_html ($request_compliance_text); ?></p>
     18      <p><?php esc_html_e('This request is subject to the approval of Eupago\'s compliance department.', 'eupago-gateway-for-woocommerce'); ?></p>
    3019    <?php } ?>
    3120     
  • eupago-gateway-for-woocommerce/trunk/includes/woocommerce-blocks/cc/src/index.js

    r3092023 r3099513  
    66const label_cc = window.wp.htmlEntities.decodeEntities(settings_cc.title) || window.wp.i18n.__('Eupago Credit Card', 'eupago_cc');
    77var description = React.createElement('p', null, window.wp.htmlEntities.decodeEntities(settings_cc.description || ''));
    8 
    98
    109/**
     
    2322 */
    2423const LabelCC = (props) => {
    25     const defaultLabel = ("Eupago Credit Card");
    2624    var icon = React.createElement('img', {
    2725      src: '/wp-content/plugins/eupago-gateway-for-woocommerce/includes/woocommerce-blocks/cc/cc_icon.jpg',
  • eupago-gateway-for-woocommerce/trunk/includes/woocommerce-blocks/cofidispay/src/index.js

    r3092023 r3099513  
    77const description_cofidispay = window.wp.htmlEntities.decodeEntities(settings_cofidispay.description || '');
    88const max_installments = window.wp.htmlEntities.decodeEntities(settings_cofidispay.maxInstallments) || window.wp.i18n.__('Up to 12 installments without interest.', 'eupago_cofidispay');
    9 
    109
    1110/**
     
    10099 */
    101100const LabelCofidisPay = (props) => {
    102   const defaultLabel =("Eupago Cofidis Pay");
    103101  var icon = React.createElement('img', {
    104102    src: '/wp-content/plugins/eupago-gateway-for-woocommerce/includes/woocommerce-blocks/cofidispay/cofidispay.png',
  • eupago-gateway-for-woocommerce/trunk/includes/woocommerce-blocks/mbway/src/index.js

    r3092023 r3099513  
    55const settings_mbway = window.wc.wcSettings.getSetting('eupago_mbway_data', {});
    66const label_mbway = window.wp.htmlEntities.decodeEntities(settings_mbway.title) || window.wp.i18n.__('Eupago MB Way', 'eupago_mbway');
    7 
    87
    98
     
    8483 */
    8584const LabelMBWay = (props) => {
    86     const defaultLabel =("Eupago MB Way");
    8785    var icon = React.createElement('img', {
    8886        src: '/wp-content/plugins/eupago-gateway-for-woocommerce/includes/woocommerce-blocks/mbway/mbway_banner.png',
  • eupago-gateway-for-woocommerce/trunk/includes/woocommerce-blocks/multibanco/src/index.js

    r3092023 r3099513  
    2424 * @param {*} props Props from payment API.
    2525 */
    26 
    2726const LabelMultibanco = (props) => {
    28     const defaultLabel = ("Eupago Multibanco");
    2927    var icon = React.createElement('img', {
    3028      src: '/wp-content/plugins/eupago-gateway-for-woocommerce/includes/woocommerce-blocks/multibanco/multibanco_banner.png',
  • eupago-gateway-for-woocommerce/trunk/includes/woocommerce-blocks/payshop/src/index.js

    r3092023 r3099513  
    66const label_payshop = window.wp.htmlEntities.decodeEntities(settings_payshop.title) || window.wp.i18n.__('Eupago Payshop', 'eupago_payshop');
    77var description = React.createElement('p', null, window.wp.htmlEntities.decodeEntities(settings_payshop.description || ''));
    8 
    98
    109/**
     
    2322 */
    2423const LabelPayshop = (props) => {
    25     const defaultLabel = ("Eupago Payshop");
    2624    var icon = React.createElement('img', {
    2725      src: '/wp-content/plugins/eupago-gateway-for-woocommerce/includes/woocommerce-blocks/payshop/payshop_banner.png',
  • eupago-gateway-for-woocommerce/trunk/readme.txt

    r3097313 r3099513  
    77Tested up to: 6.4.2
    88Requires PHP: 7.0
    9 Stable tag: 4.1.3
     9Stable tag: 4.1.4
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4444== Changelog ==
    4545
     46= 4.1.4 (07/06/2024) =
     47* Fix some problems with MBway and Credit Card methods.
     48* Reverted Translations for ES,PT and ENG.
    4649
    4750= 4.1.3 (23/05/2024) =
Note: See TracChangeset for help on using the changeset viewer.