printOutcome static method
Reads the answer to EcrMethods.printReceipt.
EcrPrintKeys.status and EcrPrintKeys.message stay separate — a missing status falls back to EcrPrintKeys.ok, never to text in the message.
Implementation
static EcrPrintOutcome printOutcome(Object? payload) {
final Map<Object?, Object?>? map = _asMap(payload);
if (map == null) {
return EcrPrintOutcome.failed(_notAMap(payload, 'a print outcome'));
}
final bool? ok = map[EcrPrintKeys.ok] as bool?;
final String statusWire = _string(map, EcrPrintKeys.status);
final String message = _string(map, EcrPrintKeys.message);
return EcrPrintOutcome.from(
ok: ok ?? false,
message: message,
statusWire: statusWire.isEmpty ? null : statusWire,
);
}