Plugin Directory

Changeset 3301026


Ignore:
Timestamp:
05/26/2025 11:10:50 PM (10 months ago)
Author:
clearsale
Message:

Adding 3.1.6 version of my plugin

Location:
clearsale-total
Files:
15 edited
16 copied

Legend:

Unmodified
Added
Removed
  • clearsale-total/tags/3.1.6/CHANGELOG.md

    r3135161 r3301026  
     1## [3.1.6] - 2025-03-26
     2
     3### Added
     4- Adicionado Pagar.me com dois cartões
     5- Adicionado wp_schedule_single_event para verificar se o pedido foi integrado.
     6
     7
     8## [3.1.5] - 2024-11-11
     9
     10### Added
     11- Adicionado método PagBank Integrações (Ricardo Martins) Versão - 4.24.1
     12
     13### Fixed
     14- Arrumado forma de pegar texto do nome erede_pix do loja5
     15
     16
     17## [3.1.4] - 2024-10-25
     18
     19### Added
     20- Adicionado PIX no método do eRede loja5
     21
     22
    123## [3.1.3] - 2024-08-05
    224
     
    3557
    3658### Added
    37 - Método PayPal mas sem dados de cartão.
     59- Método PaylPal mas sem dados de cartão.
    3860
    3961
  • clearsale-total/tags/3.1.6/README.txt

    r3135161 r3301026  
    44Tags:  fraud, fraud protection, prevent fake orders, e-commerce, woocommerce, sell, store, loja virtual, shop, clearsale, antifraude, análise por inteligência artificial, equipe de detecção de fraude, cartão de crédito
    55Requires at least: 5.0
    6 Tested up to: 6.6
    7 Stable tag: 3.1.3
     6Tested up to: 6.8
     7Stable tag: 3.1.6
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    1111
    1212Integração do WooCommerce com a ClearSale.
    13 testado: wordpress 6.6
    14 woocommerce 9.1
     13testado: wordpress 6.8
     14woocommerce 9.8
    1515Requisitos:
    1616php 5.6 ou maior
     
    8181
    8282== Changelog ==
     83## [3.1.6] - 2025-03-26
     84
     85### Added
     86- Adicionado Pagar.me com dois cartões
     87- Adicionado wp_schedule_single_event para verificar se o pedido foi integrado.
     88
     89
     90## [3.1.5] - 2024-11-11
     91
     92### Added
     93- Adicionado método PagBank Integrações (Ricardo Martins) Versão - 4.24.1
     94
     95
     96## [3.1.4] - 2024-10-25
     97
     98### Added
     99- Adicionado PIX no método do eRede loja5
     100
     101
    83102## [3.1.3] - 2024-08-05
    84103
     
    129148
    130149
    131 ## [3.0.17] - 2023-08-03
    132 ### Added
    133 - Acionado webhook de novo status após aprovação.
    134 - Melhorias nas mensagens de depuração.
    135 
    136 ### Changed
    137 - Só altera para inanalisis se status anterior for NVO.
    138150
    139151
  • clearsale-total/tags/3.1.6/admin/class-clearsale-total-admin.php

    r3135161 r3301026  
    328328
    329329        <?php
    330        
     330
    331331    } // end of cs_total_render_order_resent
    332332
  • clearsale-total/tags/3.1.6/clearsale-total.php

    r3135161 r3301026  
    1818 * Plugin URI:        https://api.clearsale.com.br/docs/plugins/wooCommerce/totalTotalGarantidoApplication
    1919 * Description:       Integração da loja WooCommerce e a ClearSale Total. Segurança para suas vendas.
    20  * Version:           3.1.3
     20 * Version:           3.1.6
    2121 * Author:            ClearSale
    2222 * Author URI:        https://br.clear.sale
     
    5858 * Rename this for your plugin and update it as you release new versions.
    5959 */
    60 define('CLEARSALE_TOTAL_VERSION', '3.1.3');
     60define('CLEARSALE_TOTAL_VERSION', '3.1.6');
    6161
    6262/**
  • clearsale-total/tags/3.1.6/includes/class-clearsale-total-activator.php

    r3050591 r3301026  
    124124            $error_message = $ret->get_error_message();
    125125            $wl->write_log("Activate: erro no wp_remote_post: " . print_r($error_message,true));
    126             //syslog(LOG_WARNING, "Something went wrong:" . $error_message);
    127126        } else {
    128127            $response = $ret['response'];
     
    134133            }
    135134            //$wl->write_log("Activate: sucesso" . print_r($ret,true));
    136             //syslog(LOG_WARNING,"sucesso:" . print_r($ret,true));
    137135        }
    138136        /* O retorna no $ret acima:
  • clearsale-total/tags/3.1.6/includes/class-clearsale-total-ajax.php

    r3135161 r3301026  
    293293                // compatibilidade com HPOS
    294294                $order = new WC_Order($pedido);
    295                 $order->update_meta_data('cs_cartao', $cartao);
    296                 $order->save();
     295                $order->update_meta_data('cs_cartao', $cartao);
     296                $order->save();
    297297                $wl->write_log("Clearsale_Total_Ajax: clearsale_total_push: Pedido " . $pedido . ", pago com "
    298298                 . $cartao['modo'] . " dados salvo para posterior inserção na ClearSale");
  • clearsale-total/tags/3.1.6/includes/class-clearsale-total-api.php

    r3135161 r3301026  
    545545
    546546        $this->wl->write_log("Monta_pedido: entrou, #doc=" . $cs_doc . " e-mail=" . $email);
    547 //$this->wl->write_log("Monta_pedido: order_data=" . print_r($order_data,true));
    548547
    549548        if ($cartao == "" || count($cartao) < 1) { // qdo vindo do checkout nao temos # cartao, apenas vindo do ajax
     
    728727                                    'reference' => ''
    729728                                    ),
    730 /* como nao tem dados o Joelson pediu para tirar - email 3/12/18
     729                /* como nao tem dados o Joelson pediu para tirar - email 3/12/18
    731730                'phones'            => array(
    732731                                    array(
     
    753752            'document'      =>  $cpf            );
    754753            */
    755             $tmp_payments = array();
     754            $tmp_payments = array();  // sempre para o 1ro cartao
     755            $tmp_payments2 = array(); // qdo temos o 2do cartao, por hora só o Pagar.me
    756756            $tipo_pgto = $this->Tipo_pagamento($order_data['payment_method']); // pag 18
    757757            if ("checkout-cielo" === $order_data['payment_method']) {
     
    793793                }
    794794            }
    795             if ("Pagar.me" === $order_data['payment_method']) {
     795            if ("Pagar.me" === $order_data['payment_method'] || "woo-pagarme-payments-2_cards" === $order_data['payment_method']) {
    796796                $tmp = get_post_meta($order_data['id'], "_pagarme_payment_method", true);
    797797                if (empty($tmp))
     
    799799                /* _pagarme_payment_method = billet
    800800                   _pagarme_payment_method = credit_card
     801                   _pagarme_payment_method = 2_cards
    801802                   _pagarme_payment_method = pix
     803                   _payment_method  = woo-pagarme-payments-2_cards
     804                   Tipo_pagamento: tipo=woo-pagarme-payments-2_cards
    802805                */
     806                if ("2_cards" == $tmp) { // tratar 2 cartoes aqui, nao pega nada em outrosMetodos
     807                    $cartoes = $this->segundoCartaoPagarme($order_data['id']);
     808                    $cartao['modo'] = "";
     809                    if ($cartoes) {
     810                        $seq = 0;
     811                        foreach($cartoes as $umcart) {
     812                            $seq++;
     813                            $inteiro = substr($umcart['amount'],0,-2);
     814                            if ($inteiro == "") $inteiro="0";
     815                            $amount = $inteiro . "." . substr($umcart['amount'], -2);
     816                            $star="******";
     817                            $cartao_array = array(
     818                                'number'    =>  $umcart['bin'] . $star . $umcart['end'],
     819                                'hash'      =>  '',
     820                                'bin'       =>  $umcart['bin'],
     821                                'end'       =>  $umcart['end'],
     822                                'type'      =>  $this->Bandeira_Cartao($umcart['bin'] . $star . $umcart['end']),
     823                                'validityDate' =>   $umcart['validity'],
     824                                'ownerName' =>  $umcart['owner'],
     825                                'document'  =>  $cs_doc,
     826                                'nsu'       =>  ''
     827                            );
     828                            $bill = $umcart['billing_address'];
     829                            $tmp_payments2[] = array(
     830                                'sequential'        =>  $seq,
     831                                'date'              =>  $order_data['date_created']->date('c'),
     832                                'value'             =>  (float)$amount,
     833                                'type'              =>  1, // credito
     834                                'installments'      =>  $umcart['install'],
     835                                'interestRate'      =>  0,
     836                                'interestValue'     =>  0,
     837                                'currency'          =>  $this->Tipo_moeda($order_data['currency']), // pag 25
     838                                'voucherOrderOrigin'=>  '',
     839                                'card'              =>  $cartao_array,
     840                                'address'           =>  array(
     841                                                    'street'    =>  $bill['street'],
     842                                                    'number'    =>  $bill['number'],
     843                                                    'additionalInformation' =>  '',
     844                                                    'county'    =>  $bill['neighborhood'],
     845                                                    'city'      =>  $bill['city'],
     846                                                    'state'     =>  $bill['state'],
     847                                                    'zipcode'   =>  $bill['zip_code'],
     848                                                    'country'   =>  $bill['country'],
     849                                                    'reference' =>  ''
     850                                                    )
     851                            );
     852                        }
     853                    }
     854                }
    803855                if ("billet" === $tmp) {
    804856                    $tipo_pgto = $this->Tipo_pagamento("boleto");
     
    857909                                    )
    858910            );
    859             $header['payments'] = $tmp_payments;
     911            if (count($tmp_payments2) <= 0) {
     912                $header['payments'] = $tmp_payments;
     913            } else {
     914                $header['payments'] = $tmp_payments2;
     915            }
    860916
    861917            // Items - deve ser array de itens - $items = $order->get_items()
     
    9701026
    9711027    /**
     1028     * Método para pegar segundo cartao do Pagar.me
     1029     * @param   string  $pedido - Número do pedido
     1030     * @return  array|false Caso de erro ou array com dados dos dois cartoes
     1031     */
     1032    public function segundoCartaoPagarme($pedido)
     1033    {
     1034        global $wpdb;
     1035       
     1036        $retorno = array();
     1037        $table_name = $wpdb->prefix.'pagarme_module_core_charge';
     1038        $mydata = $wpdb->get_results("SELECT * FROM $table_name WHERE code = '$pedido'", ARRAY_A);
     1039        if ($mydata) {
     1040            // retorna um arrai com duas posicoes, dos dois pagamentos
     1041            $pagarme_id1 = $mydata[0]['pagarme_id'];
     1042            $pagarme_id2 = $mydata[1]['pagarme_id'];
     1043            if ($pagarme_id1 && $pagarme_id2) {
     1044                $table_name = $wpdb->prefix.'pagarme_module_core_transaction';
     1045                $mytransaction1 = $wpdb->get_results("SELECT * FROM $table_name WHERE charge_id = '$pagarme_id1'", ARRAY_A);
     1046                $mytransaction2 = $wpdb->get_results("SELECT * FROM $table_name WHERE charge_id = '$pagarme_id2'", ARRAY_A);
     1047                $trans1 = $mytransaction1[0]['transaction_data']; //['card_data'];
     1048                $trans2 = $mytransaction2[0]['transaction_data'];
     1049                $trans1 = json_decode($trans1, true);
     1050                $trans2 = json_decode($trans2, true);
     1051
     1052                $card1 = $trans1['card'];
     1053                $card1Bin = $card1['first_six_digits'];
     1054                $card1Insta = $trans1['installments'];
     1055                $card1Amount = $trans1['amount'];
     1056                $tmp = array();
     1057                $tmp['bin'] = $card1Bin;
     1058                $tmp['end'] = $card1['last_four_digits'];
     1059                $tmp['validity'] = $card1['exp_month'] . "/" . $card1['exp_year'];
     1060                $tmp['install'] = $card1Insta;
     1061                $tmp['amount'] = $card1Amount;
     1062                $tmp['owner'] = $card1['holder_name'];
     1063                $tmp['billing_address'] = $card1['billing_address'];
     1064                $retorno[] = $tmp;
     1065
     1066                $card2 = $trans2['card'];
     1067                $card2Bin = $card2['first_six_digits'];
     1068                $card2Insta = $trans2['installments'];
     1069                $card2Amount = $trans2['amount'];
     1070                $tmp = array();
     1071                $tmp['bin'] = $card2Bin;
     1072                $tmp['end'] = $card2['last_four_digits'];
     1073                $tmp['validity'] = $card2['exp_month'] . "/" . $card2['exp_year'];
     1074                $tmp['install'] = $card2Insta;
     1075                $tmp['amount'] = $card2Amount;
     1076                $tmp['owner'] = $card2['holder_name'];
     1077                $tmp['billing_address'] = $card2['billing_address'];
     1078                $retorno[] = $tmp;
     1079                //die("ret=".print_r($retorno,true));
     1080                /*
     1081                ret=Array (
     1082                [0] => Array ( [bin] => 545301 [end] => 6167 [validity] => 1/2032 [install] => 1 [amount] => 5645 [owner] => Joao Naosei
     1083                  [billing_address] => Array ( [street] => Rua Calixto da Mota [number] => 75 [zip_code] => 04117100 [neighborhood] => Vila Mariana [city] => Su00e3o Paulo [state] => SP [country] => BR [complement] => vila mariana [line_1] => 75,Rua Calixto da Mota,Vila Mariana [line_2] => vila mariana ) )
     1084                [1] => Array ( [bin] => 401200 [end] => 1112 [validity] => 1/2032 [install] => 1 [amount] => 5644 [owner] => alfredo teste
     1085                  [billing_address] => Array ( [street] => Rua Calixto da Mota [number] => 75 [zip_code] => 04117100 [neighborhood] => Vila Mariana [city] => Su00e3o Paulo [state] => SP [country] => BR [complement] => vila mariana [line_1] => 75,Rua Calixto da Mota,Vila Mariana [line_2] => vila mariana ) ) )
     1086                */
     1087                return $retorno;
     1088            }
     1089            return false;
     1090        } else {
     1091            // era para ter dados!!!
     1092            return false;
     1093        }
     1094        return false;
     1095    } // end of segundoCartaoPagarme
     1096
     1097    /**
    9721098     * Método para deixar apenas dígitos num número, usado para CPF e CNPJ
    9731099     * @param   string  $input  - Entrada com pontos, hifen, ou vírgulas
     
    11391265        //Rede API integration for WooCommerce - Webservice
    11401266        if (strstr($texto, "rede_credit")) return(1);  // modulo rede. rede-woocommerce 1.0.0
    1141         //Version 1.0 | By e.rede |  Deve ser novo, sai com: Tipo_pagamento: tipo=erede
    1142         if (strstr($texto, "erede")) return(1); // olhando o plugin parece ter apenas crédito
    11431267
    11441268        //Checkout Cielo for WooCommerce. Claudio Sanches 1.0.4, leva ao site da Cielo para pagar com crédito/debito/boleto, na volta
     
    11571281        //Integração de Pagamento Pagar-me pela Pagar-me Versão 2.0.14, agora 3.1.1
    11581282        // ver Clearsale_Total_Checkout:outrosMetodos - woo-pagarme-payments -  woo-pagarme-payments-billet woo-pagarme-payments-pix
    1159         // sai pix ou billet
     1283        // sai pix ou billet ou woo-pagarme-payments-2_cards
     1284        if (strstr($texto, "woo-pagarme-payments-2_cards")) return(1);
    11601285
    11611286        //Cielo Webservice API 3.0 - Jrossetto - inserido em 28/01/20
     
    11651290        if (strstr($texto, "paghiper")) return(2);
    11661291
     1292        //e.Rede - Webservice - e.Rede API - loja5 - apartir da V4.0 tem PIX, abaixo texto recolhido do primeguns
     1293        if (strstr($texto, "loja5_woo_novo_erede_pix")) return(27);
    11671294        //e.Rede - Webservice - e.Rede API - Cartão de Crédito - Versão 1.0 - http://www.loja5.com.br/
    11681295        if (strstr($texto, "loja5_woo_novo_erede_debito")) return(3);
     
    12441371        if (strstr($texto, "click2pay-pix")) return(27);
    12451372
    1246         if (strstr($texto, "pix")) return(27); // gerencianet sai por aqui
    1247         if (strstr($texto, "boleto")) return(2);
     1373        // PagBank Integrações (Ricardo Martins) Versão - 4.24.1 - 09/11/24
     1374        // pego o CC por outrosMetodo, aqui sai com boleto e pix
     1375
     1376        //Version 1.0 | By e.rede |  Deve ser novo, sai com: Tipo_pagamento: tipo=erede
     1377        if (strstr($texto, "erede")) return(1); // olhando o plugin parece ter apenas crédito
     1378
     1379        if (strstr($texto, "pix")) return(27); // saem aqui: gerencianet, pagbank RM
     1380        if (strstr($texto, "boleto")) return(2); // pagbank RM
    12481381        if (strstr($texto, "billet")) return(2);
    12491382        if (strstr($texto, "debito")) return(3);
     
    12681401    16  VALE
    12691402    27  PIX
     1403    28  Cashback
    12701404    1041    Cartão Presente Virtual
    12711405    4011    Cartão de Débito/Transferência Eletrônica (CD)
  • clearsale-total/tags/3.1.6/includes/class-clearsale-total-checkout.php

    r3135161 r3301026  
    443443
    444444    } // end of SendOrder
     445
     446    /**
     447    * Hook que vai ser colocado no woocommerce_thankyou para chamar Cs_total_resend_order.
     448    *
     449    * @param    string  $order_id   - @ pedido
     450    */
     451    public function Cs_total_resend_orders($order_id) {
     452 
     453        $tempo = 60; // um minuto
     454        $wl = new Clearsale_Total_Log('clearsale-total', CLEARSALE_TOTAL_VERSION);
     455        $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_orders: Verificar envio em " . ($tempo/60) . " minuto(s) do pedido=" . $order_id);
     456        $ret = wp_schedule_single_event(
     457            time() + $tempo, // after 1 minute
     458            'Cs_total_resend_order',
     459            array( $order_id )
     460        );
     461        if (!$ret) {
     462            $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_orders: Erro ao ativar wp_schedule_single_event!!");
     463        }
     464    } // end of Cs_total_resend_orders
     465
     466    /**
     467    * Metodo que vai inserir um pedido na CearSale após 60 segundo.
     468    * Se ele já foi inserido o SendOrder não faz nada.
     469    *
     470    * @param    string  $order_id   - @ pedido
     471    */
     472    public function Cs_total_resend_order($order_id) {
     473 
     474        $wl = new Clearsale_Total_Log('clearsale-total', CLEARSALE_TOTAL_VERSION);
     475        $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_order: Verificar se pedido " . $order_id . " já foi integrado!");
     476
     477        $order = wc_get_order($order_id);
     478        if( ! $order ) {
     479            return;
     480        }
     481
     482        // compatibilidade com HPOS
     483        $enviado = get_post_meta($order_id, 'cs_pedido_enviado', true);
     484        if (empty($enviado))
     485            $enviado = $order->get_meta('cs_pedido_enviado');
     486        if ($enviado == "SIM"){
     487            $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_order: Pedido já integrado!");
     488            return;
     489        }
     490        $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_order: Ainda não foi enviado, enviar agora!");
     491        $nada = null;
     492        if ($this->SendOrder($order_id, $nada, $order) > 1) {
     493            $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_order: Erro ao gravar pedido na ClearSale!!");
     494            return;
     495        }
     496       
     497    } // end of Cs_total_resend_order
    445498
    446499    /**
     
    647700            if (stristr($forma_pgto, "woo-pagarme-payments") || $forma_pgto == "Pagar.me") { // 9
    648701                // antes woo-pagarme-payments, depois Pagar.me agora woo-pagarme-payments-credit_card
    649                 //Integração de Pagamento Pagar-me pela Pagar-me Versão 2.0.14, agora 3.1.1
     702                //Integração de Pagamento Pagar-me pela Pagar-me Versão 2.0.14, agora 3.1.1, 3.5.0 com 2 cartoes
    650703
    651704                $body = get_post_meta($order_id, '_pagarme_response_data', true); // todos os dados da transação
     
    657710                if (empty($pay_metodo))
    658711                    $pay_metodo = $order->get_meta('_pagarme_payment_method');
    659                 if ("pix" === $pay_metodo){
     712                if ("pix" === $pay_metodo) {
    660713                    $cartao=array();
    661714                    return($cartao);
    662715                }
    663                 if ("billet" === $pay_metodo){
     716                if ("billet" === $pay_metodo) {
    664717                    $cartao=array();
    665718                    return($cartao);
     719                }
     720                if ("2_cards" === $pay_metodo) {
     721                    $cartao=array();
     722                    return($cartao);
     723                    // todo tratado dentro de Monta_pedido
    666724                }
    667725                if ($body == null) {
     
    724782            } // end of pagar-me da pagar-me
    725783
     784            if ($forma_pgto == "rm-pagbank-cc") { //13 = PagBank Integrações (Ricardo Martins) Versão - 4.24.1 - 09/11/24
     785                $c_bin = get_post_meta($order_id, '_pagbank_card_first_digits', true);
     786                if (empty($c_bin))
     787                    $c_bin = $order->get_meta('_pagbank_card_first_digits');
     788                if ($c_bin == null) {
     789                    $wl->write_log("Clearsale_Total_Checkout:outrosMetodos: Pedido " . $order_id .
     790                    " feito pelo PagBank (Ricardo Martins), sem post_meta... ");
     791                    return(-3);
     792                }
     793                $c_expm = get_post_meta($order_id, '_pagbank_card_exp_month', true); // 1
     794                if (empty($c_expm))
     795                    $c_expm = $order->get_meta('_pagbank_card_exp_month');
     796                $c_expy = get_post_meta($order_id, '_pagbank_card_exp_year', true);  // 2028
     797                if (empty($c_expy))
     798                    $c_expy = $order->get_meta('_pagbank_card_exp_year');
     799                if (strlen($c_expy)<4) $c_expy = "20" . $c_expy; // em 80 anos temos um erro!!
     800                $c_exp = $c_expm . "/" . $c_expy;
     801
     802                $c_name = get_post_meta($order_id, '_pagbank_card_holder_name', true);
     803                if (empty($c_name))
     804                    $c_name = $order->get_meta('_pagbank_card_holder_name');
     805                $c_instal = (int)get_post_meta($order_id, '_pagbank_card_installments', true); // 1 ou 2 ...
     806                if (empty($c_instal))
     807                    $c_instal = (int)$order->get_meta('_pagbank_card_installments');
     808                $c_last4 = get_post_meta($order_id, '_pagbank_card_last_digits', true);
     809                if (empty($c_last4))
     810                    $c_last4 = $order->get_meta('_pagbank_card_last_digits');
     811                $star = "000000"; //"******";
     812                $wl->write_log("Clearsale_Total_Checkout:outrosMetodos: Pedido " . $order_id .
     813                 " feito PagBank (Ricardo Martins) com " . $c_bin . "******" . $c_last4 . " nome:" . $c_name);
     814                $cartao = array(
     815                    'modo'          =>  'credito',
     816                    'numero'        =>  $c_bin . $star . $c_last4,
     817                    'bin'           =>  $c_bin,
     818                    'end'           =>  $c_last4,
     819                    'validity'      =>  $c_exp,
     820                    'installments'  =>  $c_instal,
     821                    'owner'         =>  $c_name,
     822                    'document'      =>  $cs_doc
     823                );
     824            } // end of rm-pagbank-cc
     825
     826
    726827        } // end of $cartao vazio
    727828        return($cartao);
  • clearsale-total/tags/3.1.6/includes/class-clearsale-total-deactivator.php

    r3050591 r3301026  
    5959            $error_message = $ret->get_error_message();
    6060            $wl->write_log("Deactivate: erro no wp_remote_post: " . print_r($error_message,true));
    61             //syslog(LOG_WARNING, "Something went wrong:" . $error_message);
    6261        } else {
    6362            $response = $ret['response'];
     
    6968            }
    7069            //$wl->write_log("Activate: sucesso" . print_r($ret,true));
    71             //syslog(LOG_WARNING,"sucesso:" . print_r($ret,true));
    7270        }
    7371    }
  • clearsale-total/tags/3.1.6/includes/class-clearsale-total-footer.php

    r3135161 r3301026  
    110110        $this->session_id = (string)$tmp1 . "_" . $t_tail;
    111111        //$tmp2 = $woocommerce->session->get('cs_session_id');
    112         $this->wl->write_log("Clearsale_footer:cs_total_Add_Js: session_id=" . $this->session_id);
     112        //$this->wl->write_log("Clearsale_footer:cs_total_Add_Js: session_id=" . $this->session_id);
    113113        $woocommerce->session->set('cs_session_id', $this->session_id);
    114114       
  • clearsale-total/tags/3.1.6/includes/class-clearsale-total-requirements.php

    r2971562 r3301026  
    124124
    125125        $err_results = $extensions = array();
    126         //syslog(LOG_WARNING,"require entrou...");
    127126        if (empty( $requirements ) || ! is_array( $requirements )) {
    128127            trigger_error( __('WP Requirements: the requirements are invalid.', "clearsale-total"), E_USER_ERROR );
  • clearsale-total/tags/3.1.6/includes/class-clearsale-total.php

    r3050591 r3301026  
    2727 * @author     Letti Tecnologia <contato@letti.com.br>
    2828 * @date       20/07/2019
    29  * @copyright  1996-2021 - Letti Tecnologia
     29 * @copyright  1996-2025 - Letti Tecnologia
    3030 */
    3131class Clearsale_Total
     
    334334        $this->loader->add_action('woocommerce_checkout_order_processed', $plugin_checkout, 'Cs_total_checkout_order_processed', 10, 3);
    335335        $this->loader->add_action('woocommerce_thankyou', $plugin_checkout, 'Cs_total_thankyou', 20, 1);
     336        $this->loader->add_action('woocommerce_thankyou', $plugin_checkout, 'Cs_total_resend_orders', 20, 1);
     337        // registra webhook, o wp_schedule_single_event só com webhooks
     338        $this->loader->add_action('Cs_total_resend_order', $plugin_checkout, 'Cs_total_resend_order', 20, 1);
    336339        $this->loader->add_action('woocommerce_before_thankyou', $plugin_checkout, 'Cs_total_before_thankyou', 10, 1);
    337340        $this->loader->add_action('woocommerce_payment_complete', $plugin_checkout, 'Cs_total_payment_complete', 10, 3);
  • clearsale-total/tags/3.1.6/includes/index.php

    r2971562 r3301026  
    1 <?php // Silence is golden
     1<?php // Silence is golden 
  • clearsale-total/trunk/CHANGELOG.md

    r3135161 r3301026  
     1## [3.1.6] - 2025-03-26
     2
     3### Added
     4- Adicionado Pagar.me com dois cartões
     5- Adicionado wp_schedule_single_event para verificar se o pedido foi integrado.
     6
     7
     8## [3.1.5] - 2024-11-11
     9
     10### Added
     11- Adicionado método PagBank Integrações (Ricardo Martins) Versão - 4.24.1
     12
     13### Fixed
     14- Arrumado forma de pegar texto do nome erede_pix do loja5
     15
     16
     17## [3.1.4] - 2024-10-25
     18
     19### Added
     20- Adicionado PIX no método do eRede loja5
     21
     22
    123## [3.1.3] - 2024-08-05
    224
     
    3557
    3658### Added
    37 - Método PayPal mas sem dados de cartão.
     59- Método PaylPal mas sem dados de cartão.
    3860
    3961
  • clearsale-total/trunk/README.txt

    r3135161 r3301026  
    44Tags:  fraud, fraud protection, prevent fake orders, e-commerce, woocommerce, sell, store, loja virtual, shop, clearsale, antifraude, análise por inteligência artificial, equipe de detecção de fraude, cartão de crédito
    55Requires at least: 5.0
    6 Tested up to: 6.6
    7 Stable tag: 3.1.3
     6Tested up to: 6.8
     7Stable tag: 3.1.6
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    1111
    1212Integração do WooCommerce com a ClearSale.
    13 testado: wordpress 6.6
    14 woocommerce 9.1
     13testado: wordpress 6.8
     14woocommerce 9.8
    1515Requisitos:
    1616php 5.6 ou maior
     
    8181
    8282== Changelog ==
     83## [3.1.6] - 2025-03-26
     84
     85### Added
     86- Adicionado Pagar.me com dois cartões
     87- Adicionado wp_schedule_single_event para verificar se o pedido foi integrado.
     88
     89
     90## [3.1.5] - 2024-11-11
     91
     92### Added
     93- Adicionado método PagBank Integrações (Ricardo Martins) Versão - 4.24.1
     94
     95
     96## [3.1.4] - 2024-10-25
     97
     98### Added
     99- Adicionado PIX no método do eRede loja5
     100
     101
    83102## [3.1.3] - 2024-08-05
    84103
     
    129148
    130149
    131 ## [3.0.17] - 2023-08-03
    132 ### Added
    133 - Acionado webhook de novo status após aprovação.
    134 - Melhorias nas mensagens de depuração.
    135 
    136 ### Changed
    137 - Só altera para inanalisis se status anterior for NVO.
    138150
    139151
  • clearsale-total/trunk/admin/class-clearsale-total-admin.php

    r3135161 r3301026  
    328328
    329329        <?php
    330        
     330
    331331    } // end of cs_total_render_order_resent
    332332
  • clearsale-total/trunk/clearsale-total.php

    r3135161 r3301026  
    1818 * Plugin URI:        https://api.clearsale.com.br/docs/plugins/wooCommerce/totalTotalGarantidoApplication
    1919 * Description:       Integração da loja WooCommerce e a ClearSale Total. Segurança para suas vendas.
    20  * Version:           3.1.3
     20 * Version:           3.1.6
    2121 * Author:            ClearSale
    2222 * Author URI:        https://br.clear.sale
     
    5858 * Rename this for your plugin and update it as you release new versions.
    5959 */
    60 define('CLEARSALE_TOTAL_VERSION', '3.1.3');
     60define('CLEARSALE_TOTAL_VERSION', '3.1.6');
    6161
    6262/**
  • clearsale-total/trunk/includes/class-clearsale-total-activator.php

    r3050591 r3301026  
    124124            $error_message = $ret->get_error_message();
    125125            $wl->write_log("Activate: erro no wp_remote_post: " . print_r($error_message,true));
    126             //syslog(LOG_WARNING, "Something went wrong:" . $error_message);
    127126        } else {
    128127            $response = $ret['response'];
     
    134133            }
    135134            //$wl->write_log("Activate: sucesso" . print_r($ret,true));
    136             //syslog(LOG_WARNING,"sucesso:" . print_r($ret,true));
    137135        }
    138136        /* O retorna no $ret acima:
  • clearsale-total/trunk/includes/class-clearsale-total-ajax.php

    r3135161 r3301026  
    293293                // compatibilidade com HPOS
    294294                $order = new WC_Order($pedido);
    295                 $order->update_meta_data('cs_cartao', $cartao);
    296                 $order->save();
     295                $order->update_meta_data('cs_cartao', $cartao);
     296                $order->save();
    297297                $wl->write_log("Clearsale_Total_Ajax: clearsale_total_push: Pedido " . $pedido . ", pago com "
    298298                 . $cartao['modo'] . " dados salvo para posterior inserção na ClearSale");
  • clearsale-total/trunk/includes/class-clearsale-total-api.php

    r3135161 r3301026  
    545545
    546546        $this->wl->write_log("Monta_pedido: entrou, #doc=" . $cs_doc . " e-mail=" . $email);
    547 //$this->wl->write_log("Monta_pedido: order_data=" . print_r($order_data,true));
    548547
    549548        if ($cartao == "" || count($cartao) < 1) { // qdo vindo do checkout nao temos # cartao, apenas vindo do ajax
     
    728727                                    'reference' => ''
    729728                                    ),
    730 /* como nao tem dados o Joelson pediu para tirar - email 3/12/18
     729                /* como nao tem dados o Joelson pediu para tirar - email 3/12/18
    731730                'phones'            => array(
    732731                                    array(
     
    753752            'document'      =>  $cpf            );
    754753            */
    755             $tmp_payments = array();
     754            $tmp_payments = array();  // sempre para o 1ro cartao
     755            $tmp_payments2 = array(); // qdo temos o 2do cartao, por hora só o Pagar.me
    756756            $tipo_pgto = $this->Tipo_pagamento($order_data['payment_method']); // pag 18
    757757            if ("checkout-cielo" === $order_data['payment_method']) {
     
    793793                }
    794794            }
    795             if ("Pagar.me" === $order_data['payment_method']) {
     795            if ("Pagar.me" === $order_data['payment_method'] || "woo-pagarme-payments-2_cards" === $order_data['payment_method']) {
    796796                $tmp = get_post_meta($order_data['id'], "_pagarme_payment_method", true);
    797797                if (empty($tmp))
     
    799799                /* _pagarme_payment_method = billet
    800800                   _pagarme_payment_method = credit_card
     801                   _pagarme_payment_method = 2_cards
    801802                   _pagarme_payment_method = pix
     803                   _payment_method  = woo-pagarme-payments-2_cards
     804                   Tipo_pagamento: tipo=woo-pagarme-payments-2_cards
    802805                */
     806                if ("2_cards" == $tmp) { // tratar 2 cartoes aqui, nao pega nada em outrosMetodos
     807                    $cartoes = $this->segundoCartaoPagarme($order_data['id']);
     808                    $cartao['modo'] = "";
     809                    if ($cartoes) {
     810                        $seq = 0;
     811                        foreach($cartoes as $umcart) {
     812                            $seq++;
     813                            $inteiro = substr($umcart['amount'],0,-2);
     814                            if ($inteiro == "") $inteiro="0";
     815                            $amount = $inteiro . "." . substr($umcart['amount'], -2);
     816                            $star="******";
     817                            $cartao_array = array(
     818                                'number'    =>  $umcart['bin'] . $star . $umcart['end'],
     819                                'hash'      =>  '',
     820                                'bin'       =>  $umcart['bin'],
     821                                'end'       =>  $umcart['end'],
     822                                'type'      =>  $this->Bandeira_Cartao($umcart['bin'] . $star . $umcart['end']),
     823                                'validityDate' =>   $umcart['validity'],
     824                                'ownerName' =>  $umcart['owner'],
     825                                'document'  =>  $cs_doc,
     826                                'nsu'       =>  ''
     827                            );
     828                            $bill = $umcart['billing_address'];
     829                            $tmp_payments2[] = array(
     830                                'sequential'        =>  $seq,
     831                                'date'              =>  $order_data['date_created']->date('c'),
     832                                'value'             =>  (float)$amount,
     833                                'type'              =>  1, // credito
     834                                'installments'      =>  $umcart['install'],
     835                                'interestRate'      =>  0,
     836                                'interestValue'     =>  0,
     837                                'currency'          =>  $this->Tipo_moeda($order_data['currency']), // pag 25
     838                                'voucherOrderOrigin'=>  '',
     839                                'card'              =>  $cartao_array,
     840                                'address'           =>  array(
     841                                                    'street'    =>  $bill['street'],
     842                                                    'number'    =>  $bill['number'],
     843                                                    'additionalInformation' =>  '',
     844                                                    'county'    =>  $bill['neighborhood'],
     845                                                    'city'      =>  $bill['city'],
     846                                                    'state'     =>  $bill['state'],
     847                                                    'zipcode'   =>  $bill['zip_code'],
     848                                                    'country'   =>  $bill['country'],
     849                                                    'reference' =>  ''
     850                                                    )
     851                            );
     852                        }
     853                    }
     854                }
    803855                if ("billet" === $tmp) {
    804856                    $tipo_pgto = $this->Tipo_pagamento("boleto");
     
    857909                                    )
    858910            );
    859             $header['payments'] = $tmp_payments;
     911            if (count($tmp_payments2) <= 0) {
     912                $header['payments'] = $tmp_payments;
     913            } else {
     914                $header['payments'] = $tmp_payments2;
     915            }
    860916
    861917            // Items - deve ser array de itens - $items = $order->get_items()
     
    9701026
    9711027    /**
     1028     * Método para pegar segundo cartao do Pagar.me
     1029     * @param   string  $pedido - Número do pedido
     1030     * @return  array|false Caso de erro ou array com dados dos dois cartoes
     1031     */
     1032    public function segundoCartaoPagarme($pedido)
     1033    {
     1034        global $wpdb;
     1035       
     1036        $retorno = array();
     1037        $table_name = $wpdb->prefix.'pagarme_module_core_charge';
     1038        $mydata = $wpdb->get_results("SELECT * FROM $table_name WHERE code = '$pedido'", ARRAY_A);
     1039        if ($mydata) {
     1040            // retorna um arrai com duas posicoes, dos dois pagamentos
     1041            $pagarme_id1 = $mydata[0]['pagarme_id'];
     1042            $pagarme_id2 = $mydata[1]['pagarme_id'];
     1043            if ($pagarme_id1 && $pagarme_id2) {
     1044                $table_name = $wpdb->prefix.'pagarme_module_core_transaction';
     1045                $mytransaction1 = $wpdb->get_results("SELECT * FROM $table_name WHERE charge_id = '$pagarme_id1'", ARRAY_A);
     1046                $mytransaction2 = $wpdb->get_results("SELECT * FROM $table_name WHERE charge_id = '$pagarme_id2'", ARRAY_A);
     1047                $trans1 = $mytransaction1[0]['transaction_data']; //['card_data'];
     1048                $trans2 = $mytransaction2[0]['transaction_data'];
     1049                $trans1 = json_decode($trans1, true);
     1050                $trans2 = json_decode($trans2, true);
     1051
     1052                $card1 = $trans1['card'];
     1053                $card1Bin = $card1['first_six_digits'];
     1054                $card1Insta = $trans1['installments'];
     1055                $card1Amount = $trans1['amount'];
     1056                $tmp = array();
     1057                $tmp['bin'] = $card1Bin;
     1058                $tmp['end'] = $card1['last_four_digits'];
     1059                $tmp['validity'] = $card1['exp_month'] . "/" . $card1['exp_year'];
     1060                $tmp['install'] = $card1Insta;
     1061                $tmp['amount'] = $card1Amount;
     1062                $tmp['owner'] = $card1['holder_name'];
     1063                $tmp['billing_address'] = $card1['billing_address'];
     1064                $retorno[] = $tmp;
     1065
     1066                $card2 = $trans2['card'];
     1067                $card2Bin = $card2['first_six_digits'];
     1068                $card2Insta = $trans2['installments'];
     1069                $card2Amount = $trans2['amount'];
     1070                $tmp = array();
     1071                $tmp['bin'] = $card2Bin;
     1072                $tmp['end'] = $card2['last_four_digits'];
     1073                $tmp['validity'] = $card2['exp_month'] . "/" . $card2['exp_year'];
     1074                $tmp['install'] = $card2Insta;
     1075                $tmp['amount'] = $card2Amount;
     1076                $tmp['owner'] = $card2['holder_name'];
     1077                $tmp['billing_address'] = $card2['billing_address'];
     1078                $retorno[] = $tmp;
     1079                //die("ret=".print_r($retorno,true));
     1080                /*
     1081                ret=Array (
     1082                [0] => Array ( [bin] => 545301 [end] => 6167 [validity] => 1/2032 [install] => 1 [amount] => 5645 [owner] => Joao Naosei
     1083                  [billing_address] => Array ( [street] => Rua Calixto da Mota [number] => 75 [zip_code] => 04117100 [neighborhood] => Vila Mariana [city] => Su00e3o Paulo [state] => SP [country] => BR [complement] => vila mariana [line_1] => 75,Rua Calixto da Mota,Vila Mariana [line_2] => vila mariana ) )
     1084                [1] => Array ( [bin] => 401200 [end] => 1112 [validity] => 1/2032 [install] => 1 [amount] => 5644 [owner] => alfredo teste
     1085                  [billing_address] => Array ( [street] => Rua Calixto da Mota [number] => 75 [zip_code] => 04117100 [neighborhood] => Vila Mariana [city] => Su00e3o Paulo [state] => SP [country] => BR [complement] => vila mariana [line_1] => 75,Rua Calixto da Mota,Vila Mariana [line_2] => vila mariana ) ) )
     1086                */
     1087                return $retorno;
     1088            }
     1089            return false;
     1090        } else {
     1091            // era para ter dados!!!
     1092            return false;
     1093        }
     1094        return false;
     1095    } // end of segundoCartaoPagarme
     1096
     1097    /**
    9721098     * Método para deixar apenas dígitos num número, usado para CPF e CNPJ
    9731099     * @param   string  $input  - Entrada com pontos, hifen, ou vírgulas
     
    11391265        //Rede API integration for WooCommerce - Webservice
    11401266        if (strstr($texto, "rede_credit")) return(1);  // modulo rede. rede-woocommerce 1.0.0
    1141         //Version 1.0 | By e.rede |  Deve ser novo, sai com: Tipo_pagamento: tipo=erede
    1142         if (strstr($texto, "erede")) return(1); // olhando o plugin parece ter apenas crédito
    11431267
    11441268        //Checkout Cielo for WooCommerce. Claudio Sanches 1.0.4, leva ao site da Cielo para pagar com crédito/debito/boleto, na volta
     
    11571281        //Integração de Pagamento Pagar-me pela Pagar-me Versão 2.0.14, agora 3.1.1
    11581282        // ver Clearsale_Total_Checkout:outrosMetodos - woo-pagarme-payments -  woo-pagarme-payments-billet woo-pagarme-payments-pix
    1159         // sai pix ou billet
     1283        // sai pix ou billet ou woo-pagarme-payments-2_cards
     1284        if (strstr($texto, "woo-pagarme-payments-2_cards")) return(1);
    11601285
    11611286        //Cielo Webservice API 3.0 - Jrossetto - inserido em 28/01/20
     
    11651290        if (strstr($texto, "paghiper")) return(2);
    11661291
     1292        //e.Rede - Webservice - e.Rede API - loja5 - apartir da V4.0 tem PIX, abaixo texto recolhido do primeguns
     1293        if (strstr($texto, "loja5_woo_novo_erede_pix")) return(27);
    11671294        //e.Rede - Webservice - e.Rede API - Cartão de Crédito - Versão 1.0 - http://www.loja5.com.br/
    11681295        if (strstr($texto, "loja5_woo_novo_erede_debito")) return(3);
     
    12441371        if (strstr($texto, "click2pay-pix")) return(27);
    12451372
    1246         if (strstr($texto, "pix")) return(27); // gerencianet sai por aqui
    1247         if (strstr($texto, "boleto")) return(2);
     1373        // PagBank Integrações (Ricardo Martins) Versão - 4.24.1 - 09/11/24
     1374        // pego o CC por outrosMetodo, aqui sai com boleto e pix
     1375
     1376        //Version 1.0 | By e.rede |  Deve ser novo, sai com: Tipo_pagamento: tipo=erede
     1377        if (strstr($texto, "erede")) return(1); // olhando o plugin parece ter apenas crédito
     1378
     1379        if (strstr($texto, "pix")) return(27); // saem aqui: gerencianet, pagbank RM
     1380        if (strstr($texto, "boleto")) return(2); // pagbank RM
    12481381        if (strstr($texto, "billet")) return(2);
    12491382        if (strstr($texto, "debito")) return(3);
     
    12681401    16  VALE
    12691402    27  PIX
     1403    28  Cashback
    12701404    1041    Cartão Presente Virtual
    12711405    4011    Cartão de Débito/Transferência Eletrônica (CD)
  • clearsale-total/trunk/includes/class-clearsale-total-checkout.php

    r3135161 r3301026  
    443443
    444444    } // end of SendOrder
     445
     446    /**
     447    * Hook que vai ser colocado no woocommerce_thankyou para chamar Cs_total_resend_order.
     448    *
     449    * @param    string  $order_id   - @ pedido
     450    */
     451    public function Cs_total_resend_orders($order_id) {
     452 
     453        $tempo = 60; // um minuto
     454        $wl = new Clearsale_Total_Log('clearsale-total', CLEARSALE_TOTAL_VERSION);
     455        $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_orders: Verificar envio em " . ($tempo/60) . " minuto(s) do pedido=" . $order_id);
     456        $ret = wp_schedule_single_event(
     457            time() + $tempo, // after 1 minute
     458            'Cs_total_resend_order',
     459            array( $order_id )
     460        );
     461        if (!$ret) {
     462            $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_orders: Erro ao ativar wp_schedule_single_event!!");
     463        }
     464    } // end of Cs_total_resend_orders
     465
     466    /**
     467    * Metodo que vai inserir um pedido na CearSale após 60 segundo.
     468    * Se ele já foi inserido o SendOrder não faz nada.
     469    *
     470    * @param    string  $order_id   - @ pedido
     471    */
     472    public function Cs_total_resend_order($order_id) {
     473 
     474        $wl = new Clearsale_Total_Log('clearsale-total', CLEARSALE_TOTAL_VERSION);
     475        $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_order: Verificar se pedido " . $order_id . " já foi integrado!");
     476
     477        $order = wc_get_order($order_id);
     478        if( ! $order ) {
     479            return;
     480        }
     481
     482        // compatibilidade com HPOS
     483        $enviado = get_post_meta($order_id, 'cs_pedido_enviado', true);
     484        if (empty($enviado))
     485            $enviado = $order->get_meta('cs_pedido_enviado');
     486        if ($enviado == "SIM"){
     487            $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_order: Pedido já integrado!");
     488            return;
     489        }
     490        $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_order: Ainda não foi enviado, enviar agora!");
     491        $nada = null;
     492        if ($this->SendOrder($order_id, $nada, $order) > 1) {
     493            $wl->write_log("Clearsale_Total_Checkout:Cs_total_resend_order: Erro ao gravar pedido na ClearSale!!");
     494            return;
     495        }
     496       
     497    } // end of Cs_total_resend_order
    445498
    446499    /**
     
    647700            if (stristr($forma_pgto, "woo-pagarme-payments") || $forma_pgto == "Pagar.me") { // 9
    648701                // antes woo-pagarme-payments, depois Pagar.me agora woo-pagarme-payments-credit_card
    649                 //Integração de Pagamento Pagar-me pela Pagar-me Versão 2.0.14, agora 3.1.1
     702                //Integração de Pagamento Pagar-me pela Pagar-me Versão 2.0.14, agora 3.1.1, 3.5.0 com 2 cartoes
    650703
    651704                $body = get_post_meta($order_id, '_pagarme_response_data', true); // todos os dados da transação
     
    657710                if (empty($pay_metodo))
    658711                    $pay_metodo = $order->get_meta('_pagarme_payment_method');
    659                 if ("pix" === $pay_metodo){
     712                if ("pix" === $pay_metodo) {
    660713                    $cartao=array();
    661714                    return($cartao);
    662715                }
    663                 if ("billet" === $pay_metodo){
     716                if ("billet" === $pay_metodo) {
    664717                    $cartao=array();
    665718                    return($cartao);
     719                }
     720                if ("2_cards" === $pay_metodo) {
     721                    $cartao=array();
     722                    return($cartao);
     723                    // todo tratado dentro de Monta_pedido
    666724                }
    667725                if ($body == null) {
     
    724782            } // end of pagar-me da pagar-me
    725783
     784            if ($forma_pgto == "rm-pagbank-cc") { //13 = PagBank Integrações (Ricardo Martins) Versão - 4.24.1 - 09/11/24
     785                $c_bin = get_post_meta($order_id, '_pagbank_card_first_digits', true);
     786                if (empty($c_bin))
     787                    $c_bin = $order->get_meta('_pagbank_card_first_digits');
     788                if ($c_bin == null) {
     789                    $wl->write_log("Clearsale_Total_Checkout:outrosMetodos: Pedido " . $order_id .
     790                    " feito pelo PagBank (Ricardo Martins), sem post_meta... ");
     791                    return(-3);
     792                }
     793                $c_expm = get_post_meta($order_id, '_pagbank_card_exp_month', true); // 1
     794                if (empty($c_expm))
     795                    $c_expm = $order->get_meta('_pagbank_card_exp_month');
     796                $c_expy = get_post_meta($order_id, '_pagbank_card_exp_year', true);  // 2028
     797                if (empty($c_expy))
     798                    $c_expy = $order->get_meta('_pagbank_card_exp_year');
     799                if (strlen($c_expy)<4) $c_expy = "20" . $c_expy; // em 80 anos temos um erro!!
     800                $c_exp = $c_expm . "/" . $c_expy;
     801
     802                $c_name = get_post_meta($order_id, '_pagbank_card_holder_name', true);
     803                if (empty($c_name))
     804                    $c_name = $order->get_meta('_pagbank_card_holder_name');
     805                $c_instal = (int)get_post_meta($order_id, '_pagbank_card_installments', true); // 1 ou 2 ...
     806                if (empty($c_instal))
     807                    $c_instal = (int)$order->get_meta('_pagbank_card_installments');
     808                $c_last4 = get_post_meta($order_id, '_pagbank_card_last_digits', true);
     809                if (empty($c_last4))
     810                    $c_last4 = $order->get_meta('_pagbank_card_last_digits');
     811                $star = "000000"; //"******";
     812                $wl->write_log("Clearsale_Total_Checkout:outrosMetodos: Pedido " . $order_id .
     813                 " feito PagBank (Ricardo Martins) com " . $c_bin . "******" . $c_last4 . " nome:" . $c_name);
     814                $cartao = array(
     815                    'modo'          =>  'credito',
     816                    'numero'        =>  $c_bin . $star . $c_last4,
     817                    'bin'           =>  $c_bin,
     818                    'end'           =>  $c_last4,
     819                    'validity'      =>  $c_exp,
     820                    'installments'  =>  $c_instal,
     821                    'owner'         =>  $c_name,
     822                    'document'      =>  $cs_doc
     823                );
     824            } // end of rm-pagbank-cc
     825
     826
    726827        } // end of $cartao vazio
    727828        return($cartao);
  • clearsale-total/trunk/includes/class-clearsale-total-deactivator.php

    r3050591 r3301026  
    5959            $error_message = $ret->get_error_message();
    6060            $wl->write_log("Deactivate: erro no wp_remote_post: " . print_r($error_message,true));
    61             //syslog(LOG_WARNING, "Something went wrong:" . $error_message);
    6261        } else {
    6362            $response = $ret['response'];
     
    6968            }
    7069            //$wl->write_log("Activate: sucesso" . print_r($ret,true));
    71             //syslog(LOG_WARNING,"sucesso:" . print_r($ret,true));
    7270        }
    7371    }
  • clearsale-total/trunk/includes/class-clearsale-total-footer.php

    r3135161 r3301026  
    110110        $this->session_id = (string)$tmp1 . "_" . $t_tail;
    111111        //$tmp2 = $woocommerce->session->get('cs_session_id');
    112         $this->wl->write_log("Clearsale_footer:cs_total_Add_Js: session_id=" . $this->session_id);
     112        //$this->wl->write_log("Clearsale_footer:cs_total_Add_Js: session_id=" . $this->session_id);
    113113        $woocommerce->session->set('cs_session_id', $this->session_id);
    114114       
  • clearsale-total/trunk/includes/class-clearsale-total-requirements.php

    r2971562 r3301026  
    124124
    125125        $err_results = $extensions = array();
    126         //syslog(LOG_WARNING,"require entrou...");
    127126        if (empty( $requirements ) || ! is_array( $requirements )) {
    128127            trigger_error( __('WP Requirements: the requirements are invalid.', "clearsale-total"), E_USER_ERROR );
  • clearsale-total/trunk/includes/class-clearsale-total.php

    r3050591 r3301026  
    2727 * @author     Letti Tecnologia <contato@letti.com.br>
    2828 * @date       20/07/2019
    29  * @copyright  1996-2021 - Letti Tecnologia
     29 * @copyright  1996-2025 - Letti Tecnologia
    3030 */
    3131class Clearsale_Total
     
    334334        $this->loader->add_action('woocommerce_checkout_order_processed', $plugin_checkout, 'Cs_total_checkout_order_processed', 10, 3);
    335335        $this->loader->add_action('woocommerce_thankyou', $plugin_checkout, 'Cs_total_thankyou', 20, 1);
     336        $this->loader->add_action('woocommerce_thankyou', $plugin_checkout, 'Cs_total_resend_orders', 20, 1);
     337        // registra webhook, o wp_schedule_single_event só com webhooks
     338        $this->loader->add_action('Cs_total_resend_order', $plugin_checkout, 'Cs_total_resend_order', 20, 1);
    336339        $this->loader->add_action('woocommerce_before_thankyou', $plugin_checkout, 'Cs_total_before_thankyou', 10, 1);
    337340        $this->loader->add_action('woocommerce_payment_complete', $plugin_checkout, 'Cs_total_payment_complete', 10, 3);
  • clearsale-total/trunk/includes/index.php

    r2971562 r3301026  
    1 <?php // Silence is golden
     1<?php // Silence is golden 
Note: See TracChangeset for help on using the changeset viewer.