Plugin Directory

Changeset 2387101


Ignore:
Timestamp:
09/23/2020 12:56:33 PM (6 years ago)
Author:
fastconnect
Message:

Versão 2.1.3

Location:
fastconnect-woocommerce/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • fastconnect-woocommerce/trunk/includes/class-wc-fastconnect-api.php

    r2384678 r2387101  
    608608
    609609                                        if ( 'yes' == $this->gateway->debug ) {
    610                                                 $this->gateway->log->add( $this->gateway->id, 'An error occurred while generating the FastConnect direct payment: ' . print_r( $response, true ) );
     610                                                $this->gateway->log->add( $this->gateway->id, 'An error occurred while generating the FastConnect direct payment: ' . print_r( $data, true ) );
    611611                                        }
    612612
    613                                         foreach ( $data->errors as $error_key => $error ) {
    614                                                 if ( isset($error->code) ) {
    615                                                         $msg = '<strong>' . __( 'FastConnect', 'woocommerce-fastconnect' ) . '</strong>: ' . $error->code . ' - ' . $error->message;
    616 
    617                                                         if( isset($error->fields) && is_array($error->fields) && count($error->fields) )
    618                                                                 $msg .= '<br>' . join('<br>', $error->fields);
    619 
    620                                                         $errors[] = $msg;
    621                                                 } else {
    622                                                         $errors[] = '<strong>' . __( 'FastConnect', 'woocommerce-fastconnect' ) . '</strong>: ' . $error;
     613                                        if( is_array($data->errors) && count($data->errors) ) {
     614                                                foreach ( $data->errors as $error ) {
     615                                                        if ( isset($error->code) ) {
     616                                                                $msg = '<strong>' . __( 'FastConnect', 'woocommerce-fastconnect' ) . '</strong>: ' . $error->code . ' - ' . $error->message;
     617
     618                                                                print_r($error, true);
     619
     620                                                                if( is_array($error->fields) && count($error->fields) ) {
     621                                                                        if( isset($error->fields[0]) && isset($error->fields[0]->code) ) {
     622                                                                                foreach( $error->fields as $k => $v ) {
     623                                                                                        $msg .= '<br>' . $v->message;
     624                                                                                        if( isset($v->details) && is_array($v->details) && count($v->details) ) {
     625                                                                                                $msg .= ', ' . join(';',$v->details);
     626                                                                                        }
     627                                                                                }
     628                                                                        } else {
     629                                                                                $msg .= '<br>' . join('<br>', $error->fields);
     630                                                                        }
     631                                                                }
     632
     633                                                                $errors[] = $msg;
     634                                                        } else {
     635                                                                $errors[] = '<strong>' . __( 'FastConnect', 'woocommerce-fastconnect' ) . '</strong>: ' . join('<br>', $error);
     636                                                        }
    623637                                                }
     638                                        } else {
     639                                                $errors[] = '<strong>' . __( 'FastConnect', 'woocommerce-fastconnect' ) . '</strong>: Ocorreu um erro inesperado, tente novamente mais tarde';
    624640                                        }
     641
    625642
    626643                                        return array(
  • fastconnect-woocommerce/trunk/includes/class-wc-fastconnect-gateway.php

    r2384678 r2387101  
    5252                $this->fc_status_due_date   = $this->get_option( 'fc_status_due_date', 'wc-on-hold' );
    5353                $this->fc_status_paid       = $this->get_option( 'fc_status_paid', 'wc-processing' );
     54                $this->fc_billet_status_paid= $this->get_option( 'fc_billet_status_paid', 'wc-processing' );
     55                $this->fc_credit_status_paid= $this->get_option( 'fc_credit_status_paid', 'wc-processing' );
    5456                $this->fc_status_pending    = $this->get_option( 'fc_status_pending', 'wc-on-hold' );
    5557                $this->invoice_prefix       = $this->get_option( 'invoice_prefix', 'WC-' );
    … …  
    333335                                'default' => 'wc-on-hold',
    334336                        ),
     337                        'fc_billet_status_paid' => array(
     338                                'title' => __('Status para ordem paga', 'wc-gateway-fastconnect'),
     339                                'description' => __('Quando o pagamento por boleto for efetuado, mudar o status para', 'wc-gateway-fastconnect'),
     340                                'type' => 'select',
     341                                'options' => $orderStatus,
     342                                'default' => 'wc-processing',
     343                        ),
    335344                        'fc_billet_message'    => array(
    336345                                'title'   => __( 'Mensagem para boleto', 'woocommerce-fastconnect' ),
    337                                 'type'    => 'input',
     346                                'type' => 'textarea',
     347                                'css' => 'max-width:400px;',
    338348                                'description'   => __( 'Isso será exibido no checkout para o usuário.', 'woocommerce-fastconnect' ),
    339349                                'default' => '',
    340350                        ),
    341351
    342                         //Boletos
     352                        //Credito
    343353                        'credit' => array(
    344354                                'title'       => __( 'Cartão de Crédito', 'wc-gateway-fastconnect' ),
    … …  
    383393                                'desc_tip'    => true,
    384394                        ),
     395                        'fc_credit_status_paid' => array(
     396                                'title' => __('Status para ordem paga', 'wc-gateway-fastconnect'),
     397                                'description' => __('Quando o pagamento for efetuado por crédito, mudar o status para', 'wc-gateway-fastconnect'),
     398                                'type' => 'select',
     399                                'options' => $orderStatus,
     400                                'default' => 'wc-processing',
     401                        ),
    385402
    386403                        'behavior'             => array(
    … …  
    404421                                'default' => 'wc-on-hold',
    405422                        ),
    406                         /*'fc_status_paid' => array(
    407                                 'title' => __('Status para ordem paga', 'wc-gateway-fastconnect'),
    408                                 'description' => __('Quando o pagamento for efetuado, mudar o status para', 'wc-gateway-fastconnect'),
    409                                 'type' => 'select',
    410                                 'options' => $orderStatus,
    411                                 'default' => 'wc-processing',
    412                         ),*/
    413423
    414424                        'testing'              => array(
    … …  
    713723                                        // Sometimes FastConnect should change an order from cancelled to paid, so we need to handle it.
    714724                                        if ( method_exists( $order, 'get_status' ) && 'cancelled' === $order->get_status() ) {
    715                                                 $order->update_status( str_replace('wc-', '', $this->fc_status_paid), __( 'FastConnect: Pagamento aprovado.', 'woocommerce-fastconnect' ) );
     725                                                $order->update_status( str_replace('wc-', '', $this->fc_credit_status_paid), __( 'FastConnect: Pagamento aprovado.', 'woocommerce-fastconnect' ) );
    716726                                                wc_reduce_stock_levels( $order_id );
    717727                                        } else {
    718728                                                $order->add_order_note( __( 'FastConnect: Pagamento aprovado.', 'woocommerce-fastconnect' ) );
    719                                                 if( $posted->tipo == 'credito' ) {
    720                                                         wc_reduce_stock_levels( $order_id );
    721                                                 }
     729
    722730                                                // Changing the order for processing and reduces the stock.
    723731                                                $order->payment_complete( sanitize_text_field( (string) $posted->nu_venda ) );
     732
     733                                                if( $posted->tipo == 'credito' ) {
     734
     735                                                        $order->update_status( str_replace('wc-', '', $this->fc_credit_status_paid), __( 'FastConnect: Pagamento aprovado.', 'woocommerce-fastconnect' ) );
     736
     737                                                } else {
     738
     739                                                        $order->update_status( str_replace('wc-', '', $this->fc_billet_status_paid), __( 'FastConnect: Pagamento aprovado.', 'woocommerce-fastconnect' ) );
     740
     741                                                }
     742
    724743                                        }
    725744                                }
  • fastconnect-woocommerce/trunk/readme.txt

    r2384678 r2387101  
    44Requires at least: 4.0
    55Tested up to: 5.2
    6 Stable tag: 2.0.2
     6Stable tag: 2.1.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    … …  
    125125Sim, o status é alterado automaticamente usando as notifificações da API da FastConnect.
    126126
    127 = Funciona com o Sandbox do FastConnect? =
     127= Funciona com o Sandbox da FastConnect? =
    128128
    129129Sim, funciona e basta você ativar isso nas opções do plugin, além de configurar o seu client_code e client_key de testes.
    … …  
    151151
    152152* Corrigido problema de visualização do checkout
     153
     154= 2.1.3 - 2020/09/18 =
     155
     156* Adicionada opção para alterar status de um pagamento efetuado
  • fastconnect-woocommerce/trunk/woocommerce-fastconnect.php

    r2384678 r2387101  
    66 * Author:               FastConnect Team
    77 * Author URI:           https://fastconnect.com.br
    8  * Version:              2.0.3
     8 * Version:              2.1.3
    99 * License:              GPLv3 or later
    1010 * Text Domain:          woocommerce-fastconnect
    … …  
    1919
    2020// Plugin constants.
    21 define( 'WC_FASTCONNECT_VERSION', '2.0.3' );
     21define( 'WC_FASTCONNECT_VERSION', '2.1.3' );
    2222define( 'WC_FASTCONNECT_PLUGIN_FILE', __FILE__ );
    2323
Note: See TracChangeset for help on using the changeset viewer.