Changeset 2387101
- Timestamp:
- 09/23/2020 12:56:33 PM (6 years ago)
- Location:
- fastconnect-woocommerce/trunk
- Files:
-
- 4 edited
-
includes/class-wc-fastconnect-api.php (modified) (1 diff)
-
includes/class-wc-fastconnect-gateway.php (modified) (5 diffs)
-
readme.txt (modified) (3 diffs)
-
woocommerce-fastconnect.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fastconnect-woocommerce/trunk/includes/class-wc-fastconnect-api.php
r2384678 r2387101 608 608 609 609 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 ) ); 611 611 } 612 612 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 } 623 637 } 638 } else { 639 $errors[] = '<strong>' . __( 'FastConnect', 'woocommerce-fastconnect' ) . '</strong>: Ocorreu um erro inesperado, tente novamente mais tarde'; 624 640 } 641 625 642 626 643 return array( -
fastconnect-woocommerce/trunk/includes/class-wc-fastconnect-gateway.php
r2384678 r2387101 52 52 $this->fc_status_due_date = $this->get_option( 'fc_status_due_date', 'wc-on-hold' ); 53 53 $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' ); 54 56 $this->fc_status_pending = $this->get_option( 'fc_status_pending', 'wc-on-hold' ); 55 57 $this->invoice_prefix = $this->get_option( 'invoice_prefix', 'WC-' ); … … 333 335 'default' => 'wc-on-hold', 334 336 ), 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 ), 335 344 'fc_billet_message' => array( 336 345 'title' => __( 'Mensagem para boleto', 'woocommerce-fastconnect' ), 337 'type' => 'input', 346 'type' => 'textarea', 347 'css' => 'max-width:400px;', 338 348 'description' => __( 'Isso será exibido no checkout para o usuário.', 'woocommerce-fastconnect' ), 339 349 'default' => '', 340 350 ), 341 351 342 // Boletos352 //Credito 343 353 'credit' => array( 344 354 'title' => __( 'Cartão de Crédito', 'wc-gateway-fastconnect' ), … … 383 393 'desc_tip' => true, 384 394 ), 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 ), 385 402 386 403 'behavior' => array( … … 404 421 'default' => 'wc-on-hold', 405 422 ), 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 ),*/413 423 414 424 'testing' => array( … … 713 723 // Sometimes FastConnect should change an order from cancelled to paid, so we need to handle it. 714 724 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' ) ); 716 726 wc_reduce_stock_levels( $order_id ); 717 727 } else { 718 728 $order->add_order_note( __( 'FastConnect: Pagamento aprovado.', 'woocommerce-fastconnect' ) ); 719 if( $posted->tipo == 'credito' ) { 720 wc_reduce_stock_levels( $order_id ); 721 } 729 722 730 // Changing the order for processing and reduces the stock. 723 731 $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 724 743 } 725 744 } -
fastconnect-woocommerce/trunk/readme.txt
r2384678 r2387101 4 4 Requires at least: 4.0 5 5 Tested up to: 5.2 6 Stable tag: 2. 0.26 Stable tag: 2.1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 125 125 Sim, o status é alterado automaticamente usando as notifificações da API da FastConnect. 126 126 127 = Funciona com o Sandbox d oFastConnect? =127 = Funciona com o Sandbox da FastConnect? = 128 128 129 129 Sim, funciona e basta você ativar isso nas opções do plugin, além de configurar o seu client_code e client_key de testes. … … 151 151 152 152 * 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 6 6 * Author: FastConnect Team 7 7 * Author URI: https://fastconnect.com.br 8 * Version: 2. 0.38 * Version: 2.1.3 9 9 * License: GPLv3 or later 10 10 * Text Domain: woocommerce-fastconnect … … 19 19 20 20 // Plugin constants. 21 define( 'WC_FASTCONNECT_VERSION', '2. 0.3' );21 define( 'WC_FASTCONNECT_VERSION', '2.1.3' ); 22 22 define( 'WC_FASTCONNECT_PLUGIN_FILE', __FILE__ ); 23 23
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)