Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[in_app_purchase] Ensure the introductoryPriceMicros field is populated correctly. #4364

Merged
merged 3 commits into from
Sep 20, 2021

Conversation

mvanbeusekom
Copy link
Contributor

Due to a typo the SkuDetailsWrapper.introductoryPriceMicros field wasn't populated correctly with the values send from the native side.

The first commit of this PR updates the existing unit tests to prove the existence of the issue. The second commit fixes the implementation of the SkuDetailsWrapper class so the tests succeed and populate the field correctly.

Fixes flutter/flutter#90244

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Note that unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Updates the SKUDetailsWrapper  map used in the unit test to match the
output from the JAVA code and causes the tests to fail (proving issue
90244).
The SKUDetailsWrapper property is send using a JSON key with the name
`introductoryPriceAmountMicros`. This commit updates the JSON key to use
the correct name and makes sure it passes all unit tests again.
Update version to 0.1.4+7 and added a change description to the
CHANGELOG.md.
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mvanbeusekom mvanbeusekom added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Sep 20, 2021
@fluttergithubbot fluttergithubbot merged commit e314c7a into flutter:master Sep 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 20, 2021
fluttergithubbot pushed a commit to flutter/flutter that referenced this pull request Sep 20, 2021
@mvanbeusekom mvanbeusekom deleted the issue/90244 branch September 21, 2021 09:34
@781flyingdutchman
Copy link

I believe this commit breaks queryProductDetails on Android, because the defaultValue for this field is set to be a string, when it should be an int. As a result, I am getting Unhandled Exception: type 'int' is not a subtype of type 'String?' in type cast on line 15 of the generated file sku_details.wrapper.g.dart

@cyanglaz
Copy link
Contributor

cc @mvanbeusekom

@mvanbeusekom
Copy link
Contributor Author

Will provide a fix today.

mvanbeusekom added a commit to Baseflow/flutter-plugins that referenced this pull request Sep 22, 2021
Update the unit test so it tests for the introductoryPriceAmountMicros
field to be of type String. This test will be failing to prove the issue
described here
flutter#4364 (comment).
mvanbeusekom added a commit to Baseflow/flutter-plugins that referenced this pull request Sep 22, 2021
Converts the introductoryPriceAmountMicros field to a String value
before it is send as JSON string from Java to Dart. This will solve the
issue
(flutter#4364 (comment)) in
a non-breaking manor (updating the type on the Dart side would introduce
a breaking change).
mvanbeusekom added a commit to Baseflow/flutter-plugins that referenced this pull request Sep 22, 2021
Update the unit test so it tests for the introductoryPriceAmountMicros
field to be of type String. This test will be failing to prove the issue
described here
flutter#4364 (comment).
mvanbeusekom added a commit to Baseflow/flutter-plugins that referenced this pull request Sep 22, 2021
Converts the introductoryPriceAmountMicros field to a String value
before it is send as JSON string from Java to Dart. This will solve the
issue
(flutter#4364 (comment)) in
a non-breaking manor (updating the type on the Dart side would introduce
a breaking change).
@mvanbeusekom
Copy link
Contributor Author

mvanbeusekom commented Sep 22, 2021

@cyanglaz, I have just created a new PR which should resolve the problem. Would appreciate it if you can have a look.

NickalasB added a commit to NickalasB/plugins that referenced this pull request Sep 27, 2021
* master: (51 commits)
  [webview_flutter] Update version number app_facing package (flutter#4375)
  [webview_flutter] Adjust integration test domains (flutter#4383)
  Remove some trivial custom analysis options files (flutter#4379)
  [google_maps_flutter_platfomr_interface] Add Marker drag events (flutter#2653)
  [flutter_plugin_tools] Improve version check error handling (flutter#4376)
  [flutter_plugin_tools] Allow overriding breaking change check (flutter#4369)
  [url_launcher] Error handling when URL cannot be parsed with Uri.parse (flutter#4365)
  [webview_flutter] Migrate main package to fully federated architecture. (flutter#4366)
  [google_sign_in] Bump minimum Flutter version and iOS deployment target (flutter#4334)
  Add false secret lists, and enforce ordering (flutter#4372)
  [camera_web] Update usage documentation (flutter#4371)
  [video_player] VTT Support (flutter#2878)
  Require authors file (flutter#4367)
  [flutter_plugin_tools] Fix federated safety check (flutter#4368)
  [webview_flutter] Extract WKWebView implementation into a separate package (flutter#4345)
  [webview_flutter] Extract Android implementation into a separate package (flutter#4343)
  [in_app_purchase] Ensure the `introductoryPriceMicros` field is populated correctly. (flutter#4364)
  [flutter_plugin_tools] Add a federated PR safety check (flutter#4329)
  [camera] Add web support (flutter#4240)
  [webview_flutter] Bump minimum Flutter version and iOS deployment target (flutter#4361)
  ...

# Conflicts:
#	packages/webview_flutter/webview_flutter/lib/platform_interface.dart
#	packages/webview_flutter/webview_flutter/lib/src/webview_method_channel.dart
#	packages/webview_flutter/webview_flutter/lib/webview_flutter.dart
clocksmith pushed a commit to clocksmith/flutter that referenced this pull request Oct 29, 2021
KyleFin pushed a commit to KyleFin/plugins that referenced this pull request Dec 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes p: in_app_purchase platform-android waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[in_app_purchase][android] introductoryPriceMicros is empty
4 participants