toMap method

  1. @override
Map<String, dynamic> toMap()
override

Implementation

@override
Map<String, dynamic> toMap() {
  Map<String, Object> mapObject = {};
  mapObject[FIELD_ID] = id??"";
  mapObject[FIELD_OBJECT] = VALUE_CUSTOMER;
  mapObject[FIELD_DEFAULT_SOURCE] = defaultSource??"";

  StripeJsonModel.putStripeJsonModelMapIfNotNull(
      mapObject, FIELD_SHIPPING, shippingInformation);

  Map<String, Object> sourcesObject = {};
  sourcesObject[FIELD_HAS_MORE] = hasMore??"";
  sourcesObject[FIELD_TOTAL_COUNT] = totalCount??"";
  sourcesObject[FIELD_OBJECT] = VALUE_LIST;
  sourcesObject[FIELD_URL] = url??"";
  StripeJsonModel.putStripeJsonModelListIfNotNull(
      sourcesObject, FIELD_DATA, sources);
  removeNullAndEmptyParams(sourcesObject);

  mapObject[FIELD_SOURCES] = sourcesObject;

  removeNullAndEmptyParams(mapObject);
  return mapObject;
}