Checking for past purchases
You can avoid offering a digital good to a user who has already purchased it by checking the user's purchase history with the blackberry.payment.getExistingPurchases function.
You can also use the blackberry.payment.getExistingPurchases function when a user initiates a request to cancel a subscription, in order to obtain a purchase ID for the cancellation process.
The blackberry.payment.getExistingPurchases function includes a boolean parameter, refresh, that allows you to specify how the purchase history is retrieved. Set refresh to True to retrieve a purchase history from the Payment Service server; set it to False to attempt to use the local purchase history, and only retrieve purchase history from the Payment Service server if no match is made locally.
If the transaction is successful, the onSuccess callback function returns a purchase object for each purchase of the app, made by the user.
Last modified: 2014-03-10