-
Notifications
You must be signed in to change notification settings - Fork 7
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
Introductory offer price support #71
base: master
Are you sure you want to change the base?
Conversation
… into feature/introductory_offer � Conflicts: � chargebee/src/test/java/com/chargebee/android/billingservice/BillingClientManagerTest.kt
val allPurchases = restorePurchases.filter { subscription -> | ||
subscription.storeStatus == StoreStatus.Active.value || subscription.storeStatus == StoreStatus.InTrial.value | ||
|| subscription.storeStatus == StoreStatus.Cancelled.value || subscription.storeStatus == StoreStatus.Paused.value | ||
} |
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.
Do we need this? Should restorePurchases
by definition be same as allPurchases
?
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.
Done
syncPurchaseWithChargebee(CBRestorePurchaseManager.allTransactions) | ||
} else { | ||
restorePurchaseCallBack.onSuccess(activePurchases) | ||
syncPurchaseWithChargebee(CBRestorePurchaseManager.activeTransactions) |
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.
nit: alignment
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.
Done!
javaClass.simpleName, | ||
"Exception from Server - validateReceipt() : ${it.exp.message}" | ||
) | ||
} |
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.
How could this be conveyed to the app?
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.
We are just doing sync purchase. this not required to be notified to user.
if (product.skuDetails.introductoryPrice.isNotEmpty()) { | ||
val subscriptionPeriod = product.skuDetails.introductoryPricePeriod | ||
if (product.skuDetails.introductoryPriceCycles == 1) { | ||
introductoryOfferType = "pay_up_front" |
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 treat this as an enum?
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.
Done
val introductoryPrice: String?, | ||
val introductoryPriceAmountMicros: Long?, | ||
val introductoryPricePeriod: Int?, | ||
val introductoryOfferType: String? |
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 treat this as an enum?
And are all of these values need to be optional?
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.
Done!
var offerDetail = OfferDetail( introductoryPrice = "", | ||
introductoryPriceAmountMicros = 0, | ||
introductoryPricePeriod = 0, | ||
introductoryOfferType = "") |
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.
Do we need to return this offerdetail even for cases where there are no offers? Can we return and optional empty instead?
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.
yes, made changes accordingly.
"channel" to this.channel, | ||
"introductory_offer[price]" to this.offerDetail.introductoryPriceAmountMicros.toString(), | ||
"introductory_offer[type]" to this.offerDetail.introductoryOfferType, | ||
"introductory_offer[period]" to this.offerDetail.introductoryPricePeriod.toString() |
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.
Are these values mandatory for the API?
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.
Not mandatory for this API. if no offers associated for the plans yes we can ignore it. thanks @cb-haripriyan
Kudos, SonarCloud Quality Gate passed!
|
Feature: