fix: check if ->data is an array before creating an invoice from an order