Loading
Issue #3627239: Accept Hosted webhook cannot find the order when the order has an order number.
Closes #3627239
AcceptHosted sends the order number as invoiceNumber when the order has one, but onNotify() loaded the order by ID. This MR:
- Adds
loadOrderByInvoiceNumber(), which looks the order up byorder_numberfirst, then by ID only for orders without a number. An order that has a number is never matched by its ID. - Fixes the operator precedence in the refund
invoiceNumber, which sentREFUND#with no number for orders without an order number. - Adds
AcceptHostedInvoiceNumberTest(kernel). It mocks the Authorize.net HTTP calls, so it needs no API credentials.
The new test fails on 2.x without the fix (webhook lookup by order number, refund invoice number, missing method) and passes with it.