Changeset 3301026
- Timestamp:
- 05/26/2025 11:10:50 PM (10 months ago)
- Location:
- clearsale-total
- Files:
-
- 15 edited
- 16 copied
-
tags/3.1.6 (copied) (copied from clearsale-total/trunk)
-
tags/3.1.6/CHANGELOG.md (copied) (copied from clearsale-total/trunk/CHANGELOG.md) (2 diffs)
-
tags/3.1.6/README.txt (copied) (copied from clearsale-total/trunk/README.txt) (4 diffs)
-
tags/3.1.6/admin/class-clearsale-total-admin.php (copied) (copied from clearsale-total/trunk/admin/class-clearsale-total-admin.php) (1 diff)
-
tags/3.1.6/clearsale-total.php (copied) (copied from clearsale-total/trunk/clearsale-total.php) (2 diffs)
-
tags/3.1.6/includes/class-clearsale-total-activator.php (copied) (copied from clearsale-total/trunk/includes/class-clearsale-total-activator.php) (2 diffs)
-
tags/3.1.6/includes/class-clearsale-total-ajax.php (copied) (copied from clearsale-total/trunk/includes/class-clearsale-total-ajax.php) (1 diff)
-
tags/3.1.6/includes/class-clearsale-total-api.php (copied) (copied from clearsale-total/trunk/includes/class-clearsale-total-api.php) (12 diffs)
-
tags/3.1.6/includes/class-clearsale-total-checkout.php (copied) (copied from clearsale-total/trunk/includes/class-clearsale-total-checkout.php) (4 diffs)
-
tags/3.1.6/includes/class-clearsale-total-deactivator.php (copied) (copied from clearsale-total/trunk/includes/class-clearsale-total-deactivator.php) (2 diffs)
-
tags/3.1.6/includes/class-clearsale-total-extrafields.php (copied) (copied from clearsale-total/trunk/includes/class-clearsale-total-extrafields.php)
-
tags/3.1.6/includes/class-clearsale-total-footer.php (copied) (copied from clearsale-total/trunk/includes/class-clearsale-total-footer.php) (1 diff)
-
tags/3.1.6/includes/class-clearsale-total-requirements.php (modified) (1 diff)
-
tags/3.1.6/includes/class-clearsale-total-status.php (copied) (copied from clearsale-total/trunk/includes/class-clearsale-total-status.php)
-
tags/3.1.6/includes/class-clearsale-total.php (copied) (copied from clearsale-total/trunk/includes/class-clearsale-total.php) (2 diffs)
-
tags/3.1.6/includes/index.php (modified) (1 diff)
-
tags/3.1.6/public/js/clearsale-total-public-txt.php (copied) (copied from clearsale-total/trunk/public/js/clearsale-total-public-txt.php)
-
tags/3.1.6/public/js/clearsale-total-public.js (copied) (copied from clearsale-total/trunk/public/js/clearsale-total-public.js)
-
trunk/CHANGELOG.md (modified) (2 diffs)
-
trunk/README.txt (modified) (4 diffs)
-
trunk/admin/class-clearsale-total-admin.php (modified) (1 diff)
-
trunk/clearsale-total.php (modified) (2 diffs)
-
trunk/includes/class-clearsale-total-activator.php (modified) (2 diffs)
-
trunk/includes/class-clearsale-total-ajax.php (modified) (1 diff)
-
trunk/includes/class-clearsale-total-api.php (modified) (12 diffs)
-
trunk/includes/class-clearsale-total-checkout.php (modified) (4 diffs)
-
trunk/includes/class-clearsale-total-deactivator.php (modified) (2 diffs)
-
trunk/includes/class-clearsale-total-footer.php (modified) (1 diff)
-
trunk/includes/class-clearsale-total-requirements.php (modified) (1 diff)
-
trunk/includes/class-clearsale-total.php (modified) (2 diffs)
-
trunk/includes/index.php (modified) (1 diff)
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 1 23 ## [3.1.3] - 2024-08-05 2 24 … … 35 57 36 58 ### Added 37 - Método Pay Pal mas sem dados de cartão.59 - Método PaylPal mas sem dados de cartão. 38 60 39 61 -
clearsale-total/tags/3.1.6/README.txt
r3135161 r3301026 4 4 Tags: 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 5 5 Requires at least: 5.0 6 Tested up to: 6. 67 Stable tag: 3.1. 36 Tested up to: 6.8 7 Stable tag: 3.1.6 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 11 11 12 12 Integração do WooCommerce com a ClearSale. 13 testado: wordpress 6. 614 woocommerce 9. 113 testado: wordpress 6.8 14 woocommerce 9.8 15 15 Requisitos: 16 16 php 5.6 ou maior … … 81 81 82 82 == 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 83 102 ## [3.1.3] - 2024-08-05 84 103 … … 129 148 130 149 131 ## [3.0.17] - 2023-08-03132 ### Added133 - Acionado webhook de novo status após aprovação.134 - Melhorias nas mensagens de depuração.135 136 ### Changed137 - Só altera para inanalisis se status anterior for NVO.138 150 139 151 -
clearsale-total/tags/3.1.6/admin/class-clearsale-total-admin.php
r3135161 r3301026 328 328 329 329 <?php 330 330 331 331 } // end of cs_total_render_order_resent 332 332 -
clearsale-total/tags/3.1.6/clearsale-total.php
r3135161 r3301026 18 18 * Plugin URI: https://api.clearsale.com.br/docs/plugins/wooCommerce/totalTotalGarantidoApplication 19 19 * Description: Integração da loja WooCommerce e a ClearSale Total. Segurança para suas vendas. 20 * Version: 3.1. 320 * Version: 3.1.6 21 21 * Author: ClearSale 22 22 * Author URI: https://br.clear.sale … … 58 58 * Rename this for your plugin and update it as you release new versions. 59 59 */ 60 define('CLEARSALE_TOTAL_VERSION', '3.1. 3');60 define('CLEARSALE_TOTAL_VERSION', '3.1.6'); 61 61 62 62 /** -
clearsale-total/tags/3.1.6/includes/class-clearsale-total-activator.php
r3050591 r3301026 124 124 $error_message = $ret->get_error_message(); 125 125 $wl->write_log("Activate: erro no wp_remote_post: " . print_r($error_message,true)); 126 //syslog(LOG_WARNING, "Something went wrong:" . $error_message);127 126 } else { 128 127 $response = $ret['response']; … … 134 133 } 135 134 //$wl->write_log("Activate: sucesso" . print_r($ret,true)); 136 //syslog(LOG_WARNING,"sucesso:" . print_r($ret,true));137 135 } 138 136 /* O retorna no $ret acima: -
clearsale-total/tags/3.1.6/includes/class-clearsale-total-ajax.php
r3135161 r3301026 293 293 // compatibilidade com HPOS 294 294 $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(); 297 297 $wl->write_log("Clearsale_Total_Ajax: clearsale_total_push: Pedido " . $pedido . ", pago com " 298 298 . $cartao['modo'] . " dados salvo para posterior inserção na ClearSale"); -
clearsale-total/tags/3.1.6/includes/class-clearsale-total-api.php
r3135161 r3301026 545 545 546 546 $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));548 547 549 548 if ($cartao == "" || count($cartao) < 1) { // qdo vindo do checkout nao temos # cartao, apenas vindo do ajax … … 728 727 'reference' => '' 729 728 ), 730 /* como nao tem dados o Joelson pediu para tirar - email 3/12/18729 /* como nao tem dados o Joelson pediu para tirar - email 3/12/18 731 730 'phones' => array( 732 731 array( … … 753 752 'document' => $cpf ); 754 753 */ 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 756 756 $tipo_pgto = $this->Tipo_pagamento($order_data['payment_method']); // pag 18 757 757 if ("checkout-cielo" === $order_data['payment_method']) { … … 793 793 } 794 794 } 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']) { 796 796 $tmp = get_post_meta($order_data['id'], "_pagarme_payment_method", true); 797 797 if (empty($tmp)) … … 799 799 /* _pagarme_payment_method = billet 800 800 _pagarme_payment_method = credit_card 801 _pagarme_payment_method = 2_cards 801 802 _pagarme_payment_method = pix 803 _payment_method = woo-pagarme-payments-2_cards 804 Tipo_pagamento: tipo=woo-pagarme-payments-2_cards 802 805 */ 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 } 803 855 if ("billet" === $tmp) { 804 856 $tipo_pgto = $this->Tipo_pagamento("boleto"); … … 857 909 ) 858 910 ); 859 $header['payments'] = $tmp_payments; 911 if (count($tmp_payments2) <= 0) { 912 $header['payments'] = $tmp_payments; 913 } else { 914 $header['payments'] = $tmp_payments2; 915 } 860 916 861 917 // Items - deve ser array de itens - $items = $order->get_items() … … 970 1026 971 1027 /** 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 /** 972 1098 * Método para deixar apenas dígitos num número, usado para CPF e CNPJ 973 1099 * @param string $input - Entrada com pontos, hifen, ou vírgulas … … 1139 1265 //Rede API integration for WooCommerce - Webservice 1140 1266 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=erede1142 if (strstr($texto, "erede")) return(1); // olhando o plugin parece ter apenas crédito1143 1267 1144 1268 //Checkout Cielo for WooCommerce. Claudio Sanches 1.0.4, leva ao site da Cielo para pagar com crédito/debito/boleto, na volta … … 1157 1281 //Integração de Pagamento Pagar-me pela Pagar-me Versão 2.0.14, agora 3.1.1 1158 1282 // 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); 1160 1285 1161 1286 //Cielo Webservice API 3.0 - Jrossetto - inserido em 28/01/20 … … 1165 1290 if (strstr($texto, "paghiper")) return(2); 1166 1291 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); 1167 1294 //e.Rede - Webservice - e.Rede API - Cartão de Crédito - Versão 1.0 - http://www.loja5.com.br/ 1168 1295 if (strstr($texto, "loja5_woo_novo_erede_debito")) return(3); … … 1244 1371 if (strstr($texto, "click2pay-pix")) return(27); 1245 1372 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 1248 1381 if (strstr($texto, "billet")) return(2); 1249 1382 if (strstr($texto, "debito")) return(3); … … 1268 1401 16 VALE 1269 1402 27 PIX 1403 28 Cashback 1270 1404 1041 Cartão Presente Virtual 1271 1405 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 443 443 444 444 } // 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 445 498 446 499 /** … … 647 700 if (stristr($forma_pgto, "woo-pagarme-payments") || $forma_pgto == "Pagar.me") { // 9 648 701 // 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 650 703 651 704 $body = get_post_meta($order_id, '_pagarme_response_data', true); // todos os dados da transação … … 657 710 if (empty($pay_metodo)) 658 711 $pay_metodo = $order->get_meta('_pagarme_payment_method'); 659 if ("pix" === $pay_metodo) {712 if ("pix" === $pay_metodo) { 660 713 $cartao=array(); 661 714 return($cartao); 662 715 } 663 if ("billet" === $pay_metodo) {716 if ("billet" === $pay_metodo) { 664 717 $cartao=array(); 665 718 return($cartao); 719 } 720 if ("2_cards" === $pay_metodo) { 721 $cartao=array(); 722 return($cartao); 723 // todo tratado dentro de Monta_pedido 666 724 } 667 725 if ($body == null) { … … 724 782 } // end of pagar-me da pagar-me 725 783 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 726 827 } // end of $cartao vazio 727 828 return($cartao); -
clearsale-total/tags/3.1.6/includes/class-clearsale-total-deactivator.php
r3050591 r3301026 59 59 $error_message = $ret->get_error_message(); 60 60 $wl->write_log("Deactivate: erro no wp_remote_post: " . print_r($error_message,true)); 61 //syslog(LOG_WARNING, "Something went wrong:" . $error_message);62 61 } else { 63 62 $response = $ret['response']; … … 69 68 } 70 69 //$wl->write_log("Activate: sucesso" . print_r($ret,true)); 71 //syslog(LOG_WARNING,"sucesso:" . print_r($ret,true));72 70 } 73 71 } -
clearsale-total/tags/3.1.6/includes/class-clearsale-total-footer.php
r3135161 r3301026 110 110 $this->session_id = (string)$tmp1 . "_" . $t_tail; 111 111 //$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); 113 113 $woocommerce->session->set('cs_session_id', $this->session_id); 114 114 -
clearsale-total/tags/3.1.6/includes/class-clearsale-total-requirements.php
r2971562 r3301026 124 124 125 125 $err_results = $extensions = array(); 126 //syslog(LOG_WARNING,"require entrou...");127 126 if (empty( $requirements ) || ! is_array( $requirements )) { 128 127 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 27 27 * @author Letti Tecnologia <contato@letti.com.br> 28 28 * @date 20/07/2019 29 * @copyright 1996-202 1- Letti Tecnologia29 * @copyright 1996-2025 - Letti Tecnologia 30 30 */ 31 31 class Clearsale_Total … … 334 334 $this->loader->add_action('woocommerce_checkout_order_processed', $plugin_checkout, 'Cs_total_checkout_order_processed', 10, 3); 335 335 $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); 336 339 $this->loader->add_action('woocommerce_before_thankyou', $plugin_checkout, 'Cs_total_before_thankyou', 10, 1); 337 340 $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 1 23 ## [3.1.3] - 2024-08-05 2 24 … … 35 57 36 58 ### Added 37 - Método Pay Pal mas sem dados de cartão.59 - Método PaylPal mas sem dados de cartão. 38 60 39 61 -
clearsale-total/trunk/README.txt
r3135161 r3301026 4 4 Tags: 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 5 5 Requires at least: 5.0 6 Tested up to: 6. 67 Stable tag: 3.1. 36 Tested up to: 6.8 7 Stable tag: 3.1.6 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 11 11 12 12 Integração do WooCommerce com a ClearSale. 13 testado: wordpress 6. 614 woocommerce 9. 113 testado: wordpress 6.8 14 woocommerce 9.8 15 15 Requisitos: 16 16 php 5.6 ou maior … … 81 81 82 82 == 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 83 102 ## [3.1.3] - 2024-08-05 84 103 … … 129 148 130 149 131 ## [3.0.17] - 2023-08-03132 ### Added133 - Acionado webhook de novo status após aprovação.134 - Melhorias nas mensagens de depuração.135 136 ### Changed137 - Só altera para inanalisis se status anterior for NVO.138 150 139 151 -
clearsale-total/trunk/admin/class-clearsale-total-admin.php
r3135161 r3301026 328 328 329 329 <?php 330 330 331 331 } // end of cs_total_render_order_resent 332 332 -
clearsale-total/trunk/clearsale-total.php
r3135161 r3301026 18 18 * Plugin URI: https://api.clearsale.com.br/docs/plugins/wooCommerce/totalTotalGarantidoApplication 19 19 * Description: Integração da loja WooCommerce e a ClearSale Total. Segurança para suas vendas. 20 * Version: 3.1. 320 * Version: 3.1.6 21 21 * Author: ClearSale 22 22 * Author URI: https://br.clear.sale … … 58 58 * Rename this for your plugin and update it as you release new versions. 59 59 */ 60 define('CLEARSALE_TOTAL_VERSION', '3.1. 3');60 define('CLEARSALE_TOTAL_VERSION', '3.1.6'); 61 61 62 62 /** -
clearsale-total/trunk/includes/class-clearsale-total-activator.php
r3050591 r3301026 124 124 $error_message = $ret->get_error_message(); 125 125 $wl->write_log("Activate: erro no wp_remote_post: " . print_r($error_message,true)); 126 //syslog(LOG_WARNING, "Something went wrong:" . $error_message);127 126 } else { 128 127 $response = $ret['response']; … … 134 133 } 135 134 //$wl->write_log("Activate: sucesso" . print_r($ret,true)); 136 //syslog(LOG_WARNING,"sucesso:" . print_r($ret,true));137 135 } 138 136 /* O retorna no $ret acima: -
clearsale-total/trunk/includes/class-clearsale-total-ajax.php
r3135161 r3301026 293 293 // compatibilidade com HPOS 294 294 $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(); 297 297 $wl->write_log("Clearsale_Total_Ajax: clearsale_total_push: Pedido " . $pedido . ", pago com " 298 298 . $cartao['modo'] . " dados salvo para posterior inserção na ClearSale"); -
clearsale-total/trunk/includes/class-clearsale-total-api.php
r3135161 r3301026 545 545 546 546 $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));548 547 549 548 if ($cartao == "" || count($cartao) < 1) { // qdo vindo do checkout nao temos # cartao, apenas vindo do ajax … … 728 727 'reference' => '' 729 728 ), 730 /* como nao tem dados o Joelson pediu para tirar - email 3/12/18729 /* como nao tem dados o Joelson pediu para tirar - email 3/12/18 731 730 'phones' => array( 732 731 array( … … 753 752 'document' => $cpf ); 754 753 */ 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 756 756 $tipo_pgto = $this->Tipo_pagamento($order_data['payment_method']); // pag 18 757 757 if ("checkout-cielo" === $order_data['payment_method']) { … … 793 793 } 794 794 } 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']) { 796 796 $tmp = get_post_meta($order_data['id'], "_pagarme_payment_method", true); 797 797 if (empty($tmp)) … … 799 799 /* _pagarme_payment_method = billet 800 800 _pagarme_payment_method = credit_card 801 _pagarme_payment_method = 2_cards 801 802 _pagarme_payment_method = pix 803 _payment_method = woo-pagarme-payments-2_cards 804 Tipo_pagamento: tipo=woo-pagarme-payments-2_cards 802 805 */ 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 } 803 855 if ("billet" === $tmp) { 804 856 $tipo_pgto = $this->Tipo_pagamento("boleto"); … … 857 909 ) 858 910 ); 859 $header['payments'] = $tmp_payments; 911 if (count($tmp_payments2) <= 0) { 912 $header['payments'] = $tmp_payments; 913 } else { 914 $header['payments'] = $tmp_payments2; 915 } 860 916 861 917 // Items - deve ser array de itens - $items = $order->get_items() … … 970 1026 971 1027 /** 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 /** 972 1098 * Método para deixar apenas dígitos num número, usado para CPF e CNPJ 973 1099 * @param string $input - Entrada com pontos, hifen, ou vírgulas … … 1139 1265 //Rede API integration for WooCommerce - Webservice 1140 1266 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=erede1142 if (strstr($texto, "erede")) return(1); // olhando o plugin parece ter apenas crédito1143 1267 1144 1268 //Checkout Cielo for WooCommerce. Claudio Sanches 1.0.4, leva ao site da Cielo para pagar com crédito/debito/boleto, na volta … … 1157 1281 //Integração de Pagamento Pagar-me pela Pagar-me Versão 2.0.14, agora 3.1.1 1158 1282 // 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); 1160 1285 1161 1286 //Cielo Webservice API 3.0 - Jrossetto - inserido em 28/01/20 … … 1165 1290 if (strstr($texto, "paghiper")) return(2); 1166 1291 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); 1167 1294 //e.Rede - Webservice - e.Rede API - Cartão de Crédito - Versão 1.0 - http://www.loja5.com.br/ 1168 1295 if (strstr($texto, "loja5_woo_novo_erede_debito")) return(3); … … 1244 1371 if (strstr($texto, "click2pay-pix")) return(27); 1245 1372 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 1248 1381 if (strstr($texto, "billet")) return(2); 1249 1382 if (strstr($texto, "debito")) return(3); … … 1268 1401 16 VALE 1269 1402 27 PIX 1403 28 Cashback 1270 1404 1041 Cartão Presente Virtual 1271 1405 4011 Cartão de Débito/Transferência Eletrônica (CD) -
clearsale-total/trunk/includes/class-clearsale-total-checkout.php
r3135161 r3301026 443 443 444 444 } // 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 445 498 446 499 /** … … 647 700 if (stristr($forma_pgto, "woo-pagarme-payments") || $forma_pgto == "Pagar.me") { // 9 648 701 // 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 650 703 651 704 $body = get_post_meta($order_id, '_pagarme_response_data', true); // todos os dados da transação … … 657 710 if (empty($pay_metodo)) 658 711 $pay_metodo = $order->get_meta('_pagarme_payment_method'); 659 if ("pix" === $pay_metodo) {712 if ("pix" === $pay_metodo) { 660 713 $cartao=array(); 661 714 return($cartao); 662 715 } 663 if ("billet" === $pay_metodo) {716 if ("billet" === $pay_metodo) { 664 717 $cartao=array(); 665 718 return($cartao); 719 } 720 if ("2_cards" === $pay_metodo) { 721 $cartao=array(); 722 return($cartao); 723 // todo tratado dentro de Monta_pedido 666 724 } 667 725 if ($body == null) { … … 724 782 } // end of pagar-me da pagar-me 725 783 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 726 827 } // end of $cartao vazio 727 828 return($cartao); -
clearsale-total/trunk/includes/class-clearsale-total-deactivator.php
r3050591 r3301026 59 59 $error_message = $ret->get_error_message(); 60 60 $wl->write_log("Deactivate: erro no wp_remote_post: " . print_r($error_message,true)); 61 //syslog(LOG_WARNING, "Something went wrong:" . $error_message);62 61 } else { 63 62 $response = $ret['response']; … … 69 68 } 70 69 //$wl->write_log("Activate: sucesso" . print_r($ret,true)); 71 //syslog(LOG_WARNING,"sucesso:" . print_r($ret,true));72 70 } 73 71 } -
clearsale-total/trunk/includes/class-clearsale-total-footer.php
r3135161 r3301026 110 110 $this->session_id = (string)$tmp1 . "_" . $t_tail; 111 111 //$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); 113 113 $woocommerce->session->set('cs_session_id', $this->session_id); 114 114 -
clearsale-total/trunk/includes/class-clearsale-total-requirements.php
r2971562 r3301026 124 124 125 125 $err_results = $extensions = array(); 126 //syslog(LOG_WARNING,"require entrou...");127 126 if (empty( $requirements ) || ! is_array( $requirements )) { 128 127 trigger_error( __('WP Requirements: the requirements are invalid.', "clearsale-total"), E_USER_ERROR ); -
clearsale-total/trunk/includes/class-clearsale-total.php
r3050591 r3301026 27 27 * @author Letti Tecnologia <contato@letti.com.br> 28 28 * @date 20/07/2019 29 * @copyright 1996-202 1- Letti Tecnologia29 * @copyright 1996-2025 - Letti Tecnologia 30 30 */ 31 31 class Clearsale_Total … … 334 334 $this->loader->add_action('woocommerce_checkout_order_processed', $plugin_checkout, 'Cs_total_checkout_order_processed', 10, 3); 335 335 $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); 336 339 $this->loader->add_action('woocommerce_before_thankyou', $plugin_checkout, 'Cs_total_before_thankyou', 10, 1); 337 340 $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.