PaymentMethod.fromJson constructor

PaymentMethod.fromJson(
  1. dynamic data
)

Implementation

factory PaymentMethod.fromJson(dynamic data) {
  var json = DynamicJsonExtension.getJsonMap(data);
  return PaymentMethod(
    id: json['id'],
    title: json['title'],
    isSelected: json['isSelected'] ?? json['is_selected'],
    confirmationRequired:
        json['confirmation_required'] ?? json['confirmationRequired'],
    icons: (json["checkoutIcons"] ?? json['icons'])?.cast<String>(),
    type: methodTypeFromJson(json['type']),
    requiredBillingData: (json['required_billing_data'] as List<dynamic>?)
        ?.map((e) => InputField.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}