SubscriptionCreateOptionsPaymentSettings.fromJson constructor

SubscriptionCreateOptionsPaymentSettings.fromJson(
  1. Object? json
)

Implementation

factory SubscriptionCreateOptionsPaymentSettings.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return SubscriptionCreateOptionsPaymentSettings(
    paymentMethodOptions: map['payment_method_options'] == null
        ? null
        : SubscriptionPaymentMethodOptions.fromJson(
            map['payment_method_options']),
    paymentMethodTypes: map['payment_method_types'] == null
        ? null
        : (map['payment_method_types'] as List<Object?>)
            .map((el) =>
                InvoicesPaymentSettingsPaymentMethodTypesItem.fromJson(el))
            .toList(),
    saveDefaultPaymentMethod: map['save_default_payment_method'] == null
        ? null
        : SubscriptionSaveDefaultPaymentMethod.fromJson(
            map['save_default_payment_method']),
  );
}