PurchaseInfo.fromJson constructor

PurchaseInfo.fromJson(
  1. Map<String, dynamic> json
)

Implementation

PurchaseInfo.fromJson(Map<String, dynamic> json) {
  if (json["id"] is int) this.id = json["id"];
  if (json["type"] is int) this.type = json["type"];
  if (json["userUniqueId"] is String) this.userUniqueId = json["userUniqueId"];
  if (json["proUniqueId"] is String) this.proUniqueId = json["proUniqueId"];
  if (json["qrCode"] is String) this.qrCode = json["qrCode"];
  if (json["paymentMethod"] is String) this.paymentMethod = json["paymentMethod"];
  if (json["paymentMethodInfo"] is Map)
    this.paymentMethodInfo = json["paymentMethodInfo"] == null
        ? null
        : PaymentMethodInfo.fromJson(json["paymentMethodInfo"]);
  if (json["countryCode"] is String) this.countryCode = json["countryCode"];
  if (json["currency"] is String) this.currency = json["currency"];
  if (json["amount"] is double) this.amount = json["amount"];
  if (json["commissionId"] is int) this.commissionId = json["commissionId"];
  if (json["status"] is String) this.status = json["status"];
  if (json["error"] is String) this.error = json["error"];
  if (json["timestamp"] is int) this.timestamp = json["timestamp"];
  if (json["purchasedAt"] is int) this.purchasedAt = json["purchasedAt"];
  if (json["deliveryLocationId"] is int) this.deliveryLocationId = json["deliveryLocationId"];
  if (json["transactionFriendlyId"] is String)
    this.transactionFriendlyId = json["transactionFriendlyId"];
  if (json["fromShop"] is int) this.fromShop = json["fromShop"];
  if (json["gateway"] is String) this.gateway = json["gateway"];
  if (json["orderId"] is String) this.orderId = json["orderId"];
  if (json["eventUniqueId"] is String) this.eventUniqueId = json["eventUniqueId"];
}