internal async static Task <AmazonStoreValidationResult> ValidatePurchaseAsync(string receiptId, string userId, string sharedSecret, bool sandboxStore)
        {
            var responseString = await ValidatePurchaseRawAsync(receiptId, userId, sharedSecret, sandboxStore);

            var receipt = new AmazonStoreReceipt();
            var json    = JsonValue.Parse(responseString);

            // required fields
            receipt.ProductId    = json[_productIdValueName];
            receipt.ProductType  = GetProductType(json[_productTypeValueName]);
            receipt.PurchaseDate = GetDate(json[_purchaseDateValueName]);
            receipt.Quantity     = json[_quantityValueName];
            receipt.ReceiptId    = json[_receiptIdValueName];

            // optional fields
            if (json.ContainsKey(_renewalDateValueName))
            {
                receipt.RenewalDate = GetDate(json[_renewalDateValueName]);
            }

            if (json.ContainsKey(_termValueName))
            {
                // TODO
            }

            if (json.ContainsKey(_termSkuValueName))
            {
                receipt.TermSku = json[_termSkuValueName];
            }

            if (json.ContainsKey(_betaProductValueName))
            {
                receipt.IsBetaProduct = json[_betaProductValueName];
            }

            if (json.ContainsKey(_testTransactionValueName))
            {
                receipt.IsTestTransaction = json[_testTransactionValueName];
            }

            return(new AmazonStoreValidationResult(0, responseString, receipt));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AmazonStoreValidationResult"/> class.
 /// </summary>
 internal AmazonStoreValidationResult(int status, string rawResponse, AmazonStoreReceipt receipt)
 {
     StatusCode = status;
     RawResult  = rawResponse;
     Receipt    = receipt;
 }