Plugin Directory

Changeset 2750512


Ignore:
Timestamp:
06/30/2022 11:02:23 PM (4 years ago)
Author:
incuca
Message:

tagging version 1.4.0

Location:
incuca-tech-pix-for-woocommerce
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • incuca-tech-pix-for-woocommerce/tags/1.4.0/README.md

    r2621370 r2750512  
    88Requires WooCommerce at least: 2.1
    99
    10 Tested up to: 5.8.1
     10Tested up to: 6.0
    1111
    1212Requires PHP: 7.1
    1313
    14 Stable Tag: 1.3.6
     14Stable Tag: 1.4.0
    1515
    1616License: GPLv3.0
     
    123123
    124124* Pequena correção de layout para mobile
     125
     126= 2022.06.30 - version 1.4.0 =
     127
     128* Opção de escolha do ícone do Pix
     129* Adição de descrição no pagamento
     130* Correção no retorno do código Pix
  • incuca-tech-pix-for-woocommerce/tags/1.4.0/includes/class-wc-pix-gateway.php

    r2621370 r2750512  
    2525        $this->domain = 'woocommerce-pix';
    2626        $this->id = 'pix_gateway';
    27         $this->icon = apply_filters('woocommerce_gateway_icon', WC_PIX_PLUGIN_URL . 'assets/icon-pix.png');
     27        $color = $this->get_option('icon_color') ? $this->get_option('icon_color') : 'black';
     28        $this->icon = apply_filters('woocommerce_gateway_icon', WC_PIX_PLUGIN_URL . 'assets/icon-pix-' . $color . '.png');
    2829        $this->has_fields = false;
    2930        $this->method_title = __('Pix', $this->domain);
     
    3940        $this->instructions = $this->get_option('instructions');
    4041        $this->key = $this->get_option('key');
     42        $this->prefix_transaction_id = $this->get_option('prefix_transaction_id') ? $this->get_option('prefix_transaction_id') : 'ID';
    4143        $this->merchant = $this->get_option('merchant');
    4244        $this->city = $this->get_option('city');
    43         $this->key = $this->get_option('key');
    4445        $this->whatsapp = $this->get_option('whatsapp');
    4546        $this->telegram = $this->get_option('telegram');
     
    116117    {
    117118        return $this->key;
     119    }
     120
     121    /**
     122     * Get prefix_transaction_id.
     123     *
     124     * @return string
     125     */
     126    public function get_prefix_transaction_id()
     127    {
     128        return $this->prefix_transaction_id;
    118129    }
    119130
     
    172183                'default'     => __('Faça um Pix', 'woocommerce-pix'),
    173184            ),
     185            'icon_color'                => array(
     186                'title'       => __('Cor do ícone do PIX', 'woocommerce-pix'),
     187                'type'        => 'select',
     188                'description' => __('Cor do ícone que vai aparecer ao lado do título', 'woocommerce-pix'),
     189                'desc_tip'    => true,
     190                'options'     => array(
     191                    'black' => 'Preto',
     192                    'white' => 'Branco',
     193                    'green' => 'Verde'
     194                ),
     195                'default'     => 'green',
     196            ),
    174197            'description'          => array(
    175198                'title'       => __('Descrição', 'woocommerce-pix'),
     
    189212                'default'     => '',
    190213                'required'    => true,
     214            ),
     215            'prefix_transaction_id' => array(
     216                'title'       => __('Prefixo Transaction ID (obrigatório)', 'woocommerce-pix'),
     217                'type'        => 'text',
     218                'description' => __('Por favor, informe o prefixo da Transaction ID.<br>Máximo de 10 caracteres.<br>Ela é importante identificar o pagamento no extrato do PIX.<br>Somente alfanúmerico (tabela ASCII): <code>A-Z</code>, <code>a-z</code> e <code>0-9</code>.', 'woocommerce-pix'),
     219                'default'     => '',
     220                'required'    => true,
     221                'custom_attributes' => [
     222                    'maxlength' => 10
     223                ]
    191224            ),
    192225            'merchant'                => array(
     
    401434        $pix->valor($order->get_total());
    402435        $pix->cidade($this->city);
    403         // $pix->info('ID '.$order_id);
    404436        $pix->lojista($this->merchant);
    405437        $pix->moeda(986); // Real brasileiro (BRL) - Conforme ISO 4217: https://pt.wikipedia.org/wiki/ISO_4217
    406         $pix->txId('ID' . $order_id);
     438        $pix->txId($this->prefix_transaction_id . $order_id);
     439        $pix->info($this->prefix_transaction_id . $order_id);
    407440        $link = $pix->toCode();
    408441        $image = $pix->toImage();
  • incuca-tech-pix-for-woocommerce/tags/1.4.0/includes/services/class-crc16.php

    r2524885 r2750512  
    4848            }
    4949        }
    50         return strtoupper( dechex( $response ) );
     50        return strtoupper( str_pad( dechex( $response ), 4, '0', STR_PAD_LEFT) );
    5151    }
    5252}
  • incuca-tech-pix-for-woocommerce/tags/1.4.0/pix-for-woocommerce.php

    r2621370 r2750512  
    77 * Author: InCuca Tech
    88 * Author URI: https://incuca.net
    9  * Version: 1.3.6
    10  * Tested up to: 5.8.1
     9 * Version: 1.4.0
     10 * Tested up to: 6.0
    1111 * License: GNU General Public License v3.0
    1212 *
     
    1616defined('ABSPATH') or exit;
    1717
    18 define('WC_PIX_VERSION', '1.3.6');
     18define('WC_PIX_VERSION', '1.4.0');
    1919define('WC_PIX_PLUGIN_FILE', __FILE__);
    2020define('WC_PIX_PLUGIN_URL', plugin_dir_url(__FILE__));
  • incuca-tech-pix-for-woocommerce/tags/1.4.0/readme.txt

    r2621370 r2750512  
    33Tags: woocommerce, payment gateway, gateway, pix
    44Requires WooCommerce at least: 2.1
    5 Tested up to: 5.8.1
     5Tested up to: 6.0
    66Requires PHP: 7.1
    7 Stable Tag: 1.3.6
     7Stable Tag: 1.4.0
    88License: GPLv3.0
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    114114
    115115* Pequena correção de layout para mobile
     116
     117= 2022.06.30 - version 1.4.0 =
     118
     119* Opção de escolha do ícone do Pix
     120* Adição de descrição no pagamento
     121* Correção no retorno do código Pix
  • incuca-tech-pix-for-woocommerce/trunk/README.md

    r2621370 r2750512  
    88Requires WooCommerce at least: 2.1
    99
    10 Tested up to: 5.8.1
     10Tested up to: 6.0
    1111
    1212Requires PHP: 7.1
    1313
    14 Stable Tag: 1.3.6
     14Stable Tag: 1.4.0
    1515
    1616License: GPLv3.0
     
    123123
    124124* Pequena correção de layout para mobile
     125
     126= 2022.06.30 - version 1.4.0 =
     127
     128* Opção de escolha do ícone do Pix
     129* Adição de descrição no pagamento
     130* Correção no retorno do código Pix
  • incuca-tech-pix-for-woocommerce/trunk/includes/class-wc-pix-gateway.php

    r2621370 r2750512  
    2525        $this->domain = 'woocommerce-pix';
    2626        $this->id = 'pix_gateway';
    27         $this->icon = apply_filters('woocommerce_gateway_icon', WC_PIX_PLUGIN_URL . 'assets/icon-pix.png');
     27        $color = $this->get_option('icon_color') ? $this->get_option('icon_color') : 'black';
     28        $this->icon = apply_filters('woocommerce_gateway_icon', WC_PIX_PLUGIN_URL . 'assets/icon-pix-' . $color . '.png');
    2829        $this->has_fields = false;
    2930        $this->method_title = __('Pix', $this->domain);
     
    3940        $this->instructions = $this->get_option('instructions');
    4041        $this->key = $this->get_option('key');
     42        $this->prefix_transaction_id = $this->get_option('prefix_transaction_id') ? $this->get_option('prefix_transaction_id') : 'ID';
    4143        $this->merchant = $this->get_option('merchant');
    4244        $this->city = $this->get_option('city');
    43         $this->key = $this->get_option('key');
    4445        $this->whatsapp = $this->get_option('whatsapp');
    4546        $this->telegram = $this->get_option('telegram');
     
    116117    {
    117118        return $this->key;
     119    }
     120
     121    /**
     122     * Get prefix_transaction_id.
     123     *
     124     * @return string
     125     */
     126    public function get_prefix_transaction_id()
     127    {
     128        return $this->prefix_transaction_id;
    118129    }
    119130
     
    172183                'default'     => __('Faça um Pix', 'woocommerce-pix'),
    173184            ),
     185            'icon_color'                => array(
     186                'title'       => __('Cor do ícone do PIX', 'woocommerce-pix'),
     187                'type'        => 'select',
     188                'description' => __('Cor do ícone que vai aparecer ao lado do título', 'woocommerce-pix'),
     189                'desc_tip'    => true,
     190                'options'     => array(
     191                    'black' => 'Preto',
     192                    'white' => 'Branco',
     193                    'green' => 'Verde'
     194                ),
     195                'default'     => 'green',
     196            ),
    174197            'description'          => array(
    175198                'title'       => __('Descrição', 'woocommerce-pix'),
     
    189212                'default'     => '',
    190213                'required'    => true,
     214            ),
     215            'prefix_transaction_id' => array(
     216                'title'       => __('Prefixo Transaction ID (obrigatório)', 'woocommerce-pix'),
     217                'type'        => 'text',
     218                'description' => __('Por favor, informe o prefixo da Transaction ID.<br>Máximo de 10 caracteres.<br>Ela é importante identificar o pagamento no extrato do PIX.<br>Somente alfanúmerico (tabela ASCII): <code>A-Z</code>, <code>a-z</code> e <code>0-9</code>.', 'woocommerce-pix'),
     219                'default'     => '',
     220                'required'    => true,
     221                'custom_attributes' => [
     222                    'maxlength' => 10
     223                ]
    191224            ),
    192225            'merchant'                => array(
     
    401434        $pix->valor($order->get_total());
    402435        $pix->cidade($this->city);
    403         // $pix->info('ID '.$order_id);
    404436        $pix->lojista($this->merchant);
    405437        $pix->moeda(986); // Real brasileiro (BRL) - Conforme ISO 4217: https://pt.wikipedia.org/wiki/ISO_4217
    406         $pix->txId('ID' . $order_id);
     438        $pix->txId($this->prefix_transaction_id . $order_id);
     439        $pix->info($this->prefix_transaction_id . $order_id);
    407440        $link = $pix->toCode();
    408441        $image = $pix->toImage();
  • incuca-tech-pix-for-woocommerce/trunk/includes/services/class-crc16.php

    r2524885 r2750512  
    4848            }
    4949        }
    50         return strtoupper( dechex( $response ) );
     50        return strtoupper( str_pad( dechex( $response ), 4, '0', STR_PAD_LEFT) );
    5151    }
    5252}
  • incuca-tech-pix-for-woocommerce/trunk/pix-for-woocommerce.php

    r2621370 r2750512  
    77 * Author: InCuca Tech
    88 * Author URI: https://incuca.net
    9  * Version: 1.3.6
    10  * Tested up to: 5.8.1
     9 * Version: 1.4.0
     10 * Tested up to: 6.0
    1111 * License: GNU General Public License v3.0
    1212 *
     
    1616defined('ABSPATH') or exit;
    1717
    18 define('WC_PIX_VERSION', '1.3.6');
     18define('WC_PIX_VERSION', '1.4.0');
    1919define('WC_PIX_PLUGIN_FILE', __FILE__);
    2020define('WC_PIX_PLUGIN_URL', plugin_dir_url(__FILE__));
  • incuca-tech-pix-for-woocommerce/trunk/readme.txt

    r2621370 r2750512  
    33Tags: woocommerce, payment gateway, gateway, pix
    44Requires WooCommerce at least: 2.1
    5 Tested up to: 5.8.1
     5Tested up to: 6.0
    66Requires PHP: 7.1
    7 Stable Tag: 1.3.6
     7Stable Tag: 1.4.0
    88License: GPLv3.0
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    114114
    115115* Pequena correção de layout para mobile
     116
     117= 2022.06.30 - version 1.4.0 =
     118
     119* Opção de escolha do ícone do Pix
     120* Adição de descrição no pagamento
     121* Correção no retorno do código Pix
Note: See TracChangeset for help on using the changeset viewer.