-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Hi,
The REST integration (SmartForms) does not handle the order ID value well (or at least it looks so). In files:
Lyranetwork/Lyra/Controller/Payment/Rest/Check.php:103
and
Lyranetwork/Lyra/Controller/Payment/Rest/Response.php:92
the response values are converted, and the "orderId" becomes a "vads_order_id". However, in Check.php:116 and Response.php:105 there is code:
$orderId = (int) $response->get('order_id');
Which tries to get the orderId (and cast it to an integer) from a non-existing "order_id" element. This cause all orders (in M2) to fail, however, Lyra still processes the payment and capture the required amount, but order status is not updated, because of the "Received empty Order ID." error.
It seems that changing the
$orderId = (int) $response->get('order_id');
to
$orderId = $response->get('vads_order_id');
in both mentioned files fixes the issue (no more errors in logs, orders are properly updated, payments are captured), and also supports increment_order_id with letters.
Best regards