fromMap static method

OrderPayment? fromMap(
  1. Object? body
)

Implementation

static OrderPayment? fromMap(Object? body) {
  final source = readRecord(body, envelopeKey: 'payment');
  if (source == null) return null;
  return OrderPayment(
    account: OrderPaymentAccount.fromMap(source['account']),
    createdBy: OrderPaymentCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    creditApplied: readList<Object>(source['credit_applied'], readAny),
    customAttributes: readList<Object>(source['custom_attributes'], readAny),
    giftCertificateApplied:
        readList<Object>(source['gift_certificate_applied'], readAny),
    id: readText(source['id']),
    invoices: readList<OrderPaymentInvoice>(
        source['invoices'], OrderPaymentInvoice.fromMap),
    lastUpdatedBy: readAny(source['last_updated_by']),
    lastUpdatedOn: readAny(source['last_updated_on']),
    object: readText(source['object']),
    origin: readAny(source['origin']),
    paymentApplied: readList<OrderPaymentPaymentApplied>(
        source['payment_applied'], OrderPaymentPaymentApplied.fromMap),
    paymentNote: readText(source['payment_note']),
    reconcileStatus: readText(source['reconcile_status']),
    status: readText(source['status']),
    version: readInteger(source['version']),
  );
}