|
@@ -64,8 +64,8 @@ public class SwiftyStoreKit {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- fileprivate func purchase(product: SKProduct, quantity: Int, atomically: Bool, applicationUsername: String = "", simulatesAskToBuyInSandbox: Bool = false, completion: @escaping (PurchaseResult) -> Void) {
|
|
|
|
- paymentQueueController.startPayment(Payment(product: product, quantity: quantity, atomically: atomically, applicationUsername: applicationUsername, simulatesAskToBuyInSandbox: simulatesAskToBuyInSandbox) { result in
|
|
|
|
|
|
+ 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))
|
|
completion(self.processPurchaseResult(result))
|
|
})
|
|
})
|
|
@@ -167,11 +167,12 @@ extension SwiftyStoreKit {
|
|
* - Parameter quantity: quantity of the 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 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 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
|
|
* - Parameter completion: handler for result
|
|
*/
|
|
*/
|
|
- public class func purchaseProduct(_ product: SKProduct, quantity: Int = 1, atomically: Bool = true, applicationUsername: String = "", simulatesAskToBuyInSandbox: Bool = false, completion: @escaping ( PurchaseResult) -> Void) {
|
|
|
|
|
|
+ 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, completion: completion)
|
|
|
|
|
|
+ sharedInstance.purchase(product: product, quantity: quantity, atomically: atomically, applicationUsername: applicationUsername, simulatesAskToBuyInSandbox: simulatesAskToBuyInSandbox, paymentDiscount: paymentDiscount, completion: completion)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|