Mandate.fromJson constructor

Mandate.fromJson(
  1. Object? json
)

Implementation

factory Mandate.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return Mandate(
    customerAcceptance:
        CustomerAcceptance.fromJson(map['customer_acceptance']),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    multiUse: map['multi_use'] == null
        ? null
        : MandateMultiUse.fromJson(map['multi_use']),
    onBehalfOf:
        map['on_behalf_of'] == null ? null : (map['on_behalf_of'] as String),
    paymentMethod: PaymentMethodOrId.fromJson(map['payment_method']),
    paymentMethodDetails:
        MandatePaymentMethodDetails.fromJson(map['payment_method_details']),
    singleUse: map['single_use'] == null
        ? null
        : MandateSingleUse.fromJson(map['single_use']),
    status: AccountCapabilitiesAcssDebitPayments.fromJson(map['status']),
    type: MandateType.fromJson(map['type']),
  );
}