Skip to content

Commit

Permalink
Merge pull request #109 from chargebee/fix/update-readme-next
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
cb-haripriyan authored Dec 13, 2024
2 parents b0f33cc + c1e4843 commit 37076a6
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 @@ -154,13 +154,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 37076a6

Please sign in to comment.