How to fix PaymentSense's gateway "orderStatus" error

We recently integrated the PaymentSense's gateway for one of our customers. While making some test transactions, we noticed the extension raised a basic PHP error on the callback:
Undefined variable: orderState  in /http/app/code/local/Paymentsense/Paymentsensegateway/controllers/PaymentController.php on line 812
Hopefully, this error will be fixed in their new release.

Undefined variable: orderState

The following fix removed the error and assigned the right status to the order. If you still face problems after applying it, please let us know and we will update this ticket. Editing on app/code/local/Paymentsense/Paymentsensegateway/controllers/PaymentController.php on line +812, change :
$order->setState($orderState, 'pys_paid', $message, false);
To
$order->setState($status, 'pys_paid', $message, false);
[syntaxhighlighter]