Skip to content

Conversation

@cb-gadagoju
Copy link
Contributor

Improvements :

  • customerId is not handled in Purchase API return handler, updated now handled the customerId for the Purchase API handler.
  • Cleared swift lint warning issues in few files.

…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)?
Copy link
Contributor

@cb-haripriyan cb-haripriyan Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
12.5% 12.5% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

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)?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this from the major version.

// MARK: - Subscription
public struct PurchaseSubscription: Decodable {
public let status: Bool
public let subscriptionDetails: CBValidateReceipt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants