toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  if (id == null) {
    return {
      'type': type!.name.toLowerCase(),
      'token': token,
      'customer': customer.toInstrumentMap(),
    };
  } else {
    return {
      //updating
      "expiry_month": expiryMonth,
      "expiry_year": expiryYear,
      "customer": {
        "id": customer.id,
        "default": isDefault,
      }
    };
  }
}