customerId is returned in Purchase API handler#83
customerId is returned in Purchase API handler#83cb-gadagoju wants to merge 3 commits intochargebee:masterfrom
Conversation
…dled and also in view files cleared SwiftLint warning issues
| private var productIDs: [String] = [] | ||
| public var receiveProductsHandler: ((_ result: Result<[CBProduct], CBPurchaseError>) -> Void)? | ||
| public var buyProductHandler: ((Result<(status:Bool, subscriptionId:String?, planId:String?), Error>) -> Void)? | ||
| public var buyProductHandler: ((Result<(status: Bool, subscriptionId: String?, planId: String?, customerId: String?), Error>) -> Void)? |
There was a problem hiding this comment.
Would this be a breaking change. Is there anything we can do to reduce the impact?
Also would prefer this tuple be a type/alias instead.
There was a problem hiding this comment.
Would this be a breaking change. Is there anything we can do to reduce the impact? Also would prefer this tuple be a type/alias instead.
Updated with struct
|
SonarCloud Quality Gate failed.
|
| private var productIDs: [String] = [] | ||
| public var receiveProductsHandler: ((_ result: Result<[CBProduct], CBPurchaseError>) -> Void)? | ||
| public var buyProductHandler: ((Result<(status:Bool, subscriptionId:String?, planId:String?), Error>) -> Void)? | ||
| private var buyProductHandler: ((Result<PurchaseSubscription, Error>) -> Void)? |
There was a problem hiding this comment.
Should this be just Subscription?
| @available(*, deprecated, message: "This will be removed in upcoming versions, Please use this API func purchaseProduct(product: CBProduct, customer : CBCustomer? = nil, completion)") | ||
| func purchaseProduct(product: CBProduct, customerId : String? = "",completion handler: @escaping ((_ result: Result<(status:Bool, subscriptionId:String?, planId:String?), Error>) -> Void)) { | ||
| func purchaseProduct(product: CBProduct, customerId: String? = "", completion handler: @escaping ((_ result: Result<PurchaseSubscription, Error>) -> Void)) { | ||
| buyProductHandler = handler |
There was a problem hiding this comment.
We can remove this from the major version.
| // MARK: - Subscription | ||
| public struct PurchaseSubscription: Decodable { | ||
| public let status: Bool | ||
| public let subscriptionDetails: CBValidateReceipt |
There was a problem hiding this comment.
Any reason that we want to have subscriptionDetails here? IMO this struct is related to subscription and any details can be here itself. Check with NonSubscription










Improvements :