Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use http client in validateReceiptIos #322

Merged
merged 2 commits into from
Nov 14, 2021
Merged

Use http client in validateReceiptIos #322

merged 2 commits into from
Nov 14, 2021

Conversation

dev-yakuza
Copy link
Contributor

The validateReceiptIos function uses the http library directly instead of the _client instance.

https://github.com/dooboolab/flutter_inapp_purchase/blob/24b290cff01d99494e7a38fb27373027acf8cd07/lib/flutter_inapp_purchase.dart#L552-L560

And the validateReceiptAndroid function uses the _client instance.

https://github.com/dooboolab/flutter_inapp_purchase/blob/24b290cff01d99494e7a38fb27373027acf8cd07/lib/flutter_inapp_purchase.dart#L588-L594

I think using the _client is reasonable because we can use it for testing by assigning the mock client.

final client = MockClient();

FlutterInappPurchase(FlutterInappPurchase.private(
  FakePlatform(operatingSystem: 'ios'),
  client: client,
));

So, I changed http to _client and initialize it.

Copy link
Owner

@hyochan hyochan left a comment

Choose a reason for hiding this comment

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

Superb detail 💯

lib/flutter_inapp_purchase.dart Show resolved Hide resolved
@hyochan hyochan merged commit 12a7ccb into hyochan:master Nov 14, 2021
@hyochan hyochan added the enhancement New feature or request label Nov 14, 2021
@dev-yakuza dev-yakuza deleted the use-http-client branch November 15, 2021 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants