Skip to content

Commit

Permalink
-Micro Price variable added in product price info
Browse files Browse the repository at this point in the history
-price currency code added
  • Loading branch information
hannanshahidfunsoltech committed Sep 12, 2024
1 parent f8a7045 commit f65721f
Show file tree
Hide file tree
Showing 4 changed files with 333 additions and 2 deletions.
318 changes: 318 additions & 0 deletions .idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions funsol-billing-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ afterEvaluate {
from components.release
groupId = 'com.github.Funsol-Projects'
artifactId = 'Funsol-Billing-Helper'
version = 'v1.0.8'
version = 'v1.0.9'
}
debug(MavenPublication) {
from components.debug
groupId = 'com.github.Funsol-Projects'
artifactId = 'Funsol-Billing-Helper'
version = 'v1.0.8'
version = 'v1.0.9'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ class FunSolBillingHelper(private val context: Context) {
productPrice.productBasePlanKey = ""
productPrice.productOfferKey = ""
productPrice.price = it.oneTimePurchaseOfferDetails?.formattedPrice.toString()
productPrice.priceMicro = it.oneTimePurchaseOfferDetails?.priceAmountMicros ?: 0L
productPrice.currencyCode = it.oneTimePurchaseOfferDetails?.priceCurrencyCode.toString()
productPrice.duration = "lifeTime"
priceList.add(productPrice)
} else {
Expand All @@ -534,6 +536,8 @@ class FunSolBillingHelper(private val context: Context) {
productPrice.productOfferKey = subIt.offerId.toString()
productPrice.price =
subIt.pricingPhases.pricingPhaseList.first().formattedPrice
productPrice.priceMicro = subIt.pricingPhases.pricingPhaseList.first().priceAmountMicros ?: 0L
productPrice.currencyCode = subIt.pricingPhases.pricingPhaseList.first().priceCurrencyCode.toString()
productPrice.duration =
subIt.pricingPhases.pricingPhaseList.first().billingPeriod
priceList.add(productPrice)
Expand Down Expand Up @@ -565,6 +569,8 @@ class FunSolBillingHelper(private val context: Context) {
productPrice.productBasePlanKey = subIt.basePlanId
productPrice.productOfferKey = subIt.offerId.toString()
productPrice.price = subIt.pricingPhases.pricingPhaseList.first().formattedPrice
productPrice.priceMicro = subIt.pricingPhases.pricingPhaseList.first().priceAmountMicros ?: 0L
productPrice.currencyCode = subIt.pricingPhases.pricingPhaseList.first().priceCurrencyCode.toString()
productPrice.duration = subIt.pricingPhases.pricingPhaseList.first().billingPeriod
return productPrice
}
Expand All @@ -577,6 +583,8 @@ class FunSolBillingHelper(private val context: Context) {
productPrice.productBasePlanKey = subIt.basePlanId
productPrice.productOfferKey = subIt.offerId.toString()
productPrice.price = subIt.pricingPhases.pricingPhaseList.first().formattedPrice
productPrice.priceMicro = subIt.pricingPhases.pricingPhaseList.first().priceAmountMicros ?: 0L
productPrice.currencyCode = subIt.pricingPhases.pricingPhaseList.first().priceCurrencyCode.toString()
productPrice.duration = subIt.pricingPhases.pricingPhaseList.first().billingPeriod
return productPrice
}
Expand Down Expand Up @@ -609,6 +617,9 @@ class FunSolBillingHelper(private val context: Context) {
productPrice.productOfferKey = ""
productPrice.price =
it.oneTimePurchaseOfferDetails?.formattedPrice.toString()

productPrice.priceMicro = it.oneTimePurchaseOfferDetails?.priceAmountMicros ?: 0L
productPrice.currencyCode = it.oneTimePurchaseOfferDetails?.priceCurrencyCode.toString()
productPrice.duration = "lifeTime"
return productPrice
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ data class ProductPriceInfo(
var type: String = "",
var duration: String = "",
var price: String = "",
var priceMicro: Long = 0L,
var currencyCode: String = "",
var productCompleteInfo: ProductDetails? = null
)

0 comments on commit f65721f

Please sign in to comment.