sveawebpay / php-integration

SDK for Sveas payment methods (standalone and Svea Checkout)
Other
15 stars 19 forks source link

Order not found after checkout finish #86

Closed watta90 closed 4 years ago

watta90 commented 4 years ago

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"?

watta90 commented 4 years ago

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

https://github.com/sveawebpay/php-integration/issues/85#issuecomment-705212147