sveawebpay/php-integration

Order not found after checkout finish

watta90 opened this issue · 1 comments

I use the checkout order and set a confirmationUri to do some additional actions when the order is finished. In my confirmation handler I query the order but sometimes I get "Order not found". When I check the Svea admin page I can see the order there, so I shouldn't get an "Order not found".

public function handleConfirmation($orderId) {

    $request = WebPayAdmin::queryOrder($config)
        ->setCountryCode($cc)
        ->setCheckoutOrderId($orderId);
    $response = $request->queryCheckoutOrder()->doRequest(); //ERROR sometimes it throws exception "Order not found"
    
    //...
}

Is this a timing issue and how should I query the order in my confirmationHandler to avoid "Order not found"?

Is solved by using the WebPay::checkout interface and not WebPayAdmin:queryOrder interface, see this comment

#85 (comment)