Changeset 3284057
- Timestamp:
- 04/29/2025 11:33:17 AM (11 months ago)
- Location:
- riskcube-von-creditreform-schweiz/trunk
- Files:
-
- 5 edited
-
readme.txt (modified) (2 diffs)
-
riskcube.php (modified) (1 diff)
-
src/Core/Connector.php (modified) (1 diff)
-
src/Core/RiskCube.php (modified) (3 diffs)
-
src/Helper/ClaimDataHelper.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
riskcube-von-creditreform-schweiz/trunk/readme.txt
r3275998 r3284057 5 5 Tested up to: 6.7.1 6 6 Requires PHP: 7.4 7 Stable Tag: 2.4.12.1 27 Stable Tag: 2.4.12.14 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 145 145 == Changelog == 146 146 147 = 2.4.12.14 = 148 **Bug Fixes** 149 - Fixed shipping fields reset on checkout 150 147 151 = 2.4.12.12 = 148 152 **Bug Fixes** -
riskcube-von-creditreform-schweiz/trunk/riskcube.php
r3275998 r3284057 6 6 * Plugin Name: RiskCUBE von Creditreform Schweiz 7 7 * Plugin URI: 8 * Version: 2.4.12.1 28 * Version: 2.4.12.14 9 9 * Description: RiskCube 10 10 * Author: Masterhomepage GmbH -
riskcube-von-creditreform-schweiz/trunk/src/Core/Connector.php
r3074156 r3284057 138 138 $res = $this->sendRequest('claim', (array)$requestData); 139 139 140 141 140 self::setSessionData($res, $requestData, $id_order); 142 141 -
riskcube-von-creditreform-schweiz/trunk/src/Core/RiskCube.php
r3275998 r3284057 65 65 wp_enqueue_script(basename($jsFile), RISKCUBE__PLUGIN_URL . $jsFile, [], FileHelper::get_file_version($jsFile), true); 66 66 } 67 68 67 69 68 if (get_option('wc_riskcube_invoice_payment_gateway', 0) == 1) { … … 71 70 } 72 71 73 add_action('woocommerce_order_status_changed', [__CLASS__, 'on_order_state_change'], 20, 3);72 add_action('woocommerce_order_status_changed', [__CLASS__, 'on_order_state_change'], 20, 1); 74 73 add_action('woocommerce_new_order', [__CLASS__, 'woocommerce_new_order'], 10, 1); 75 74 add_action('woocommerce_checkout_update_order_review', [__CLASS__, 'woocommerce_checkout_update_order_review']); … … 249 248 //cancel the shipping address if the checkbox is not checked 250 249 if (!$ship_to_different_address) { 251 WC()->customer->set_props([ 252 'shipping_first_name' => '', 253 'shipping_last_name' => '', 254 'shipping_company' => '', 255 'shipping_phone' => '', 256 'shipping_email' => '', 257 'shipping_country' => '', 258 'shipping_state' => '', 259 'shipping_postcode' => '', 260 'shipping_city' => '', 261 'shipping_address_1' => '', 262 'shipping_address_2' => '', 263 ]); 264 // Save changes to customer 265 WC()->customer->save(); 266 } 250 WC()->customer->set_shipping_first_name( '' ); 251 WC()->customer->set_shipping_last_name( '' ); 252 WC()->customer->set_shipping_company( '' ); 253 WC()->customer->set_shipping_address_1( '' ); 254 WC()->customer->set_shipping_address_2( '' ); 255 WC()->customer->set_shipping_city( '' ); 256 WC()->customer->set_shipping_state( '' ); 257 WC()->customer->set_shipping_postcode( '' ); 258 WC()->customer->set_shipping_country( null ); 259 WC()->customer->set_shipping_phone( '' ); 260 } 261 // Save changes to customer 262 WC()->customer->save(); 267 263 } 268 264 269 265 public static function woocommerce_new_order($id_order) 270 266 { 271 static::on_order_state_change($id_order , 'new', 'pending');272 } 273 274 public static function on_order_state_change($id_order , $from, $to_status)267 static::on_order_state_change($id_order); 268 } 269 270 public static function on_order_state_change($id_order) 275 271 { 276 272 $order = wc_get_order($id_order); 277 273 278 if (get_option('wc_riskcube_fk_confirm_state') === 'wc-' . $to_status) {274 if (get_option('wc_riskcube_fk_confirm_state') === 'wc-'.$order->get_status() ) { 279 275 // NXTLVL-182 in wc classic, the hooks are called in the wrong order. 280 276 // with this workaround, the order is checked wether it has been confirmed -
riskcube-von-creditreform-schweiz/trunk/src/Helper/ClaimDataHelper.php
r3074156 r3284057 147 147 { 148 148 if ($orderId) { 149 $session_id = md5(time()); 149 // Generate a unique ID using order ID and current timestamp 150 $session_id = md5($orderId . time()); 150 151 } else { 151 152 $session = RiskCube::getSession(); … … 166 167 throw new Exception('CLAIM : NO SESSION TOKEN'); 167 168 } 169 } 170 171 // Clear the session ID after use to ensure uniqueness for subsequent orders 172 if (!$orderId) { 173 $session->set('riskcube_session_id', null); 174 $session->save_data(); 168 175 } 169 176
Note: See TracChangeset
for help on using the changeset viewer.