Skip to content

REST - wrong order id handling? #42

@Krossfire

Description

@Krossfire

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions