SubscriptionRequestMessage.fromMap constructor

SubscriptionRequestMessage.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory SubscriptionRequestMessage.fromMap(Map<String, dynamic> map) {
  return SubscriptionRequestMessage(
    customerId: map['customer_id'],
    planId: map['plan_identifier'],
    expiresAt: DateTime.fromMillisecondsSinceEpoch(map['expires_at']),
    onlyOnChargeSuccess: map['only_on_charge_success'],
    payableWith: map['payable_with'],
    isCreditBased: map['credits_based'],
    priceCents: map['price_cents'],
    creditsCycle: map['credits_cycle'],
    creditsMin: map['credits_min'],
    subitems: List<SubscriptionSubitem>.from(map['subitems']?.map((x) => SubscriptionSubitem.fromMap(x))),
    customVariables: List<CustomVariables>.from(map['custom_variables']?.map((x) => CustomVariables.fromMap(x))),
  );
}