-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NextOffet Value is Handled for Retrieve Subscriptions API #80
NextOffet Value is Handled for Retrieve Subscriptions API #80
Conversation
…properly its handled now new handler and old method mentioned as deprecated
if data.list.isEmpty { | ||
onError(CBError.defaultSytemError(statusCode: 404, message: "Subscription Not found")) | ||
}else { | ||
onSuccess(CBSubscriptionWrapper.init(list: data.list, nextOffset: data.nextOffset)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to create a new CBSubscriptionWrapper
here? Can we not just pass data
or am I missing anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier we have only SubscriptionList in the handler but now offset value also we have to pass ,so i created a struct CBSubscriptionWrapper and the handler ((CBResult<CBSubscriptionWrapper>)
)is expecting CBSubscriptionWrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please verify again. the type of data
is already CBSubscriptionWrapper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please verify again. the type of
data
is alreadyCBSubscriptionWrapper
yes update data is same type!
|
||
public func retrieveSubscriptionsList(queryParams: [String: String]? = nil, handler: @escaping RetrieveSubscriptionHandler) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can we not use retrieveSubscriptions
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the return handler is different from previous one could not able to mark it as deprecated with the same existing method name retrieveSubscriptions so added new method name retrieveSubscriptionsList
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please verify this again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
due to some problem in Xcode it didn't reflected in my machine but now its working as expected refactored the name and reverted back with existing name retrieveSubscriptions
Thanks !
|
||
public func retrieveSubscriptionsList(queryParams: [String: String]? = nil, handler: @escaping RetrieveSubscriptionHandler) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please verify this again?
if data.list.isEmpty { | ||
onError(CBError.defaultSytemError(statusCode: 404, message: "Subscription Not found")) | ||
}else { | ||
onSuccess(CBSubscriptionWrapper.init(list: data.list, nextOffset: data.nextOffset)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please verify again. the type of data
is already CBSubscriptionWrapper
…g name for new method also
…it(list: data.list, nextOffset: data.nextOffset))" to this "onSuccess(data)"
public func retrieveSubscriptions(queryParams: [String: String]? = nil, handler: @escaping RetrieveSubscriptionHandler) { | ||
let logger = CBLogger(name: "Subscription", action: "Fetch Subscription using customerId") | ||
logger.info() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update the README as well?
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Overview:
Next Offset value is not handled for
retrieveSubscriptions
Methodin this Pr we handled it and added a new public method
retrieveSubscriptionsList
since the return handler is different from previous one could not able to mark it as deprecated on the existing method nameretrieveSubscriptions
so added new method name.Changes made in files
CBSubscriptionManager
andChargebee
and updated example App with the latest method.