MandateDataCustomerAcceptance.fromJson constructor

MandateDataCustomerAcceptance.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory MandateDataCustomerAcceptance.fromJson(Map<String, dynamic> json) {
  final type = json['type'] as String?;
  if (type != 'online') {
    throw ArgumentError.value(
      type,
      'type',
      'Only customer acceptance of type online is supported.',
    );
  }

  return _MandateDataCustomerAcceptance(
    ipAddress: json['online'] == null
        ? null
        : MandateDataOnlineData.fromJson(
            json['online'] as Map<String, dynamic>,
          ),
  );
}