Skip to content

Commit

Permalink
Merge pull request #107 from chargebee/fix/update-readme
Browse files Browse the repository at this point in the history
OMNISUB-6373 - Update README.md
  • Loading branch information
cb-haripriyan authored Dec 13, 2024
2 parents c6de1ec + cb874a2 commit 7d57fc8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,14 @@ The function is called asynchronously, and it returns a `Result` object with a `

#### Restore Purchases

The `restorePurchases()` function helps to recover your app user's previous purchases without making them pay again. Sometimes, your app user may want to restore their previous purchases after switching to a new device or reinstalling your app. You can use the `restorePurchases()` function to allow your app user to easily restore their previous purchases.
The `restorePurchases()` function helps to recover your app user's previous purchases without making them pay again. Sometimes, your app user may want to restore their previous purchases after switching to a new device or reinstalling your app. You can use the `restorePurchases()` function to allow your app user to easily restore their previous purchases by providing the `customer` object as a parameter.

To retrieve **inactive** purchases along with the **active** purchases for your app user, you can call the `restorePurchases()` function with the `includeInactivePurchases` parameter set to true. If you only want to restore active subscriptions, set the parameter to false. Here is an example of how to use the restorePurchases() function in your code with the `includeInactivePurchases` parameter set to true.

``` dart
try {
final result = await Chargebee.restorePurchases(true);
final customer = CBCustomer('id','','','');
final result = await Chargebee.restorePurchases(true, customer);
print("result : $result");
} on PlatformException catch (e) {
print('Error Message: ${e.message}, Error Details: ${e.details}, Error Code: ${e.code}');
Expand Down

0 comments on commit 7d57fc8

Please sign in to comment.