         case .autoRenewable:
             return (receipt["latest_receipt_info"] as? [ReceiptInfo], nil)
         case .nonRenewing(let duration):
-            let appReceipt = receipt["receipt"] as? [String: AnyObject]
-            return (appReceipt?["in_app"] as? [ReceiptInfo], duration)
+            return (getInAppReceipt(receipt: receipt), duration)
         }
     }
 

            return nil
        }
        return Date(millisecondsSince1970: requestDateString)
    }

    /**

    ) -> VerifyPurchaseResult {

        // Get receipts info for the product
        let receipts = getInAppReceipt(receipt: receipt)
        let filteredReceiptsInfo = filterReceiptsInfo(receipts: receipts, withProductId: productId)
        let nonCancelledReceiptsInfo = filteredReceiptsInfo.filter { receipt in receipt["cancellation_date"] == nil }

        let receiptItems = nonCancelledReceiptsInfo.flatMap { ReceiptItem(receiptInfo: $0) }
