# PurchasesUpdatedListener


```
public interface PurchasesUpdatedListener
```

<br />

*** ** * ** ***

Listener interface for purchase updates which happen when, for example, the user buys something within the app or by initiating a purchase from Google Play Store.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/com/android/billingclient/api/PurchasesUpdatedListener#onPurchasesUpdated(com.android.billingclient.api.BillingResult,java.util.List<com.android.billingclient.api.Purchase>)( https://developer.android.com/reference/com/android/billingclient/api/BillingResult billingResult, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/com/android/billingclient/api/Purchase> purchases )` Implement this method to get notifications for purchases updates. |

## Public methods

### onPurchasesUpdated

```
abstract void onPurchasesUpdated(
    BillingResult billingResult,
    List<Purchase> purchases
)
```

Implement this method to get notifications for purchases updates. Both purchases initiated by your app and the ones initiated outside of your app will be reported here.

**Warning!** All purchases reported here must either be consumed or acknowledged. Failure to either consume (via `https://developer.android.com/reference/com/android/billingclient/api/BillingClient#consumeAsync(com.android.billingclient.api.ConsumeParams,com.android.billingclient.api.ConsumeResponseListener)`) or acknowledge (via `https://developer.android.com/reference/com/android/billingclient/api/BillingClient#acknowledgePurchase(com.android.billingclient.api.AcknowledgePurchaseParams,com.android.billingclient.api.AcknowledgePurchaseResponseListener)`) a purchase will result in that purchase being refunded. Please refer to the [integration guide](https://developer.android.com/google/play/billing/integrate#process) for more details.

| Parameters |
|---|---|
| `https://developer.android.com/reference/com/android/billingclient/api/BillingResult billingResult` | Result of the purchase update. For example, `https://developer.android.com/reference/com/android/billingclient/api/BillingClient.BillingResponseCode#ITEM_ALREADY_OWNED()` if the user already owns the item being purchased, `https://developer.android.com/reference/com/android/billingclient/api/BillingClient.BillingResponseCode#ITEM_UNAVAILABLE()` if the item is not available to be purchased, `https://developer.android.com/reference/com/android/billingclient/api/BillingClient.BillingResponseCode#USER_CANCELED()` if the user dismissed the purchase flow, and `https://developer.android.com/reference/com/android/billingclient/api/BillingClient.BillingResponseCode#OK()` if the purchase was successful. |
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/com/android/billingclient/api/Purchase> purchases` | List of updated purchases if present. |