Bladeren bron

Udpated tests and documentation

Closes #324 by implementing additional markdown documentation within the code.
Sam Spencer 5 jaren geleden
bovenliggende
commit
93a95d422c

+ 44 - 29
SwiftyStoreKit/SwiftyStoreKit+Types.swift

@@ -181,30 +181,45 @@ public enum SubscriptionType {
 }
 
 public struct ReceiptItem: Purchased, Codable {
-    // The product identifier of the item that was purchased. This value corresponds to the productIdentifier property of the SKPayment object stored in the transaction’s payment property.
-    public let productId: String
-    // The number of items purchased. This value corresponds to the quantity property of the SKPayment object stored in the transaction’s payment property.
-    public let quantity: Int
-    // The transaction identifier of the item that was purchased. This value corresponds to the transaction’s transactionIdentifier property.
-    public let transactionId: String
-    // For a transaction that restores a previous transaction, the transaction identifier of the original transaction. Otherwise, identical to the transaction identifier. This value corresponds to the original transaction’s transactionIdentifier property. All receipts in a chain of renewals for an auto-renewable subscription have the same value for this field.
-    public let originalTransactionId: String
-    // The date and time that the item was purchased. This value corresponds to the transaction’s transactionDate property.
-    public let purchaseDate: Date
-    // For a transaction that restores a previous transaction, the date of the original transaction. This value corresponds to the original transaction’s transactionDate property. In an auto-renewable subscription receipt, this indicates the beginning of the subscription period, even if the subscription has been renewed.
-    public let originalPurchaseDate: Date
-    // The primary key for identifying subscription purchases.
-    public let webOrderLineItemId: String?
-    // The expiration date for the subscription, expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT. This key is only present for auto-renewable subscription receipts.
-    public let subscriptionExpirationDate: Date?
-    // For a transaction that was canceled by Apple customer support, the time and date of the cancellation. Treat a canceled receipt the same as if no purchase had ever been made.
-    public let cancellationDate: Date?
-
-    public let isTrialPeriod: Bool
     
-    public let isInIntroOfferPeriod: Bool
+    /// The product identifier of the item that was purchased. This value corresponds to the `productIdentifier` property of the `SKPayment` object stored in the transaction’s payment property.
+    public var productId: String
+    
+    /// The number of items purchased. This value corresponds to the `quantity` property of the `SKPayment` object stored in the transaction’s payment property.
+    public var quantity: Int
+    
+    /// The transaction identifier of the item that was purchased. This value corresponds to the transaction’s `transactionIdentifier` property.
+    public var transactionId: String
+    
+    /// For a transaction that restores a previous transaction, the transaction identifier of the original transaction. 
+    /// 
+    /// Otherwise, identical to the transaction identifier. This value corresponds to the original transaction’s `transactionIdentifier` property. All receipts in a chain of renewals for an auto-renewable subscription have the same value for this field.
+    public var originalTransactionId: String
+    
+    /// The date and time that the item was purchased. This value corresponds to the transaction’s `transactionDate` property.
+    public var purchaseDate: Date
+    
+    /// For a transaction that restores a previous transaction, the date of the original transaction. This value corresponds to the original transaction’s `transactionDate` property. In an auto-renewable subscription receipt, this indicates the beginning of the subscription period, even if the subscription has been renewed.
+    public var originalPurchaseDate: Date
+    
+    /// The primary key for identifying subscription purchases.
+    public var webOrderLineItemId: String?
+    
+    /// The expiration date for the subscription, expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT. This key is **only** present for **auto-renewable** subscription receipts.
+    public var subscriptionExpirationDate: Date?
+    
+    /// For a transaction that was canceled by Apple customer support, the time and date of the cancellation. 
+    /// 
+    /// Treat a canceled receipt the same as if no purchase had ever been made.
+    public var cancellationDate: Date?
+    
+    /// Indicates whether or not the subscription item is currently within a given trial period.
+    public var isTrialPeriod: Bool
+    
+    /// Indicates whether or not the subscription item is currently within an intro offer period.
+    public var isInIntroOfferPeriod: Bool
     
-    internal init(productId: String, quantity: Int, transactionId: String, originalTransactionId: String, purchaseDate: Date, originalPurchaseDate: Date, webOrderLineItemId: String?, subscriptionExpirationDate: Date?, cancellationDate: Date?, isTrialPeriod: Bool, isInIntroOfferPeriod: Bool) {
+    public init(productId: String, quantity: Int, transactionId: String, originalTransactionId: String, purchaseDate: Date, originalPurchaseDate: Date, webOrderLineItemId: String?, subscriptionExpirationDate: Date?, cancellationDate: Date?, isTrialPeriod: Bool, isInIntroOfferPeriod: Bool) {
         self.productId = productId
         self.quantity = quantity
         self.transactionId = transactionId
@@ -219,19 +234,19 @@ public struct ReceiptItem: Purchased, Codable {
     }
 }
 
-// Error when managing receipt
+/// Error when managing receipt
 public enum ReceiptError: Swift.Error {
-    // No receipt data
+    /// No receipt data
     case noReceiptData
-    // No data received
+    /// No data received
     case noRemoteData
-    // Error when encoding HTTP body into JSON
+    /// Error when encoding HTTP body into JSON
     case requestBodyEncodeError(error: Swift.Error)
-    // Error when proceeding request
+    /// Error when proceeding request
     case networkError(error: Swift.Error)
-    // Error when decoding response
+    /// Error when decoding response
     case jsonDecodeError(string: String?)
-    // Receive invalid - bad status returned
+    /// Receive invalid - bad status returned
     case receiptInvalid(receipt: ReceiptInfo, status: ReceiptStatus)
 }
 

+ 100 - 121
SwiftyStoreKit/SwiftyStoreKit.swift

@@ -25,29 +25,29 @@
 import StoreKit
 
 public class SwiftyStoreKit {
-
+    
     private let productsInfoController: ProductsInfoController
-
+    
     fileprivate let paymentQueueController: PaymentQueueController
-
+    
     fileprivate let receiptVerificator: InAppReceiptVerificator
-
+    
     init(productsInfoController: ProductsInfoController = ProductsInfoController(),
          paymentQueueController: PaymentQueueController = PaymentQueueController(paymentQueue: SKPaymentQueue.default()),
          receiptVerificator: InAppReceiptVerificator = InAppReceiptVerificator()) {
-
+        
         self.productsInfoController = productsInfoController
         self.paymentQueueController = paymentQueueController
         self.receiptVerificator = receiptVerificator
     }
-
+    
     // MARK: private methods
     fileprivate func retrieveProductsInfo(_ productIds: Set<String>, completion: @escaping (RetrieveResults) -> Void) -> InAppProductRequest {
         return productsInfoController.retrieveProductsInfo(productIds, completion: completion)
     }
     
     fileprivate func purchaseProduct(_ productId: String, quantity: Int = 1, atomically: Bool = true, applicationUsername: String = "", simulatesAskToBuyInSandbox: Bool = false, completion: @escaping ( PurchaseResult) -> Void) -> InAppProductRequest {
-
+        
         return retrieveProductsInfo(Set([productId])) { result -> Void in
             if let product = result.retrievedProducts.first {
                 self.purchase(product: product, quantity: quantity, atomically: atomically, applicationUsername: applicationUsername, simulatesAskToBuyInSandbox: simulatesAskToBuyInSandbox, completion: completion)
@@ -63,33 +63,33 @@ public class SwiftyStoreKit {
             }
         }
     }
-
+    
     fileprivate func purchase(product: SKProduct, quantity: Int, atomically: Bool, applicationUsername: String = "", simulatesAskToBuyInSandbox: Bool = false, paymentDiscount: PaymentDiscount? = nil, completion: @escaping (PurchaseResult) -> Void) {
         paymentQueueController.startPayment(Payment(product: product, paymentDiscount: paymentDiscount, quantity: quantity, atomically: atomically, applicationUsername: applicationUsername, simulatesAskToBuyInSandbox: simulatesAskToBuyInSandbox) { result in
             
             completion(self.processPurchaseResult(result))
         })
     }
-
+    
     fileprivate func restorePurchases(atomically: Bool = true, applicationUsername: String = "", completion: @escaping (RestoreResults) -> Void) {
-
+        
         paymentQueueController.restorePurchases(RestorePurchases(atomically: atomically, applicationUsername: applicationUsername) { results in
-
+            
             let results = self.processRestoreResults(results)
             completion(results)
         })
     }
-
+    
     fileprivate func completeTransactions(atomically: Bool = true, completion: @escaping ([Purchase]) -> Void) {
-
+        
         paymentQueueController.completeTransactions(CompleteTransactions(atomically: atomically, callback: completion))
     }
-
+    
     fileprivate func finishTransaction(_ transaction: PaymentTransaction) {
-
+        
         paymentQueueController.finishTransaction(transaction)
     }
-
+    
     private func processPurchaseResult(_ result: TransactionResult) -> PurchaseResult {
         switch result {
         case .purchased(let purchase):
@@ -100,7 +100,7 @@ public class SwiftyStoreKit {
             return .error(error: storeInternalError(description: "Cannot restore product \(purchase.productId) from purchase path"))
         }
     }
-
+    
     private func processRestoreResults(_ results: [TransactionResult]) -> RestoreResults {
         var restoredPurchases: [Purchase] = []
         var restoreFailedPurchases: [(SKError, String?)] = []
@@ -117,7 +117,7 @@ public class SwiftyStoreKit {
         }
         return RestoreResults(restoredPurchases: restoredPurchases, restoreFailedPurchases: restoreFailedPurchases)
     }
-
+    
     private func storeInternalError(code: SKError.Code = SKError.unknown, description: String = "") -> SKError {
         let error = NSError(domain: SKErrorDomain, code: code.rawValue, userInfo: [ NSLocalizedDescriptionKey: description ])
         return SKError(_nsError: error)
@@ -125,101 +125,88 @@ public class SwiftyStoreKit {
 }
 
 extension SwiftyStoreKit {
-
+    
     // MARK: Singleton
     fileprivate static let sharedInstance = SwiftyStoreKit()
-
+    
     // MARK: Public methods - Purchases
     
-    /**
-     * Return NO if this device is not able or allowed to make payments
-     */
+    /// Check if the current device can make payments.
+    /// - returns: `false` if this device is not able or allowed to make payments
     public class var canMakePayments: Bool {
         return SKPaymentQueue.canMakePayments()
     }
-
-    /**
-     *  Retrieve products information
-     *  - Parameter productIds: The set of product identifiers to retrieve corresponding products for
-     *  - Parameter completion: handler for result
-     */
+    
+    /// Retrieve products information
+    /// - Parameter productIds: The set of product identifiers to retrieve corresponding products for
+    /// - Parameter completion: handler for result
+    /// - returns: A cancellable `InAppRequest` object 
     @discardableResult
     public class func retrieveProductsInfo(_ productIds: Set<String>, completion: @escaping (RetrieveResults) -> Void) -> InAppRequest {
-
         return sharedInstance.retrieveProductsInfo(productIds, completion: completion)
     }
-
-    /**
-     *  Purchase a product
-     *  - Parameter productId: productId as specified in iTunes Connect
-     *  - Parameter quantity: quantity of the product to be purchased
-     *  - Parameter atomically: whether the product is purchased atomically (e.g. finishTransaction is called immediately)
-     *  - Parameter applicationUsername: an opaque identifier for the user’s account on your system
-     *  - Parameter completion: handler for result
-     */
+    
+    /// Purchase a product
+    ///  - Parameter productId: productId as specified in App Store Connect
+    ///  - Parameter quantity: quantity of the product to be purchased
+    ///  - Parameter atomically: whether the product is purchased atomically (e.g. `finishTransaction` is called immediately)
+    ///  - Parameter applicationUsername: an opaque identifier for the user’s account on your system
+    ///  - Parameter completion: handler for result
+    ///  - returns: A cancellable `InAppRequest` object   
     @discardableResult
     public class func purchaseProduct(_ productId: String, quantity: Int = 1, atomically: Bool = true, applicationUsername: String = "", simulatesAskToBuyInSandbox: Bool = false, completion: @escaping (PurchaseResult) -> Void) -> InAppRequest {
-
+        
         return sharedInstance.purchaseProduct(productId, quantity: quantity, atomically: atomically, applicationUsername: applicationUsername, simulatesAskToBuyInSandbox: simulatesAskToBuyInSandbox, completion: completion)
     }
     
-    /**
-     *  Purchase a product
-     *  - Parameter product: product to be purchased
-     *  - Parameter quantity: quantity of the product to be purchased
-     *  - Parameter atomically: whether the product is purchased atomically (e.g. finishTransaction is called immediately)
-     *  - Parameter applicationUsername: an opaque identifier for the user’s account on your system
-     *  - Parameter product: optional discount to be applied. Must be SKProductPayment type
-     *  - Parameter completion: handler for result
-     */
+    /// Purchase a product
+    ///  - Parameter product: product to be purchased
+    ///  - Parameter quantity: quantity of the product to be purchased
+    ///  - Parameter atomically: whether the product is purchased atomically (e.g. `finishTransaction` is called immediately)
+    ///  - Parameter applicationUsername: an opaque identifier for the user’s account on your system
+    ///  - Parameter product: optional discount to be applied. Must be of `SKProductPayment` type
+    ///  - Parameter completion: handler for result
     public class func purchaseProduct(_ product: SKProduct, quantity: Int = 1, atomically: Bool = true, applicationUsername: String = "", simulatesAskToBuyInSandbox: Bool = false, paymentDiscount: PaymentDiscount? = nil, completion: @escaping ( PurchaseResult) -> Void) {
         
         sharedInstance.purchase(product: product, quantity: quantity, atomically: atomically, applicationUsername: applicationUsername, simulatesAskToBuyInSandbox: simulatesAskToBuyInSandbox, paymentDiscount: paymentDiscount, completion: completion)
     }
-
-    /**
-     *  Restore purchases
-     *  - Parameter atomically: whether the product is purchased atomically (e.g. finishTransaction is called immediately)
-     *  - Parameter applicationUsername: an opaque identifier for the user’s account on your system
-     *  - Parameter completion: handler for result
-     */
+    
+    /// Restore purchases
+    ///  - Parameter atomically: whether the product is purchased atomically (e.g. `finishTransaction` is called immediately)
+    ///  - Parameter applicationUsername: an opaque identifier for the user’s account on your system
+    ///  - Parameter completion: handler for result
     public class func restorePurchases(atomically: Bool = true, applicationUsername: String = "", completion: @escaping (RestoreResults) -> Void) {
-
+        
         sharedInstance.restorePurchases(atomically: atomically, applicationUsername: applicationUsername, completion: completion)
     }
-
-    /**
-     *  Complete transactions
-     *  - Parameter atomically: whether the product is purchased atomically (e.g. finishTransaction is called immediately)
-     *  - Parameter completion: handler for result
-     */
+    
+    /// Complete transactions
+    ///  - Parameter atomically: whether the product is purchased atomically (e.g. `finishTransaction` is called immediately)
+    ///  - Parameter completion: handler for result
     public class func completeTransactions(atomically: Bool = true, completion: @escaping ([Purchase]) -> Void) {
-
+        
         sharedInstance.completeTransactions(atomically: atomically, completion: completion)
     }
-
-    /**
-     *  Finish a transaction
-     *  Once the content has been delivered, call this method to finish a transaction that was performed non-atomically
-     *  - Parameter transaction: transaction to finish
-     */
+    
+    /// Finish a transaction
+    /// 
+    /// Once the content has been delivered, call this method to finish a transaction that was performed non-atomically
+    /// - Parameter transaction: transaction to finish
     public class func finishTransaction(_ transaction: PaymentTransaction) {
-
+        
         sharedInstance.finishTransaction(transaction)
     }
     
-    /**
-     * Register a handler for SKPaymentQueue.shouldAddStorePayment delegate method in iOS 11
-     */
+    /// Register a handler for `SKPaymentQueue.shouldAddStorePayment` delegate method.
+    /// - requires: iOS 11.0+
     public static var shouldAddStorePaymentHandler: ShouldAddStorePaymentHandler? {
         didSet {
             sharedInstance.paymentQueueController.shouldAddStorePaymentHandler = shouldAddStorePaymentHandler
         }
     }
     
-    /**
-     * Register a handler for paymentQueue(_:updatedDownloads:)
-     */
+    /// Register a handler for `paymentQueue(_:updatedDownloads:)`
+    /// - seealso: `paymentQueue(_:updatedDownloads:)`
     public static var updatedDownloadsHandler: UpdatedDownloadsHandler? {
         didSet {
             sharedInstance.paymentQueueController.updatedDownloadsHandler = updatedDownloadsHandler
@@ -241,62 +228,56 @@ extension SwiftyStoreKit {
 }
 
 extension SwiftyStoreKit {
-
+    
     // MARK: Public methods - Receipt verification
-
-    /**
-     * Return receipt data from the application bundle. This is read from Bundle.main.appStoreReceiptURL
-     */
+    
+    /// Return receipt data from the application bundle. This is read from `Bundle.main.appStoreReceiptURL`.
     public static var localReceiptData: Data? {
         return sharedInstance.receiptVerificator.appStoreReceiptData
     }
-
-    /**
-     *  Verify application receipt
-     *  - Parameter validator: receipt validator to use
-     *  - Parameter forceRefresh: If true, refreshes the receipt even if one already exists.
-     *  - Parameter completion: handler for result
-     */
+    
+    /// Verify application receipt
+    /// - Parameter validator: receipt validator to use
+    /// - Parameter forceRefresh: If `true`, refreshes the receipt even if one already exists.
+    /// - Parameter completion: handler for result
+    /// - returns: A cancellable `InAppRequest` object 
     @discardableResult
     public class func verifyReceipt(using validator: ReceiptValidator, forceRefresh: Bool = false, completion: @escaping (VerifyReceiptResult) -> Void) -> InAppRequest? {
-
+        
         return sharedInstance.receiptVerificator.verifyReceipt(using: validator, forceRefresh: forceRefresh, completion: completion)
     }
-
-    /**
-     *  Fetch application receipt
-     *  - Parameter forceRefresh: If true, refreshes the receipt even if one already exists.
-     *  - Parameter completion: handler for result
-     */
+    
+    /// Fetch application receipt
+    /// - Parameter forceRefresh: If true, refreshes the receipt even if one already exists.
+    /// - Parameter completion: handler for result
+    /// - returns: A cancellable `InAppRequest` object 
     @discardableResult
     public class func fetchReceipt(forceRefresh: Bool, completion: @escaping (FetchReceiptResult) -> Void) -> InAppRequest? {
-    
+        
         return sharedInstance.receiptVerificator.fetchReceipt(forceRefresh: forceRefresh, completion: completion)
     }
     
-    /**
-     *  Verify the purchase of a Consumable or NonConsumable product in a receipt
-     *  - Parameter productId: the product id of the purchase to verify
-     *  - Parameter inReceipt: the receipt to use for looking up the purchase
-     *  - return: either notPurchased or purchased
-     */
+    ///  Verify the purchase of a Consumable or NonConsumable product in a receipt
+    ///  - Parameter productId: the product id of the purchase to verify
+    ///  - Parameter inReceipt: the receipt to use for looking up the purchase
+    ///  - returns: A `VerifyPurchaseResult`, which may be either `notPurchased` or `purchased`.
     public class func verifyPurchase(productId: String, inReceipt receipt: ReceiptInfo) -> VerifyPurchaseResult {
-
+        
         return InAppReceipt.verifyPurchase(productId: productId, inReceipt: receipt)
     }
-
+    
     /**
      *  Verify the validity of a subscription (auto-renewable, free or non-renewing) in a receipt.
      *
      *  This method extracts all transactions matching the given productId and sorts them by date in descending order. It then compares the first transaction expiry date against the receipt date to determine its validity.
-     *  - Parameter type: .autoRenewable or .nonRenewing.
+     *  - Parameter type: `.autoRenewable` or `.nonRenewing`.
      *  - Parameter productId: The product id of the subscription to verify.
      *  - Parameter receipt: The receipt to use for looking up the subscription.
      *  - Parameter validUntil: Date to check against the expiry date of the subscription. This is only used if a date is not found in the receipt.
-     *  - return: Either .notPurchased or .purchased / .expired with the expiry date found in the receipt.
+     *  - returns: Either `.notPurchased` or `.purchased` / `.expired` with the expiry date found in the receipt.
      */
     public class func verifySubscription(ofType type: SubscriptionType, productId: String, inReceipt receipt: ReceiptInfo, validUntil date: Date = Date()) -> VerifySubscriptionResult {
-
+        
         return InAppReceipt.verifySubscriptions(ofType: type, productIds: [productId], inReceipt: receipt, validUntil: date)
     }
     
@@ -306,26 +287,24 @@ extension SwiftyStoreKit {
      *  This method extracts all transactions matching the given productIds and sorts them by date in descending order. It then compares the first transaction expiry date against the receipt date, to determine its validity.
      *  - Note: You can use this method to check the validity of (mutually exclusive) subscriptions in a subscription group.
      *  - Remark: The type parameter determines how the expiration dates are calculated for all subscriptions. Make sure all productIds match the specified subscription type to avoid incorrect results.
-     *  - Parameter type: .autoRenewable or .nonRenewing.
-     *  - Parameter productIds: The product ids of the subscriptions to verify.
+     *  - Parameter type: `.autoRenewable` or `.nonRenewing`.
+     *  - Parameter productIds: The product IDs of the subscriptions to verify.
      *  - Parameter receipt: The receipt to use for looking up the subscriptions
      *  - Parameter validUntil: Date to check against the expiry date of the subscriptions. This is only used if a date is not found in the receipt.
-     *  - return: Either .notPurchased or .purchased / .expired with the expiry date found in the receipt.
+     *  - returns: Either `.notPurchased` or `.purchased` / `.expired` with the expiry date found in the receipt.
      */
     public class func verifySubscriptions(ofType type: SubscriptionType = .autoRenewable, productIds: Set<String>, inReceipt receipt: ReceiptInfo, validUntil date: Date = Date()) -> VerifySubscriptionResult {
-
+        
         return InAppReceipt.verifySubscriptions(ofType: type, productIds: productIds, inReceipt: receipt, validUntil: date)
     }
     
-    /**
-     *  Get the distinct product identifiers from receipt.
-     *
-     *  This Method extracts all product identifiers. (Including cancelled ones).
-     *  - Note: You can use this method to get all unique product identifiers from receipt.
-     *  - Parameter type: .autoRenewable or .nonRenewing.
-     *  - Parameter receipt: The receipt to use for looking upproduct identifiers.
-     *  - return: Either Set<String> or nil.
-     */
+    ///  Get the distinct product identifiers from receipt.
+    ///
+    /// This Method extracts all product identifiers. (Including cancelled ones).
+    /// - Note: You can use this method to get all unique product identifiers from receipt.
+    /// - Parameter type: `.autoRenewable` or `.nonRenewing`.
+    /// - Parameter receipt: The receipt to use for looking up product identifiers.
+    /// - returns: Either `Set<String>` or `nil`.
     public class func getDistinctPurchaseIds(ofType type: SubscriptionType = .autoRenewable, inReceipt receipt: ReceiptInfo) -> Set<String>? {
         
         return InAppReceipt.getDistinctPurchaseIds(ofType: type, inReceipt: receipt)

+ 1 - 0
SwiftyStoreKitTests/InAppReceiptTests.swift

@@ -35,6 +35,7 @@ private extension TimeInterval {
 extension ReceiptItem: Equatable {
 
     init(productId: String, purchaseDate: Date, subscriptionExpirationDate: Date? = nil, cancellationDate: Date? = nil, isTrialPeriod: Bool = false, isInIntroOfferPeriod: Bool = false) {
+        self.init(productId: productId, quantity: 1, transactionId: UUID().uuidString, originalTransactionId: UUID().uuidString, purchaseDate: purchaseDate, originalPurchaseDate: purchaseDate, webOrderLineItemId: UUID().uuidString, subscriptionExpirationDate: subscriptionExpirationDate, cancellationDate: cancellationDate, isTrialPeriod: isTrialPeriod, isInIntroOfferPeriod: isInIntroOfferPeriod)
         self.productId = productId
         self.quantity = 1
         self.purchaseDate = purchaseDate

+ 0 - 12
SwiftyStoreKitTests/PaymentQueueControllerTests.swift

@@ -28,18 +28,6 @@ import XCTest
 import StoreKit
 @testable import SwiftyStoreKit
 
-extension Payment {
-    init(product: SKProduct, paymentDiscount: PaymentDiscount, quantity: Int, atomically: Bool, applicationUsername: String, simulatesAskToBuyInSandbox: Bool, callback: @escaping (TransactionResult) -> Void) {
-        self.paymentDiscount = paymentDiscount
-        self.product = product
-        self.quantity = quantity
-        self.atomically = atomically
-        self.applicationUsername = applicationUsername
-        self.simulatesAskToBuyInSandbox = simulatesAskToBuyInSandbox
-        self.callback = callback
-    }
-}
-
 class PaymentQueueControllerTests: XCTestCase {
 
     // MARK: init/deinit