| @@ -3762,9 +3762,9 @@ | ||
| 3762 | 3762 | } |
| 3763 | 3763 | do_action('woo_vipps_payment_complete_at_shutdown', $order, $this); |
| 3764 | 3764 | } catch (Exception $e) { |
| 3765 | 3765 | // This is/should be non-critical so just log it. |
| 3766 | - $this->log(sprintf(__("Could not do all payment-complete actions on %1\$s order %2\$d: %3\$s ", 'woo-vipps'), Vipps::CompanyName(), $orderid, $e->etMessage()), "error"); | |
| 3766 | + $this->log(sprintf(__("Could not do all payment-complete actions on %1\$s order %2\$d: %3\$s ", 'woo-vipps'), Vipps::CompanyName(), $orderid, $e->getMessage()), "error"); | |
| 3767 | 3767 | } |
| 3768 | 3768 | } |
| 3769 | 3769 | |
| 3770 | 3770 | // This is run on payment complete. Per default will it only add a link to the order confirmation page, but |
| @@ -3871,9 +3871,9 @@ | ||
| 3871 | 3871 | |
| 3872 | 3872 | $contents = WC()->cart->get_cart_contents(); |
| 3873 | 3873 | $contents = apply_filters('woo_vipps_create_express_checkout_cart_contents',$contents); |
| 3874 | 3874 | try { |
| 3875 | - $cart_hash = md5(json_encode(wc_clean($contents)) . WC()->cart->total); | |
| 3875 | + $cart_hash = WC()->cart->get_cart_hash(); | |
| 3876 | 3876 | $order = new WC_Order(); |
| 3877 | 3877 | $order->set_status('pending'); |
| 3878 | 3878 | $order->set_payment_method($this); |
| 3879 | 3879 | if ($ischeckout) { |
| @@ -3884,8 +3884,9 @@ | ||
| 3884 | 3884 | } |
| 3885 | 3885 | // We use 'checkout' as the created_via key as per requests, but allow merchants to use their own. IOK 2022-09-15 |
| 3886 | 3886 | $created_via = apply_filters('woo_vipps_express_checkout_created_via', 'checkout', $order, $ischeckout); |
| 3887 | 3887 | $order->set_created_via($created_via); |
| 3888 | + $order->set_cart_hash($cart_hash); | |
| 3888 | 3889 | |
| 3889 | 3890 | $dummy = sprintf(__('Vipps Express Checkout', 'woo-vipps')); // this is so gettext will find this string. |
| 3890 | 3891 | $dummy = sprintf(__('Vipps Checkout', 'woo-vipps')); // this is so gettext will find this string. |
| 3891 | 3892 | |