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.
Do we need this? Should restorePurchases by definition be same as allPurchases?
| syncPurchaseWithChargebee(CBRestorePurchaseManager.allTransactions) | ||
| } else { | ||
| restorePurchaseCallBack.onSuccess(activePurchases) | ||
| syncPurchaseWithChargebee(CBRestorePurchaseManager.activeTransactions) |
| javaClass.simpleName, | ||
| "Exception from Server - validateReceipt() : ${it.exp.message}" | ||
| ) | ||
| } |
There was a problem hiding this comment.
How could this be conveyed to the app?
There was a problem hiding this comment.
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.
Can we treat this as an enum?
| val introductoryPrice: String?, | ||
| val introductoryPriceAmountMicros: Long?, | ||
| val introductoryPricePeriod: Int?, | ||
| val introductoryOfferType: String? |
There was a problem hiding this comment.
Can we treat this as an enum?
And are all of these values need to be optional?
| var offerDetail = OfferDetail( introductoryPrice = "", | ||
| introductoryPriceAmountMicros = 0, | ||
| introductoryPricePeriod = 0, | ||
| introductoryOfferType = "") |
There was a problem hiding this comment.
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.
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.
Are these values mandatory for the API?
There was a problem hiding this comment.
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: