Changeset 3373334
- Timestamp:
- 10/06/2025 03:22:20 AM (6 months ago)
- Location:
- fraudlabs-pro-for-woocommerce/trunk
- Files:
-
- 3 edited
-
includes/class.wc-fraudlabspro.php (modified) (3 diffs)
-
init.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fraudlabs-pro-for-woocommerce/trunk/includes/class.wc-fraudlabspro.php
r3370125 r3373334 85 85 add_action( 'woocommerce_admin_order_data_after_billing_address', array( $this, 'render_fraud_report' ) ); 86 86 add_action( 'woocommerce_store_api_checkout_order_processed', array( $this, 'store_checkout_order_processed' ), 99, 3 ); 87 add_action( 'woocommerce_after_checkout_form', array( $this, 'javascript_agent' ) ); 88 add_action( 'woocommerce_checkout_order_processed', array( $this, 'checkout_order_processed' ), 99, 3 ); 87 89 add_action( 'woocommerce_order_status_changed', array( $this, 'order_status_changed' ), 99, 3 ); 88 90 add_action( 'woocommerce_order_status_completed', array( $this, 'order_status_completed' ) ); … … 167 169 $table_name = $this->create_flpwc_table(); 168 170 $this->add_flpwc_data($table_name, $order_id, '_fraudlabspro_ip_before', $flpIP); 169 $this->write_debug_log( ' Checkout order processed for Order ' . $order_id . '.');171 $this->write_debug_log( 'Store checkout order processed for Order ' . $order_id . '.'); 170 172 171 173 if ( $this->validate_order() === false ) { 172 174 wc_add_notice( ( !empty( $this->fraud_message ) ) ? $this->fraud_message : 'This order ' . $order_id . ' failed our fraud validation. Please contact us for more details.', 'error' ); 175 176 global $woocommerce; 177 $woocommerce->cart->empty_cart(); 178 179 if ( is_ajax() ) { 180 wp_send_json( array( 181 'result' => 'success', 182 'redirect' => apply_filters( 'woocommerce_checkout_no_payment_needed_redirect', wc_get_cart_url(), $this->order ), 183 ) ); 184 } else { 185 wp_safe_redirect( 186 apply_filters( 'woocommerce_checkout_no_payment_needed_redirect', wc_get_cart_url(), $this->order ) 187 ); 188 exit; 189 } 190 } 191 } 192 193 public function checkout_order_processed( $order_id, $posted_data, $order ) { 194 // Collect IP information before the payment gateway 195 $ip_x_sucuri_before = $ip_incap_before = $ip_http_cf_connecting_before = $ip_x_forwarded_for_before = $ip_x_real_before = $ip_http_client_before = $ip_http_forwarded_before = $ip_x_forwarded_before ='::1'; 196 197 if ( isset( $_SERVER['HTTP_X_SUCURI_CLIENTIP'] ) && filter_var( $_SERVER['HTTP_X_SUCURI_CLIENTIP'], FILTER_VALIDATE_IP ) ) { 198 $ip_x_sucuri_before = $_SERVER['HTTP_X_SUCURI_CLIENTIP']; 199 } 200 201 if( isset( $_SERVER['HTTP_INCAP_CLIENT_IP'] ) && filter_var( $_SERVER['HTTP_INCAP_CLIENT_IP'], FILTER_VALIDATE_IP ) ) { 202 $ip_incap_before = $_SERVER['HTTP_INCAP_CLIENT_IP']; 203 } 204 205 if( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) && filter_var( $_SERVER['HTTP_CF_CONNECTING_IP'], FILTER_VALIDATE_IP ) ) { 206 $ip_http_cf_connecting_before = $_SERVER['HTTP_CF_CONNECTING_IP']; 207 } 208 209 if ( isset( $_SERVER['HTTP_X_REAL_IP'] ) ) { 210 $ip_x_real_before = $_SERVER['HTTP_X_REAL_IP']; 211 } 212 213 if( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { 214 $xip = trim(current(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']))); 215 216 if (filter_var($xip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { 217 $ip_x_forwarded_for_before = $xip; 218 } 219 } 220 221 if( isset( $_SERVER['HTTP_CLIENT_IP'] ) && filter_var( $_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP ) ) { 222 $ip_http_client_before = $_SERVER['HTTP_CLIENT_IP']; 223 } 224 225 if( isset( $_SERVER['HTTP_FORWARDED'] ) && filter_var( $_SERVER['HTTP_FORWARDED'], FILTER_VALIDATE_IP ) ) { 226 $ip_http_forwarded_before = $_SERVER['HTTP_FORWARDED']; 227 } 228 229 if( isset( $_SERVER['HTTP_X_FORWARDED'] ) && filter_var( $_SERVER['HTTP_X_FORWARDED'], FILTER_VALIDATE_IP ) ) { 230 $ip_x_forwarded_before = $_SERVER['HTTP_X_FORWARDED']; 231 } 232 233 $ip_remote_addr_before = $_SERVER['REMOTE_ADDR']; 234 $flp_checksum_before = ( isset( $_COOKIE['flp_checksum'] ) ) ? $_COOKIE['flp_checksum'] : ''; 235 $flp_device_before = ( isset( $_COOKIE['flp_device'] ) ) ? $_COOKIE['flp_device'] : ''; 236 237 $flpIP = [ 238 'ip_x_sucuri_before' => $ip_x_sucuri_before, 239 'ip_incap_before' => $ip_incap_before, 240 'ip_http_cf_connecting_before' => $ip_http_cf_connecting_before, 241 'ip_x_real_before' => $ip_x_real_before, 242 'ip_x_forwarded_for_before' => $ip_x_forwarded_for_before, 243 'ip_http_client_before' => $ip_http_client_before, 244 'ip_http_forwarded_before' => $ip_http_forwarded_before, 245 'ip_x_forwarded_before' => $ip_x_forwarded_before, 246 'ip_remote_addr_before' => $ip_remote_addr_before, 247 'flp_checksum_before' => $flp_checksum_before, 248 'flp_device_before' => $flp_device_before, 249 ]; 250 251 add_post_meta( $order_id, '_fraudlabspro_ip_before', $flpIP ); 252 $table_name = $this->create_flpwc_table(); 253 $this->add_flpwc_data($table_name, $order_id, '_fraudlabspro_ip_before', $flpIP); 254 255 if ( $this->validation_sequence != 'before' ) { 256 return; 257 } 258 259 $this->write_debug_log( 'Checkout order processed for Order ' . $order_id . '.'); 260 $this->order = wc_get_order( $order_id ); 261 262 if ( $this->validate_order() === false ) { 263 wc_add_notice( ( !empty( $this->fraud_message ) ) ? $this->fraud_message : 'This order ' . $this->order->get_id() . ' failed our fraud validation. Please contact us for more details.', 'error' ); 173 264 174 265 global $woocommerce; … … 656 747 'advanced_velocity_screening' => ( get_option('wc_settings_woocommerce-fraudlabs-pro_flp_advanced_velocity') == "yes" ) ? 'enabled' : 'disabled', 657 748 'source' => 'woocommerce', 658 'source_version' => '2.23. 3',749 'source_version' => '2.23.4', 659 750 'items' => $item_sku, 660 751 'cc_key' => $cc_key, -
fraudlabs-pro-for-woocommerce/trunk/init.php
r3370125 r3373334 6 6 * Author: FraudLabs Pro 7 7 * Author URI: https://www.fraudlabspro.com/ 8 * Version: 2.23. 38 * Version: 2.23.4 9 9 * Requires Plugins: woocommerce 10 10 * Text Domain: fraudlabs-pro-for-woocommerce -
fraudlabs-pro-for-woocommerce/trunk/readme.txt
r3370125 r3373334 5 5 Requires at least: 4.6 6 6 Tested up to: 6.8 7 Stable tag: 2.23. 37 Stable tag: 2.23.4 8 8 9 9 Fraud prevention plugin for WooCommerce to minimize payment fraud and avoid chargebacks. With the FraudLabs Pro Micro Plan, you can get 500 free fraud validation credits every month. … … 98 98 == Changelog == 99 99 100 * 2.23.4 Fixed Before Payment Validation not working issue. 100 101 * 2.23.3 Updated Before Payment Validation. 101 102 * 2.23.2 Removed legacy order properties.
Note: See TracChangeset
for help on using the changeset viewer.