-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Added ability to purchase multiple quantity of one product #5711
Changes from 1 commit
a53e1fd
03b6758
43cae14
d4b97de
8164f9c
d1d3816
2768b6a
4dba240
402ecee
e30795a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ class AppStorePurchaseParam extends PurchaseParam { | |
| AppStorePurchaseParam({ | ||
| required ProductDetails productDetails, | ||
| String? applicationUserName, | ||
| this.quantity = 1, | ||
| this.simulatesAskToBuyInSandbox = false, | ||
| }) : super( | ||
| productDetails: productDetails, | ||
|
|
@@ -28,4 +29,7 @@ class AppStorePurchaseParam extends PurchaseParam { | |
| /// | ||
| /// See also [SKPaymentWrapper.simulatesAskToBuyInSandbox]. | ||
| final bool simulatesAskToBuyInSandbox; | ||
|
|
||
| /// Quantity of the product user requested to buy | ||
| int quantity; | ||
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -448,10 +448,10 @@ void main() { | |
| final AppStorePurchaseParam purchaseParam = AppStorePurchaseParam( | ||
| productDetails: | ||
| AppStoreProductDetails.fromSKProduct(dummyProductWrapper), | ||
|
||
| quantity: 5, | ||
| applicationUserName: 'appName'); | ||
| await iapStoreKitPlatform.buyNonConsumable( | ||
| purchaseParam: purchaseParam, | ||
| quantity: 5 | ||
| purchaseParam: purchaseParam | ||
| ); | ||
| await completer.future; | ||
| expect(fakeStoreKitPlatform.finishedTransactions.first.payment.quantity, 5); | ||
|
|
@@ -477,10 +477,10 @@ void main() { | |
| final AppStorePurchaseParam purchaseParam = AppStorePurchaseParam( | ||
| productDetails: | ||
| AppStoreProductDetails.fromSKProduct(dummyProductWrapper), | ||
| quantity: 5, | ||
| applicationUserName: 'appName'); | ||
| await iapStoreKitPlatform.buyConsumable( | ||
| purchaseParam: purchaseParam, | ||
| quantity: 5 | ||
| purchaseParam: purchaseParam | ||
| ); | ||
| await completer.future; | ||
| expect(fakeStoreKitPlatform.finishedTransactions.first.payment.quantity, 5); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.