There is no verbose logging setting, but there are many hooks that can be augmented with a call to
Vipps::instance()->log("...");
We have gotten some reports of a similar situation before; but we have not been able to find the actual problem. In the given cases, the *payment method* has changed to Klarna at some point in the payment process, even though the order was completed with Vipps. Is this what you are experiencing as well?
When logging this on other sites, we have focused on logging the payment method on different parts of the lifecycle of the order, in particular on the callback, in process_payment and so forth. However, on testing the orders had payment method “vipps” all the way through; but “kco” when the callback from Vipps arrived. This means that something in the Klarna logic sets the payment method in the interim.
If you are seeing the same thing, you may try to log the payment method in process payment with
add_action('woo_vipps_before_redirect_to_vipps', function($order_id) {
$order = wc_get_order($orderid);
if ($order) {
Vipps::instance()->log("on redirect, $orderid har pm " . $order->get_payment_method());
}
}, 10, 1);
And on the callback,
add_action('woo_vipps_vipps_callback',
function ($result,$raw_post) {
$orderid = Vipps::instance()->getOrderIdByVippsOrderId($result['orderId']);
$order = wc_get_order($orderid);
if ($order) {
Vipps::instance()->log("ved callback, $orderid har pm " . $order->get_payment_method());
}
}, 10, 2);
If it is the same, you should see “vipps” and then “kco” when logging this.
If something external – Klarna, or something else – resets the payment method, and you cannot find the reason for this, you may have to just set the payment method back to Vipps again. There are meta variables in the order that can be checked to see if this is appropriate.
(As mentioned, we don’t know why this happens. It does not seem that KCO explicitly resets the payment method, but it could happen if for instance they have an $order object instantiated with the old payment method that gets saved after the new payment method is set, or something like that. If you are using a persistent object cache, that could be a part of it. If you find anything, please let us know.)