Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9112ef5
add addOnStoreProduts to Purchase Params (#1514)
fire-at-will Nov 4, 2025
0a3b0ed
Merge branch 'main' into addOns-dev
fire-at-will Nov 4, 2025
f8251b9
Support addOnSubscriptionOptions in PurchaseParams (#1523)
fire-at-will Nov 5, 2025
06c9de5
clean up purchase tester message
fire-at-will Nov 5, 2025
6d1e44e
Merge branch 'main' into addOns-dev
fire-at-will Nov 5, 2025
42226d2
Merge branch 'main' into addOns-dev
fire-at-will Nov 5, 2025
5047020
Merge branch 'main' into addOns-dev
fire-at-will Nov 17, 2025
706dcf5
Merge branch 'main' into addOns-dev
fire-at-will Nov 18, 2025
d23acf3
Merge branch 'main' into addOns-dev
fire-at-will Nov 20, 2025
5646e26
Support Purchasing Packages as Add-Ons (#1545)
fire-at-will Nov 21, 2025
c187cad
Merge branch 'main' into addOns-dev
fire-at-will Nov 21, 2025
8d3475e
Merge branch 'main' into addOns-dev
fire-at-will Dec 2, 2025
7f8809a
Merge branch 'main' into addOns-dev
fire-at-will Dec 7, 2025
e4e9caf
Merge branch 'main' into addOns-dev
fire-at-will Dec 15, 2025
93edb00
Merge branch 'main' into addOns-dev
fire-at-will Dec 18, 2025
53d4d66
Merge branch 'main' into addOns-dev
fire-at-will Jan 5, 2026
53fec3e
Merge branch 'main' into addOns-dev
fire-at-will Jan 14, 2026
d0b019c
Merge branch 'main' into addOns-dev
fire-at-will Jan 22, 2026
f63b4e6
Merge branch 'main' into addOns-dev
fire-at-will Jan 29, 2026
da8b5ed
Merge branch 'main' into addOns-dev
fire-at-will Jan 30, 2026
e0d9677
Merge branch 'main' into addOns-dev
fire-at-will Feb 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,25 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
Boolean googleIsPersonalizedPrice = call.argument("googleIsPersonalizedPrice");
type = call.argument("type");
Map<String, Object> presentedOfferingContext = call.argument("presentedOfferingContext");
List<Map<String, Object>> addOnStoreProducts = call.argument("addOnStoreProducts");
List<Map<String, Object>> addOnSubscriptionOptions = call.argument("addOnSubscriptionOptions");
List<Map<String, Object>> addOnPackages = call.argument("addOnPackages");
purchaseProduct(productIdentifier, type, googleOldProductIdentifer, googleProrationMode,
googleIsPersonalizedPrice, presentedOfferingContext, result);
googleIsPersonalizedPrice, presentedOfferingContext, addOnStoreProducts,
addOnSubscriptionOptions, addOnPackages, result);
break;
case "purchasePackage":
String packageIdentifier = call.argument("packageIdentifier");
presentedOfferingContext = call.argument("presentedOfferingContext");
googleOldProductIdentifer = call.argument("googleOldProductIdentifier");
googleProrationMode = call.argument("googleProrationMode");
googleIsPersonalizedPrice = call.argument("googleIsPersonalizedPrice");
addOnStoreProducts = call.argument("addOnStoreProducts");
addOnSubscriptionOptions = call.argument("addOnSubscriptionOptions");
addOnPackages = call.argument("addOnPackages");
purchasePackage(packageIdentifier, presentedOfferingContext, googleOldProductIdentifer,
googleProrationMode, googleIsPersonalizedPrice, result);
googleProrationMode, googleIsPersonalizedPrice, addOnStoreProducts,
addOnSubscriptionOptions, addOnPackages, result);
break;
case "purchaseSubscriptionOption":
productIdentifier = call.argument("productIdentifier");
Expand All @@ -175,8 +183,12 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
googleProrationMode = call.argument("googleProrationMode");
googleIsPersonalizedPrice = call.argument("googleIsPersonalizedPrice");
presentedOfferingContext = call.argument("presentedOfferingContext");
addOnStoreProducts = call.argument("addOnStoreProducts");
addOnSubscriptionOptions = call.argument("addOnSubscriptionOptions");
addOnPackages = call.argument("addOnPackages");
purchaseSubscriptionOption(productIdentifier, optionIdentifier, googleOldProductIdentifer,
googleProrationMode, googleIsPersonalizedPrice, presentedOfferingContext, result);
googleProrationMode, googleIsPersonalizedPrice, presentedOfferingContext,
addOnStoreProducts, addOnSubscriptionOptions, addOnPackages, result);
break;
case "getAppUserID":
getAppUserID(result);
Expand Down Expand Up @@ -476,6 +488,9 @@ private void purchaseProduct(final String productIdentifier,
@Nullable final Integer googleProrationMode,
@Nullable final Boolean googleIsPersonalizedPrice,
@Nullable final Map<String, Object> presentedOfferingContext,
@Nullable final List<Map<String, Object>> addOnStoreProducts,
@Nullable final List<Map<String, Object>> addOnSubscriptionOptions,
@Nullable final List<Map<String, Object>> addOnPackages,
final Result result) {
CommonKt.purchaseProduct(
activity,
Expand All @@ -486,14 +501,20 @@ private void purchaseProduct(final String productIdentifier,
googleProrationMode,
googleIsPersonalizedPrice,
presentedOfferingContext,
getOnResult(result));
getOnResult(result),
addOnStoreProducts,
addOnSubscriptionOptions,
addOnPackages);
}

private void purchasePackage(final String packageIdentifier,
final Map<String, Object> presentedOfferingContext,
final String googleOldProductId,
@Nullable final Integer googleProrationMode,
@Nullable final Boolean googleIsPersonalizedPrice,
@Nullable final List<Map<String, Object>> addOnStoreProducts,
@Nullable final List<Map<String, Object>> addOnSubscriptionOptions,
@Nullable final List<Map<String, Object>> addOnPackages,
final Result result) {
CommonKt.purchasePackage(
activity,
Expand All @@ -502,7 +523,10 @@ private void purchasePackage(final String packageIdentifier,
googleOldProductId,
googleProrationMode,
googleIsPersonalizedPrice,
getOnResult(result));
getOnResult(result),
addOnStoreProducts,
addOnSubscriptionOptions,
addOnPackages);
}

private void purchaseSubscriptionOption(final String productIdentifier,
Expand All @@ -511,6 +535,9 @@ private void purchaseSubscriptionOption(final String productIdentifier,
@Nullable final Integer googleProrationMode,
@Nullable final Boolean googleIsPersonalizedPrice,
@Nullable final Map<String, Object> presentedOfferingContext,
@Nullable final List<Map<String, Object>> addOnStoreProducts,
@Nullable final List<Map<String, Object>> addOnSubscriptionOptions,
@Nullable final List<Map<String, Object>> addOnPackages,
final Result result) {
CommonKt.purchaseSubscriptionOption(
activity,
Expand All @@ -520,7 +547,10 @@ private void purchaseSubscriptionOption(final String productIdentifier,
googleProrationMode,
googleIsPersonalizedPrice,
presentedOfferingContext,
getOnResult(result));
getOnResult(result),
addOnStoreProducts,
addOnSubscriptionOptions,
addOnPackages);
}

private void getAppUserID(final Result result) {
Expand Down
121 changes: 120 additions & 1 deletion api_tester/lib/api_tests/models/purchase_params_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class _PurchaseParamsApiTest {
PromotionalOffer? promotionalOffer,
WinBackOffer? winBackOffer,
String? customerEmail,
List<StoreProduct>? addOnStoreProducts,
List<SubscriptionOption>? addOnSubscriptionOptions,
List<Package>? addOnPackages,
) {
PurchaseParams purchaseParams = PurchaseParams.package(
package,
Expand Down Expand Up @@ -45,6 +48,44 @@ class _PurchaseParamsApiTest {
winBackOffer: winBackOffer,
customerEmail: customerEmail,
);
purchaseParams = PurchaseParams.package(
package,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
promotionalOffer: promotionalOffer,
winBackOffer: winBackOffer,
customerEmail: customerEmail,
addOnStoreProducts: addOnStoreProducts,
);
purchaseParams = PurchaseParams.package(
package,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
promotionalOffer: promotionalOffer,
winBackOffer: winBackOffer,
customerEmail: customerEmail,
addOnPackages: addOnPackages,
);
purchaseParams = PurchaseParams.package(
package,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
promotionalOffer: promotionalOffer,
winBackOffer: winBackOffer,
customerEmail: customerEmail,
addOnSubscriptionOptions: addOnSubscriptionOptions,
);
purchaseParams = PurchaseParams.package(
package,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
promotionalOffer: promotionalOffer,
winBackOffer: winBackOffer,
customerEmail: customerEmail,
addOnStoreProducts: addOnStoreProducts,
addOnSubscriptionOptions: addOnSubscriptionOptions,
addOnPackages: addOnPackages,
);
}

void _checkStoreProductConstructor(
Expand All @@ -54,6 +95,9 @@ class _PurchaseParamsApiTest {
PromotionalOffer? promotionalOffer,
WinBackOffer? winBackOffer,
String? customerEmail,
List<StoreProduct>? addOnStoreProducts,
List<SubscriptionOption>? addOnSubscriptionOptions,
List<Package>? addOnPackages,
) {
PurchaseParams purchaseParams = PurchaseParams.storeProduct(
storeProduct,
Expand Down Expand Up @@ -88,13 +132,54 @@ class _PurchaseParamsApiTest {
winBackOffer: winBackOffer,
customerEmail: customerEmail,
);
purchaseParams = PurchaseParams.storeProduct(
storeProduct,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
promotionalOffer: promotionalOffer,
winBackOffer: winBackOffer,
customerEmail: customerEmail,
addOnStoreProducts: addOnStoreProducts,
);
purchaseParams = PurchaseParams.storeProduct(
storeProduct,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
promotionalOffer: promotionalOffer,
winBackOffer: winBackOffer,
customerEmail: customerEmail,
addOnPackages: addOnPackages,
);
purchaseParams = PurchaseParams.storeProduct(
storeProduct,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
promotionalOffer: promotionalOffer,
winBackOffer: winBackOffer,
customerEmail: customerEmail,
addOnSubscriptionOptions: addOnSubscriptionOptions,
);
purchaseParams = PurchaseParams.storeProduct(
storeProduct,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
promotionalOffer: promotionalOffer,
winBackOffer: winBackOffer,
customerEmail: customerEmail,
addOnStoreProducts: addOnStoreProducts,
addOnSubscriptionOptions: addOnSubscriptionOptions,
addOnPackages: addOnPackages,
);
}

void _checkSubscriptionOptionConstructor(
SubscriptionOption subscriptionOption,
GoogleProductChangeInfo? googleProductChangeInfo,
bool? googleIsPersonalizedPrice,
String? customerEmail,
List<StoreProduct>? addOnStoreProducts,
List<SubscriptionOption>? addOnSubscriptionOptions,
List<Package>? addOnPackages,
) {
PurchaseParams purchaseParams = PurchaseParams.subscriptionOption(
subscriptionOption,
Expand All @@ -113,7 +198,38 @@ class _PurchaseParamsApiTest {
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
customerEmail: customerEmail,
);}
);
purchaseParams = PurchaseParams.subscriptionOption(
subscriptionOption,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
customerEmail: customerEmail,
addOnStoreProducts: addOnStoreProducts,
);
purchaseParams = PurchaseParams.subscriptionOption(
subscriptionOption,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
customerEmail: customerEmail,
addOnPackages: addOnPackages,
);
purchaseParams = PurchaseParams.subscriptionOption(
subscriptionOption,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
customerEmail: customerEmail,
addOnSubscriptionOptions: addOnSubscriptionOptions,
);
purchaseParams = PurchaseParams.subscriptionOption(
subscriptionOption,
googleProductChangeInfo: googleProductChangeInfo,
googleIsPersonalizedPrice: googleIsPersonalizedPrice,
customerEmail: customerEmail,
addOnStoreProducts: addOnStoreProducts,
addOnSubscriptionOptions: addOnSubscriptionOptions,
addOnPackages: addOnPackages,
);
}

void _checkProperties(PurchaseParams purchaseParams) {
Package? package = purchaseParams.package;
Expand All @@ -124,5 +240,8 @@ class _PurchaseParamsApiTest {
PromotionalOffer? promotionalOffer = purchaseParams.promotionalOffer;
WinBackOffer? winBackOffer = purchaseParams.winBackOffer;
String? customerEmail = purchaseParams.customerEmail;
List<StoreProduct>? addOnStoreProducts = purchaseParams.addOnStoreProducts;
List<SubscriptionOption>? addOnSubscriptionOptions = purchaseParams.addOnSubscriptionOptions;
List<Package>? addOnPackages = purchaseParams.addOnPackages;
}
}
42 changes: 42 additions & 0 deletions lib/models/purchase_params.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class PurchaseParams {
final PromotionalOffer? promotionalOffer;
final WinBackOffer? winBackOffer;
final String? customerEmail;
final List<StoreProduct>? addOnStoreProducts;
final List<SubscriptionOption>? addOnSubscriptionOptions;
final List<Package>? addOnPackages;

const PurchaseParams._(
this.package,
Expand All @@ -25,6 +28,9 @@ class PurchaseParams {
this.promotionalOffer,
this.winBackOffer,
this.customerEmail,
this.addOnStoreProducts,
this.addOnSubscriptionOptions,
this.addOnPackages,
);

/// Creates purchase parameters for a package.
Expand Down Expand Up @@ -52,13 +58,22 @@ class PurchaseParams {
/// [customerEmail] Web only. The email of the user. If undefined, RevenueCat
/// will ask the customer for their email.
///
/// [addOnStoreProducts] Play Store only. Add-on products to be purchased with the base item.
///
/// [addOnSubscriptionOptions] Play Store only. Add-on subscription options to be purchased with the base item.
///
/// [addOnPackages] Play Store only. Add-on packages to be purchased with the base item.
///
const PurchaseParams.package(
Package package, {
GoogleProductChangeInfo? googleProductChangeInfo,
bool? googleIsPersonalizedPrice,
PromotionalOffer? promotionalOffer,
WinBackOffer? winBackOffer,
String? customerEmail,
List<StoreProduct>? addOnStoreProducts,
List<SubscriptionOption>? addOnSubscriptionOptions,
List<Package>? addOnPackages,
}) : this._(
package,
null,
Expand All @@ -68,6 +83,9 @@ class PurchaseParams {
promotionalOffer,
winBackOffer,
customerEmail,
addOnStoreProducts,
addOnSubscriptionOptions,
addOnPackages,
);

/// Creates purchase parameters for a store product.
Expand Down Expand Up @@ -96,13 +114,22 @@ class PurchaseParams {
/// [customerEmail] Web only. The email of the user. If undefined, RevenueCat
/// will ask the customer for their email.
///
/// [addOnStoreProducts] Play Store only. Add-on products to be purchased with the base item.
///
/// [addOnSubscriptionOptions] Play Store only. Add-on subscription options to be purchased with the base item.
///
/// [addOnPackages] Play Store only. Add-on packages to be purchased with the base item.
///
const PurchaseParams.storeProduct(
StoreProduct storeProduct, {
GoogleProductChangeInfo? googleProductChangeInfo,
bool? googleIsPersonalizedPrice,
PromotionalOffer? promotionalOffer,
WinBackOffer? winBackOffer,
String? customerEmail,
List<StoreProduct>? addOnStoreProducts,
List<SubscriptionOption>? addOnSubscriptionOptions,
List<Package>? addOnPackages,
}) : this._(
null,
storeProduct,
Expand All @@ -112,6 +139,9 @@ class PurchaseParams {
promotionalOffer,
winBackOffer,
customerEmail,
addOnStoreProducts,
addOnSubscriptionOptions,
addOnPackages,
);

/// Creates purchase parameters for a subscription option. Google Play-only.
Expand All @@ -131,11 +161,20 @@ class PurchaseParams {
/// [customerEmail] Web only. The email of the user. If undefined, RevenueCat
/// will ask the customer for their email.
///
/// [addOnStoreProducts] Play Store only. Add-on products to be purchased with the base item.
///
/// [addOnSubscriptionOptions] Play Store only. Add-on subscription options to be purchased with the base item.
///
/// [addOnPackages] Play Store only. Add-on packages to be purchased with the base item.
///
const PurchaseParams.subscriptionOption(
SubscriptionOption subscriptionOption, {
GoogleProductChangeInfo? googleProductChangeInfo,
bool? googleIsPersonalizedPrice,
String? customerEmail,
List<StoreProduct>? addOnStoreProducts,
List<SubscriptionOption>? addOnSubscriptionOptions,
List<Package>? addOnPackages,
}) : this._(
null,
null,
Expand All @@ -145,5 +184,8 @@ class PurchaseParams {
null,
null,
customerEmail,
addOnStoreProducts,
addOnSubscriptionOptions,
addOnPackages,
);
}
Loading