 }
 
 extension IAPManager: SKProductsRequestDelegate {
-    func productsRequest(request: SKProductsRequest, didReceiveResponse response: SKProductsResponse) {
+    public func productsRequest(request: SKProductsRequest, didReceiveResponse response: SKProductsResponse) {
         for product in response.products {
             availableProducts[product.productIdentifier] = product
         }

import Foundation
import StoreKit

typealias RestoreTransactionsCompletionBlock = NSError? -> Void
typealias LoadProductsCompletionBlock = (Array<SKProduct>?, NSError?) -> Void
typealias PurchaseProductCompletionBlock = (NSError?) -> Void
typealias LoadProductsRequestInfo = (request: SKProductsRequest, completion: LoadProductsCompletionBlock)
typealias PurchaseProductRequestInfo = (productId: String, completion: PurchaseProductCompletionBlock)

class IAPManager: NSObject {
    static let sharedManager = IAPManager()
    
    override init() {
        super.init()


extension IAPManager: SKPaymentTransactionObserver {
    
    public func paymentQueue(queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
        for transaction in transactions {
            let productId = transaction.payment.productIdentifier
            switch transaction.transactionState {
