Skip to content

Commit

Permalink
Search for offer only if it is not empty (#530)
Browse files Browse the repository at this point in the history
* Search for offer only if it is not empty

* Comment upd

* Comments upd
  • Loading branch information
SpertsyanKM authored Dec 11, 2023
1 parent abe2a05 commit 8cb5447
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.qonversion.android.sdk.dto.products.QProductStoreDetails
* If [offerId] is not specified, then the default offer will be applied. To know how we choose
* the default offer, see [QProductStoreDetails.defaultSubscriptionOfferDetails].
*
* To prevent applying any offer to the purchase (use only bare base plan),
* If you want to remove any intro/trial offer from the purchase (use only bare base plan),
* call the [removeOffer] method.
*/
data class QPurchaseModel(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.qonversion.android.sdk.dto.products.QProductStoreDetails
* If [offerId] is not specified, then the default offer will be applied. To know how we choose
* the default offer, see [QProductStoreDetails.defaultSubscriptionOfferDetails].
*
* To prevent applying any offer to the purchase (use only bare base plan),
* If you want to remove any intro/trial offer from the purchase (use only bare base plan),
* call the [QPurchaseModel.removeOffer] method.
*
* If the [updatePolicy] is not provided, then default one
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data class QProductInAppDetails(
val originalOneTimePurchaseOfferDetails: OneTimePurchaseOfferDetails
) {
/**
* The price of an in-app product.
* The price of the in-app product.
*/
val price: QProductPrice = originalOneTimePurchaseOfferDetails.let {
QProductPrice(it.priceAmountMicros, it.priceCurrencyCode, it.formattedPrice)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@ data class QProductStoreDetails(
val basePlanId: String?,
) {
/**
* Identifier of a subscription or an in-app product.
* Identifier of the subscription or the in-app product.
*/
val productId: String = originalProductDetails.productId

/**
* Name of a subscription or an in-app product.
* Name of the subscription or the in-app product.
*/
val name: String = originalProductDetails.name

/**
* Title of a subscription or an in-app product.
* Title of the subscription or the in-app product.
* The title includes the name of the app.
*/
val title: String = originalProductDetails.title

/**
* Description of a subscription or an in-app product.
* Description of the subscription or the in-app product.
*/
val description: String = originalProductDetails.description

/**
* Offer details for a subscription.
* Offer details for the subscription.
* Offer details contain all the available variations of purchase offers,
* including both base plan and eligible base plan + offer combinations
* from Google Play Console for current [basePlanId].
Expand All @@ -68,7 +68,7 @@ data class QProductStoreDetails(
subscriptionOfferDetails?.firstOrNull { it.pricingPhases.size == 1 }

/**
* Offer details for an in-app product.
* Offer details for the in-app product.
* Null for subscriptions.
*/
val inAppOfferDetails: QProductInAppDetails? =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data class QSubscriptionPeriod(
val unit: Unit,

/**
* ISO 8601 representation of the period.
* ISO 8601 representation of the period, e.g. "P7D", meaning 7 days period.
*/
val iso: String
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ internal class BillingClientWrapper(
return
}
}
offerId != null -> {
offerId?.isNotEmpty() == true -> {
storeDetails.findOffer(offerId) ?: run {
fireError("Failed to find offer $offerId for Qonversion product ${product.qonversionID}")
return
Expand Down

0 comments on commit 8cb5447

Please sign in to comment.