Getting Moltin\Entities\Order object from order ID


I’m currently converting from cart -> order in browser javascript of my checkout page, and I’m then passing order ID to PHP to process credit card payment.

I’d like to use manual gateway to mark order as paid, but it seems there is no way to get Moltin\Entities\Order object from order ID. I need Moltin\Entities\Order to be able to call order->pay() function.

The only way to get Moltin\Entities\Order object seems to be: get the cart and then call checkout(), which means I’ll have to move cart -> order conversion from client javascript to server PHP.

Is there any other way to get Moltin\Entities\Order from order ID using Moltin PHP SDK?


Meanwhile, I have managed to figure out a way to do the above - maybe it’ll be useful for others:

    $order_entity = new Moltin\Entities\Order($moltin);
    $response2 = $order_entity->pay("manual", "authorize", array());


Thanks @speedym! We’ll mark your last post as the solution to your question! :raised_hands: