-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into added_namespace
- Loading branch information
Showing
10 changed files
with
81 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.4.2 | ||
Fix | ||
* Add customer as a parameter in restorePurchase | ||
|
||
## 0.4.1 | ||
Fix | ||
* Fixes multiple callback | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
group 'com.chargebee.flutter.sdk' | ||
version '0.4.1' | ||
version '0.4.2' | ||
|
||
buildscript { | ||
ext.kotlin_version = '1.6.0' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -408,7 +408,13 @@ class _MyHomePageState extends State<MyHomePage> { | |
|
||
Future<void> restorePurchases() async { | ||
try { | ||
final result = await Chargebee.restorePurchases(true); | ||
final customer = CBCustomer( | ||
'Test123', | ||
'CB', | ||
'Test', | ||
'[email protected]', | ||
); | ||
final result = await Chargebee.restorePurchases(true, customer); | ||
if (mProgressBarUtil.isProgressBarShowing()) { | ||
mProgressBarUtil.hideProgressDialog(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -694,11 +694,24 @@ void main() { | |
channelResponse = restorePurchaseResult; | ||
debugDefaultTargetPlatformOverride = TargetPlatform.android; | ||
try { | ||
final result = await Chargebee.restorePurchases(true); | ||
final customer = CBCustomer( | ||
'test-user', | ||
'test', | ||
'user', | ||
'[email protected]', | ||
); | ||
final result = await Chargebee.restorePurchases(true, customer); | ||
final expectedArguments = { | ||
Constants.customerId: 'test-user', | ||
Constants.firstName: 'test', | ||
Constants.lastName: 'user', | ||
Constants.email: '[email protected]', | ||
Constants.includeInactivePurchases: true, | ||
}; | ||
expect(callStack, <Matcher>[ | ||
isMethodCall( | ||
Constants.mRestorePurchase, | ||
arguments: {Constants.includeInactivePurchases: true}, | ||
arguments: expectedArguments, | ||
) | ||
]); | ||
expect(result.isNotEmpty, true); | ||
|
@@ -710,11 +723,24 @@ void main() { | |
test('returns the list of Restored Subscription for iOS', () async { | ||
channelResponse = restorePurchaseResult; | ||
debugDefaultTargetPlatformOverride = TargetPlatform.iOS; | ||
final result = await Chargebee.restorePurchases(true); | ||
final customer = CBCustomer( | ||
'test-user', | ||
'test', | ||
'user', | ||
'[email protected]', | ||
); | ||
final expectedArguments = { | ||
Constants.customerId: 'test-user', | ||
Constants.firstName: 'test', | ||
Constants.lastName: 'user', | ||
Constants.email: '[email protected]', | ||
Constants.includeInactivePurchases: true, | ||
}; | ||
final result = await Chargebee.restorePurchases(true, customer); | ||
expect(callStack, <Matcher>[ | ||
isMethodCall( | ||
Constants.mRestorePurchase, | ||
arguments: {Constants.includeInactivePurchases: true}, | ||
arguments: expectedArguments, | ||
) | ||
]); | ||
expect(result.isNotEmpty, true); | ||
|