 //
 
 import Foundation
+import StoreKit
 
 public class Aurum {
     public static let sharedInstance = Aurum()

                    weakSelf?.transactionHandler?.purchase(product: product)
                }
                else {
                    let error = NSError(domain: Aurum.ErrorDomain, code: AurumError.InvalidProductId.rawValue, userInfo:["invalidIds": invalidIds])
                    weakSelf?.onFailure?(error)
                }
            },
            onFailure: { error in
                weakSelf?.onFailure?(error)
            }
        )
        self.requestHandler?.request(productIds: Set([productId]))
    }

    public func fix() {

            onCanceled: { (_, _) in weakSelf?.onCanceled?() },
            verify: weakSelf?.verify
        )

        if SKPaymentQueue.canMakePayments() {
            self.transactionHandler?.fix()
        }
        else {
            self.onFailure?(NSError(domain: Aurum.ErrorDomain, code: Error.CannotMakePayments.rawValue, userInfo:nil))
        }
    }
}
