             
             switch result {
             case .Success(let receipt):
-                
-                let purchaseResult = SwiftyStoreKit.verifyPurchase(
-                    productId: self.AppBundleId + "." + purchase.rawValue,
-                    inReceipt: receipt,
-                    purchaseType: purchase.purchaseType
-                )
-                self.showAlert(self.alertForVerifyPurchase(purchaseResult))
+              
+                // Specific behaviour for AutoRenewablePurchase
+                if purchase == .AutoRenewablePurchase {
+                    let purchaseResult = SwiftyStoreKit.verifyAutomaticallyRenewableSubscription(
+                        productId: self.AppBundleId + "." + purchase.rawValue,
+                        validUntil: NSDate(),
+                        inReceipt: receipt
+                    )
+                    self.showAlert(self.alertForVerifyPurchase(purchaseResult))
+                }
+                else {
+                    let purchaseResult = SwiftyStoreKit.verifyPurchase(
+                        productId: self.AppBundleId + "." + purchase.rawValue,
+                        inReceipt: receipt
+                    )
+                    self.showAlert(self.alertForVerifyPurchase(purchaseResult))
+                }
                 
             case .Error(let error):
                 self.showAlert(self.alertForVerifyReceipt(result))

            }
        }
    }

    func alertForVerifyPurchase(result: SwiftyStoreKit.VerifyPurchaseResult) -> UIAlertController {
        
        switch result {
        case .Purchased(let expiresDate):
            if let expiresDate = expiresDate {
                print("Product is valid until \(expiresDate)")
                return alertWithTitle("Product is purchased", message: "Product is valid until \(expiresDate)")
            }
            print("Product is purchased")
            return alertWithTitle("Product is purchased", message: "Product will not expire")
        case .Expired(let expiresDate): // Only for Automatically Renewable Subscription
            print("Product is expired since \(expiresDate)")
            return alertWithTitle("Product expired", message: "Product is expired since \(expiresDate)")
        case .NotPurchased:
            print("This product has never been purchased")
            return alertWithTitle("Not purchased", message: "This product has never been purchased")

    case NonConsumablePurchase = "nonConsumablePurchase"
    case ConsumablePurchase = "consumablePurchase"
    case AutoRenewablePurchase = "autoRenewablePurchase"
}


