Changeset 3249916
- Timestamp:
- 03/03/2025 07:34:07 PM (13 months ago)
- Location:
- paypal-brasil-para-woocommerce
- Files:
-
- 10 edited
- 1 copied
-
tags/1.6.5 (copied) (copied from paypal-brasil-para-woocommerce/trunk)
-
tags/1.6.5/includes/class-wc-paypal-logger.php (modified) (2 diffs)
-
tags/1.6.5/includes/payment-methods/class-paypal-brasil-bcdc-gateway.php (modified) (4 diffs)
-
tags/1.6.5/includes/payment-methods/class-paypal-brasil-plus-gateway.php (modified) (1 diff)
-
tags/1.6.5/paypal-brasil-para-woocommerce.php (modified) (2 diffs)
-
tags/1.6.5/readme.txt (modified) (3 diffs)
-
trunk/includes/class-wc-paypal-logger.php (modified) (2 diffs)
-
trunk/includes/payment-methods/class-paypal-brasil-bcdc-gateway.php (modified) (4 diffs)
-
trunk/includes/payment-methods/class-paypal-brasil-plus-gateway.php (modified) (1 diff)
-
trunk/paypal-brasil-para-woocommerce.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
paypal-brasil-para-woocommerce/tags/1.6.5/includes/class-wc-paypal-logger.php
r3235591 r3249916 99 99 { 100 100 $fieldsToMask = ["address_line_1", "address_line_2", "admin_area_1", "admin_area_2", "country_code", "postal_code", "email_address", "surname", "national_number", "tax_id", "tax_id_type", "email", "full_name", "document", "documentType", "phone"]; 101 102 103 // Caso contenha um debug_id, executa um filtro especial 104 if (isset($data['debug_id'])) { 105 return $this->filterDataPaypalError($data); 106 } 107 108 101 109 foreach ($data as $key => &$value) { 102 110 // Se a chave estiver na lista de campos para mascarar e o valor for uma string, aplique a máscara … … 108 116 if (is_array($value)) { 109 117 $value = $this->filterData($value); 118 } 119 } 120 121 return $data; 122 } 123 124 function filterDataPaypalError(array $data): array 125 { 126 if (!isset($data['debug_id']) || empty($data['details'])) { 127 return $data; 128 } 129 130 foreach ($data['details'] as &$detail) { 131 if (!empty($detail['value']) && is_string($detail['value'])) { 132 $detail['value'] = $this->maskString($detail['value']); 110 133 } 111 134 } -
paypal-brasil-para-woocommerce/tags/1.6.5/includes/payment-methods/class-paypal-brasil-bcdc-gateway.php
r3246453 r3249916 513 513 try{ 514 514 $execution_response = $this->api->execute_payment($order_id, array(), 'bcdc'); 515 WC_PAYPAL_LOGGER::log("Payment capture is completed.",$this->id,'info', $execution_response); 515 WC_PAYPAL_LOGGER::log("Payment capture is completed.",$this->id,'info', $execution_response, array('action'=> 'CAPTURE_ORDER')); 516 516 517 }catch(PayPal_Brasil_API_Exception $ex){ 517 518 $data = $ex->getData(); … … 898 899 if ($order) { 899 900 $billing_data = [ 900 'postcode' => $order->get_ shipping_postcode(),901 'address' => $order->get_ shipping_address_1(),902 'address_2' => $order->get_ shipping_address_2(),903 'city' => $order->get_ shipping_city(),904 'state' => $order->get_ shipping_state(),905 'country' => $order->get_ shipping_country(),906 'neighborhood' => get_post_meta($order->get_id(), '_billing_neighborhood', true),907 'number' => get_post_meta($order->get_id(), '_billing_number', true),908 'first_name' => $order->get_billing_first_name() ,909 'last_name' => $order->get_billing_last_name() ,910 'person_type' => get_post_meta($order->get_id(), '_billing_persontype', true),911 'cpf' => get_post_meta($order->get_id(), '_billing_cpf', true),912 'cnpj' => get_post_meta($order->get_id(), '_billing_cnpj', true),913 'phone' => get_post_meta($order->get_id(), '_billing_cellphone', true) ?: $order->get_billing_phone(),901 'postcode' => $order->get_billing_postcode() ?? $order->get_shipping_postcode(), 902 'address' => $order->get_billing_address_1() ?? $order->get_shipping_address_1(), 903 'address_2' => $order->get_billing_address_2() ?? $order->get_shipping_address_2(), 904 'city' => $order->get_billing_city() ?? $order->get_shipping_city(), 905 'state' => $order->get_billing_state() ?? $order->get_shipping_state(), 906 'country' => $order->get_billing_country() ?? $order->get_shipping_country(), 907 'neighborhood' => $order->get_meta('_billing_neighborhood',true,"view"), 908 'number' => $order->get_meta('_billing_number',true,"view"), 909 'first_name' => $order->get_billing_first_name() ?? $order->get_shipping_first_name(), 910 'last_name' => $order->get_billing_last_name() ?? $order->get_shipping_last_name(), 911 'person_type' => $order->get_meta('_billing_persontype',true,"view"), 912 'cpf' => $order->get_meta('_billing_cpf',true,"view"), 913 'cnpj' => $order->get_meta('_billing_cnpj',true,"view"), 914 'phone' => $order->get_meta('_billing_cellphone',true,"view") ?: $order->get_billing_phone(), 914 915 'email' => $order->get_billing_email(), 915 916 ]; … … 973 974 } 974 975 975 $billing_data['wc-bcdc-brasil-selected'] = filter_var($post_data['wc-bcdc-brasil-selected'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);976 $billing_data['wc-bcdc-brasil-selected'] = isset($post_data) ? filter_var($post_data['wc-bcdc-brasil-selected'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) : false; 976 977 $billing_data['can_create_payment'] = $can_create_payment; 977 978 … … 1534 1535 $result = $this->api->create_payment($payment_data, array(), 'bcdc'); 1535 1536 1537 if (!isset($result['payment_source']['paypal']['address']) || !isset($result['payer']['address'])) { 1538 WC_PAYPAL_LOGGER::log("Order created without address.", $this->id, "warning", $result); 1539 } else { 1540 WC_PAYPAL_LOGGER::log("Order body", $this->id, "info", $result); 1541 } 1542 1536 1543 return $result; 1537 1544 // Catch any PayPal error. -
paypal-brasil-para-woocommerce/tags/1.6.5/includes/payment-methods/class-paypal-brasil-plus-gateway.php
r3245859 r3249916 700 700 if ($order) { 701 701 $billing_cellphone = get_post_meta($order->get_id(), '_billing_cellphone', true); 702 $data['postcode'] = $order->get_ shipping_postcode();703 $data['address'] = $order->get_ shipping_address_1();704 $data['address_2'] = $order->get_ shipping_address_2();705 $data['city'] = $order->get_ shipping_city();706 $data['state'] = $order->get_ shipping_state();707 $data['country'] = $order->get_ shipping_country();708 $data['neighborhood'] = get_post_meta($order->get_id(), '_billing_neighborhood', true);709 $data['number'] = get_post_meta($order->get_id(), '_billing_number', true);710 $data['first_name'] = $order->get_billing_first_name() ;711 $data['last_name'] = $order->get_billing_last_name() ;712 $data['person_type'] = get_post_meta($order->get_id(), '_billing_persontype', true);713 $data['cpf'] = get_post_meta($order->get_id(), '_billing_cpf', true);714 $data['cnpj'] = get_post_meta($order->get_id(), '_billing_cnpj', true);702 $data['postcode'] = $order->get_billing_postcode() ?? $order->get_shipping_postcode(); 703 $data['address'] = $order->get_billing_address_1() ?? $order->get_shipping_address_1(); 704 $data['address_2'] = $order->get_billing_address_2() ?? $order->get_shipping_address_2(); 705 $data['city'] = $order->get_billing_city() ?? $order->get_shipping_city(); 706 $data['state'] = $order->get_billing_state() ?? $order->get_shipping_state(); 707 $data['country'] = $order->get_billing_country() ?? $order->get_shipping_country(); 708 $data['neighborhood'] = $order->get_meta('_billing_neighborhood',true,"view"); 709 $data['number'] = $order->get_meta('_billing_number',true,"view"); 710 $data['first_name'] = $order->get_billing_first_name() ?? $order->get_shipping_first_name(); 711 $data['last_name'] = $order->get_billing_last_name() ?? $order->get_shipping_last_name(); 712 $data['person_type'] = $order->get_meta('_billing_persontype',true,"view"); 713 $data['cpf'] = $order->get_meta('_billing_cpf',true,"view"); 714 $data['cnpj'] = $order->get_meta('_billing_cnpj',true,"view"); 715 715 $data['phone'] = $billing_cellphone ? $billing_cellphone : $order->get_billing_phone(); 716 716 $data['email'] = $order->get_billing_email(); -
paypal-brasil-para-woocommerce/tags/1.6.5/paypal-brasil-para-woocommerce.php
r3246453 r3249916 4 4 * Plugin Name: PayPal Brasil para WooCommerce 5 5 * Description: Adicione facilmente opções de pagamento do PayPal à sua loja do WooCommerce. 6 * Version: 1.6. 46 * Version: 1.6.5 7 7 * Author: PayPal 8 8 * Author URI: https://paypal.com.br … … 30 30 // Define files. 31 31 define( 'PAYPAL_PAYMENTS_MAIN_FILE', __FILE__ ); 32 define( 'PAYPAL_PAYMENTS_VERSION', '1.6. 4' );32 define( 'PAYPAL_PAYMENTS_VERSION', '1.6.5' ); 33 33 define('WC_PAYPAL_PLUGIN_SLUG','paypal-brasil-para-woocommerce'); 34 34 -
paypal-brasil-para-woocommerce/tags/1.6.5/readme.txt
r3246453 r3249916 5 5 Requires at least: 4.4 6 6 Tested up to: 6.7.2 7 Stable tag: 1.6. 47 Stable tag: 1.6.5 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 90 90 91 91 == Changelog == 92 93 = 1.6.5 = 94 * Fix error payment from page of individual payment. 95 * Fix PHP warnings. 92 96 93 97 = 1.6.4 = … … 260 264 == Upgrade Notice == 261 265 262 = 1.6.4 = 263 * Fix error on checkout experience with other payments. 266 = 1.6.5 = 267 * Fix error payment from page of individual payment. 268 * Fix PHP warnings. 264 269 265 270 == Screenshots == -
paypal-brasil-para-woocommerce/trunk/includes/class-wc-paypal-logger.php
r3235591 r3249916 99 99 { 100 100 $fieldsToMask = ["address_line_1", "address_line_2", "admin_area_1", "admin_area_2", "country_code", "postal_code", "email_address", "surname", "national_number", "tax_id", "tax_id_type", "email", "full_name", "document", "documentType", "phone"]; 101 102 103 // Caso contenha um debug_id, executa um filtro especial 104 if (isset($data['debug_id'])) { 105 return $this->filterDataPaypalError($data); 106 } 107 108 101 109 foreach ($data as $key => &$value) { 102 110 // Se a chave estiver na lista de campos para mascarar e o valor for uma string, aplique a máscara … … 108 116 if (is_array($value)) { 109 117 $value = $this->filterData($value); 118 } 119 } 120 121 return $data; 122 } 123 124 function filterDataPaypalError(array $data): array 125 { 126 if (!isset($data['debug_id']) || empty($data['details'])) { 127 return $data; 128 } 129 130 foreach ($data['details'] as &$detail) { 131 if (!empty($detail['value']) && is_string($detail['value'])) { 132 $detail['value'] = $this->maskString($detail['value']); 110 133 } 111 134 } -
paypal-brasil-para-woocommerce/trunk/includes/payment-methods/class-paypal-brasil-bcdc-gateway.php
r3246453 r3249916 513 513 try{ 514 514 $execution_response = $this->api->execute_payment($order_id, array(), 'bcdc'); 515 WC_PAYPAL_LOGGER::log("Payment capture is completed.",$this->id,'info', $execution_response); 515 WC_PAYPAL_LOGGER::log("Payment capture is completed.",$this->id,'info', $execution_response, array('action'=> 'CAPTURE_ORDER')); 516 516 517 }catch(PayPal_Brasil_API_Exception $ex){ 517 518 $data = $ex->getData(); … … 898 899 if ($order) { 899 900 $billing_data = [ 900 'postcode' => $order->get_ shipping_postcode(),901 'address' => $order->get_ shipping_address_1(),902 'address_2' => $order->get_ shipping_address_2(),903 'city' => $order->get_ shipping_city(),904 'state' => $order->get_ shipping_state(),905 'country' => $order->get_ shipping_country(),906 'neighborhood' => get_post_meta($order->get_id(), '_billing_neighborhood', true),907 'number' => get_post_meta($order->get_id(), '_billing_number', true),908 'first_name' => $order->get_billing_first_name() ,909 'last_name' => $order->get_billing_last_name() ,910 'person_type' => get_post_meta($order->get_id(), '_billing_persontype', true),911 'cpf' => get_post_meta($order->get_id(), '_billing_cpf', true),912 'cnpj' => get_post_meta($order->get_id(), '_billing_cnpj', true),913 'phone' => get_post_meta($order->get_id(), '_billing_cellphone', true) ?: $order->get_billing_phone(),901 'postcode' => $order->get_billing_postcode() ?? $order->get_shipping_postcode(), 902 'address' => $order->get_billing_address_1() ?? $order->get_shipping_address_1(), 903 'address_2' => $order->get_billing_address_2() ?? $order->get_shipping_address_2(), 904 'city' => $order->get_billing_city() ?? $order->get_shipping_city(), 905 'state' => $order->get_billing_state() ?? $order->get_shipping_state(), 906 'country' => $order->get_billing_country() ?? $order->get_shipping_country(), 907 'neighborhood' => $order->get_meta('_billing_neighborhood',true,"view"), 908 'number' => $order->get_meta('_billing_number',true,"view"), 909 'first_name' => $order->get_billing_first_name() ?? $order->get_shipping_first_name(), 910 'last_name' => $order->get_billing_last_name() ?? $order->get_shipping_last_name(), 911 'person_type' => $order->get_meta('_billing_persontype',true,"view"), 912 'cpf' => $order->get_meta('_billing_cpf',true,"view"), 913 'cnpj' => $order->get_meta('_billing_cnpj',true,"view"), 914 'phone' => $order->get_meta('_billing_cellphone',true,"view") ?: $order->get_billing_phone(), 914 915 'email' => $order->get_billing_email(), 915 916 ]; … … 973 974 } 974 975 975 $billing_data['wc-bcdc-brasil-selected'] = filter_var($post_data['wc-bcdc-brasil-selected'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);976 $billing_data['wc-bcdc-brasil-selected'] = isset($post_data) ? filter_var($post_data['wc-bcdc-brasil-selected'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) : false; 976 977 $billing_data['can_create_payment'] = $can_create_payment; 977 978 … … 1534 1535 $result = $this->api->create_payment($payment_data, array(), 'bcdc'); 1535 1536 1537 if (!isset($result['payment_source']['paypal']['address']) || !isset($result['payer']['address'])) { 1538 WC_PAYPAL_LOGGER::log("Order created without address.", $this->id, "warning", $result); 1539 } else { 1540 WC_PAYPAL_LOGGER::log("Order body", $this->id, "info", $result); 1541 } 1542 1536 1543 return $result; 1537 1544 // Catch any PayPal error. -
paypal-brasil-para-woocommerce/trunk/includes/payment-methods/class-paypal-brasil-plus-gateway.php
r3245859 r3249916 700 700 if ($order) { 701 701 $billing_cellphone = get_post_meta($order->get_id(), '_billing_cellphone', true); 702 $data['postcode'] = $order->get_ shipping_postcode();703 $data['address'] = $order->get_ shipping_address_1();704 $data['address_2'] = $order->get_ shipping_address_2();705 $data['city'] = $order->get_ shipping_city();706 $data['state'] = $order->get_ shipping_state();707 $data['country'] = $order->get_ shipping_country();708 $data['neighborhood'] = get_post_meta($order->get_id(), '_billing_neighborhood', true);709 $data['number'] = get_post_meta($order->get_id(), '_billing_number', true);710 $data['first_name'] = $order->get_billing_first_name() ;711 $data['last_name'] = $order->get_billing_last_name() ;712 $data['person_type'] = get_post_meta($order->get_id(), '_billing_persontype', true);713 $data['cpf'] = get_post_meta($order->get_id(), '_billing_cpf', true);714 $data['cnpj'] = get_post_meta($order->get_id(), '_billing_cnpj', true);702 $data['postcode'] = $order->get_billing_postcode() ?? $order->get_shipping_postcode(); 703 $data['address'] = $order->get_billing_address_1() ?? $order->get_shipping_address_1(); 704 $data['address_2'] = $order->get_billing_address_2() ?? $order->get_shipping_address_2(); 705 $data['city'] = $order->get_billing_city() ?? $order->get_shipping_city(); 706 $data['state'] = $order->get_billing_state() ?? $order->get_shipping_state(); 707 $data['country'] = $order->get_billing_country() ?? $order->get_shipping_country(); 708 $data['neighborhood'] = $order->get_meta('_billing_neighborhood',true,"view"); 709 $data['number'] = $order->get_meta('_billing_number',true,"view"); 710 $data['first_name'] = $order->get_billing_first_name() ?? $order->get_shipping_first_name(); 711 $data['last_name'] = $order->get_billing_last_name() ?? $order->get_shipping_last_name(); 712 $data['person_type'] = $order->get_meta('_billing_persontype',true,"view"); 713 $data['cpf'] = $order->get_meta('_billing_cpf',true,"view"); 714 $data['cnpj'] = $order->get_meta('_billing_cnpj',true,"view"); 715 715 $data['phone'] = $billing_cellphone ? $billing_cellphone : $order->get_billing_phone(); 716 716 $data['email'] = $order->get_billing_email(); -
paypal-brasil-para-woocommerce/trunk/paypal-brasil-para-woocommerce.php
r3246453 r3249916 4 4 * Plugin Name: PayPal Brasil para WooCommerce 5 5 * Description: Adicione facilmente opções de pagamento do PayPal à sua loja do WooCommerce. 6 * Version: 1.6. 46 * Version: 1.6.5 7 7 * Author: PayPal 8 8 * Author URI: https://paypal.com.br … … 30 30 // Define files. 31 31 define( 'PAYPAL_PAYMENTS_MAIN_FILE', __FILE__ ); 32 define( 'PAYPAL_PAYMENTS_VERSION', '1.6. 4' );32 define( 'PAYPAL_PAYMENTS_VERSION', '1.6.5' ); 33 33 define('WC_PAYPAL_PLUGIN_SLUG','paypal-brasil-para-woocommerce'); 34 34 -
paypal-brasil-para-woocommerce/trunk/readme.txt
r3246453 r3249916 5 5 Requires at least: 4.4 6 6 Tested up to: 6.7.2 7 Stable tag: 1.6. 47 Stable tag: 1.6.5 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 90 90 91 91 == Changelog == 92 93 = 1.6.5 = 94 * Fix error payment from page of individual payment. 95 * Fix PHP warnings. 92 96 93 97 = 1.6.4 = … … 260 264 == Upgrade Notice == 261 265 262 = 1.6.4 = 263 * Fix error on checkout experience with other payments. 266 = 1.6.5 = 267 * Fix error payment from page of individual payment. 268 * Fix PHP warnings. 264 269 265 270 == Screenshots ==
Note: See TracChangeset
for help on using the changeset viewer.