Skip to content

Commit

Permalink
[in_app_purchase] Fix wrong _pendingCompletePurchase flag value (flut…
Browse files Browse the repository at this point in the history
  • Loading branch information
malsabbagh authored and Egor committed Nov 20, 2020
1 parent b282b47 commit 3786797
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
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.0+3

* Fix pendingCompletePurchase flag status to allow to complete the pruchsase.

## 0.3.0+2

* Update te example app to avoid using deprecated api.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,10 @@ class PurchaseDetails {
: null,
this.skPaymentTransaction = transaction,
this.billingClientPurchase = null,
_status = SKTransactionStatusConverter()
.toPurchaseStatus(transaction.transactionState),
_platform = _kPlatformIOS;
_platform = _kPlatformIOS {
status = SKTransactionStatusConverter()
.toPurchaseStatus(transaction.transactionState);
}

/// Generate a [PurchaseDetails] object based on an Android [Purchase] object.
PurchaseDetails.fromPurchase(PurchaseWrapper purchase)
Expand All @@ -208,9 +209,9 @@ class PurchaseDetails {
this.transactionDate = purchase.purchaseTime.toString(),
this.skPaymentTransaction = null,
this.billingClientPurchase = purchase,
_status =
PurchaseStateConverter().toPurchaseStatus(purchase.purchaseState),
_platform = _kPlatformAndroid;
_platform = _kPlatformAndroid {
status = PurchaseStateConverter().toPurchaseStatus(purchase.purchaseState);
}
}

/// The response object for fetching the past purchases.
Expand Down
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.0+2
version: 0.3.0+3


dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ void main() {
dummyPurchase.purchaseToken);
expect(details.skPaymentTransaction, null);
expect(details.billingClientPurchase, dummyPurchase);
expect(details.pendingCompletePurchase, true);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ void main() {
expect(details.verificationData.source, IAPSource.AppStore);
expect(details.skPaymentTransaction, dummyTransaction);
expect(details.billingClientPurchase, null);
expect(details.pendingCompletePurchase, true);
});
test('Should generate correct map of the payment object', () {
Map map = dummyPayment.toMap();
Expand Down

0 comments on commit 3786797

Please sign in to comment.