Klarna authorize puts orders on hold instead of processing

Hi @amsi016

orders status goes to “on hold” instead of “processing

That is the expected behavior. When a payment for an order is authorized, the plugin sets the order’s status to on-hold. If you want a status other than that, you can use filter wc_stripe_authorized_order_status .

Example:

add_filter('wc_stripe_authorized_order_status', function($status, $order){
if($order->get_payment_method() === 'stripe_klarna'){
$status="processing";
}
}, 10, 2)

Kind Regards

Hi @mrclayton,

Thanks for the quick reply!

Ok, I used the filter as a snippet but now orders does not change status and stays in “Pending payment”.

What I used:

add_filter( 'wc_stripe_authorized_order_status', function($status, $order){    if($order->get_payment_method() === 'stripe_klarna'){        $status="processing";    }}, 10, 2 );

Updated example:

add_filter('wc_stripe_authorized_order_status', function($status, $order){
if($order->get_payment_method() === 'stripe_klarna'){
$status="processing";
}
return $status;
}, 10, 2);

The status needs to be returned.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer