[in_app_purchase] Ensure the `introductoryPriceMicros` field is populated correctly. (#4364)
diff --git a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md
index 1a03ba2..7a998d0 100644
--- a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md
+++ b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.1.4+7
+
+* Ensure that the `SkuDetailsWrapper.introductoryPriceMicros` is populated correctly.
+
## 0.1.4+6
* Ensure that purchases correctly indicate whether they are acknowledged or not. The `PurchaseDetails.pendingCompletePurchase` field now correctly indicates if the purchase still needs to be completed.
diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/sku_details_wrapper.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/sku_details_wrapper.dart
index 5bbe750..9c349ba 100644
--- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/sku_details_wrapper.dart
+++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/sku_details_wrapper.dart
@@ -68,7 +68,7 @@
final String introductoryPrice;
/// [introductoryPrice] in micro-units 990000
- @JsonKey(defaultValue: '')
+ @JsonKey(name: 'introductoryPriceAmountMicros', defaultValue: '')
final String introductoryPriceMicros;
/// The number of subscription billing periods for which the user will be given the introductory price, such as 3.
diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/sku_details_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/sku_details_wrapper.g.dart
index 49e8608..d21f832 100644
--- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/sku_details_wrapper.g.dart
+++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/sku_details_wrapper.g.dart
@@ -11,7 +11,8 @@
description: json['description'] as String? ?? '',
freeTrialPeriod: json['freeTrialPeriod'] as String? ?? '',
introductoryPrice: json['introductoryPrice'] as String? ?? '',
- introductoryPriceMicros: json['introductoryPriceMicros'] as String? ?? '',
+ introductoryPriceMicros:
+ json['introductoryPriceAmountMicros'] as String? ?? '',
introductoryPriceCycles: json['introductoryPriceCycles'] as int? ?? 0,
introductoryPricePeriod: json['introductoryPricePeriod'] as String? ?? '',
price: json['price'] as String? ?? '',
@@ -32,7 +33,7 @@
'description': instance.description,
'freeTrialPeriod': instance.freeTrialPeriod,
'introductoryPrice': instance.introductoryPrice,
- 'introductoryPriceMicros': instance.introductoryPriceMicros,
+ 'introductoryPriceAmountMicros': instance.introductoryPriceMicros,
'introductoryPriceCycles': instance.introductoryPriceCycles,
'introductoryPricePeriod': instance.introductoryPricePeriod,
'price': instance.price,
diff --git a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml
index d9b0982..64a4088 100644
--- a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml
+++ b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml
@@ -2,7 +2,7 @@
description: An implementation for the Android platform of the Flutter `in_app_purchase` plugin. This uses the Android BillingClient APIs.
repository: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase/in_app_purchase_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
-version: 0.1.4+6
+version: 0.1.4+7
environment:
sdk: ">=2.12.0 <3.0.0"
diff --git a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/sku_details_wrapper_test.dart b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/sku_details_wrapper_test.dart
index b8ba9d5..62d9104 100644
--- a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/sku_details_wrapper_test.dart
+++ b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/sku_details_wrapper_test.dart
@@ -134,7 +134,7 @@
'description': original.description,
'freeTrialPeriod': original.freeTrialPeriod,
'introductoryPrice': original.introductoryPrice,
- 'introductoryPriceMicros': original.introductoryPriceMicros,
+ 'introductoryPriceAmountMicros': original.introductoryPriceMicros,
'introductoryPriceCycles': original.introductoryPriceCycles,
'introductoryPricePeriod': original.introductoryPricePeriod,
'price': original.price,