PurchaseIOS.fromJson constructor

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

Implementation

factory PurchaseIOS.fromJson(Map<String, dynamic> json) {
  return PurchaseIOS(
    appAccountToken: json['appAccountToken'] as String?,
    appBundleIdIOS: json['appBundleIdIOS'] as String?,
    countryCodeIOS: json['countryCodeIOS'] as String?,
    currencyCodeIOS: json['currencyCodeIOS'] as String?,
    currencySymbolIOS: json['currencySymbolIOS'] as String?,
    currentPlanId: json['currentPlanId'] as String?,
    environmentIOS: json['environmentIOS'] as String?,
    expirationDateIOS: (json['expirationDateIOS'] as num?)?.toDouble(),
    id: json['id'] as String,
    ids: (json['ids'] as List<dynamic>?) == null
        ? null
        : (json['ids'] as List<dynamic>?)!.map((e) => e as String).toList(),
    isAutoRenewing: json['isAutoRenewing'] as bool,
    isUpgradedIOS: json['isUpgradedIOS'] as bool?,
    offerIOS: json['offerIOS'] != null
        ? PurchaseOfferIOS.fromJson(json['offerIOS'] as Map<String, dynamic>)
        : null,
    originalTransactionDateIOS:
        (json['originalTransactionDateIOS'] as num?)?.toDouble(),
    originalTransactionIdentifierIOS:
        json['originalTransactionIdentifierIOS'] as String?,
    ownershipTypeIOS: json['ownershipTypeIOS'] as String?,
    platform: IapPlatform.fromJson(json['platform'] as String),
    productId: json['productId'] as String,
    purchaseState: PurchaseState.fromJson(json['purchaseState'] as String),
    purchaseToken: json['purchaseToken'] as String?,
    quantity: json['quantity'] as int,
    quantityIOS: json['quantityIOS'] as int?,
    reasonIOS: json['reasonIOS'] as String?,
    reasonStringRepresentationIOS:
        json['reasonStringRepresentationIOS'] as String?,
    revocationDateIOS: (json['revocationDateIOS'] as num?)?.toDouble(),
    revocationReasonIOS: json['revocationReasonIOS'] as String?,
    storefrontCountryCodeIOS: json['storefrontCountryCodeIOS'] as String?,
    subscriptionGroupIdIOS: json['subscriptionGroupIdIOS'] as String?,
    transactionDate: (json['transactionDate'] as num).toDouble(),
    transactionId: json['transactionId'] as String,
    transactionReasonIOS: json['transactionReasonIOS'] as String?,
    webOrderLineItemIdIOS: json['webOrderLineItemIdIOS'] as String?,
    isAlternativeBilling: json['isAlternativeBilling'] as bool?,
  );
}