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

Commit

Permalink
[in_app_purchase] Added serviceTimeout code (#3287)
Browse files Browse the repository at this point in the history
  • Loading branch information
impure authored Jan 7, 2021
1 parent d0fd4b1 commit 1b7afc5
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/in_app_purchase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.5

* [Android] Fixed: added support for the SERVICE_TIMEOUT (-3) response code.

## 0.3.4+18

* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ enum BillingResponse {
// WARNING: Changes to this class need to be reflected in our generated code.
// Run `flutter packages pub run build_runner watch` to rebuild and watch for
// further changes.

/// The request has reached the maximum timeout before Google Play responds.
@JsonValue(-3)
serviceTimeout,

/// The requested feature is not supported by Play Store on the current device.
@JsonValue(-2)
featureNotSupported,
Expand Down

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

2 changes: 1 addition & 1 deletion packages/in_app_purchase/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: in_app_purchase
description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play.
homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase
version: 0.3.4+18
version: 0.3.5

dependencies:
async: ^2.0.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ void main() {
});
});

// Make sure that the enum values are supported and that the converter call
// does not fail
test('response states', () async {
BillingResponseConverter converter = BillingResponseConverter();
converter.fromJson(-3);
converter.fromJson(-2);
converter.fromJson(-1);
converter.fromJson(0);
converter.fromJson(1);
converter.fromJson(2);
converter.fromJson(3);
converter.fromJson(4);
converter.fromJson(5);
converter.fromJson(6);
converter.fromJson(7);
converter.fromJson(8);
});

group('startConnection', () {
final String methodName =
'BillingClient#startConnection(BillingClientStateListener)';
Expand Down

0 comments on commit 1b7afc5

Please sign in to comment.