Agentz
Facade pattern - a simple interface for interacting with the main features of the Google Billing Library
Author
rjsuzuki
Functions
A manual option to explicitly cancel an order
A manual option to complete an existing Order. This will call the respective function to consume, acknowledge, and/or fulfill a product.
Return a product that matches the sku (product id). Null if no matching product exists.
Return a list of validated products from the inventory. Narrow your search results by providing both or either parameters.
Observe changes to the BillingClient's connection to GooglePlay from the UI thread (in an activity/fragment class). Calling this function automatically checks if client is connected and will attempt to reconnect if need be.
Checks if the billing client has products loaded. if false, use queryInventory to prepare the client for purchases.
Queries database for matching product ids and loads them into the inventory cache.
This function should be called in the onResume lifecycle of the application/view. Amazon and Google Play use different terminology for similar use-cases, so in order to prevent confusion, this library will always define an Order as a purchase in-progress, and/or incomplete. A receipt will always be a 'completed order' (expired, canceled, or consumed). Handle purchases still remaining from recent history. Observe the liveData object that will emit Orderz objects that require your attention.
TODO: Implement cache-first strategy and boolean bypass parameter for it.
Returns the available history of 'completed orders' as a mapping of receipt objects. The receipts will list all relevant skus, even if that order is expired, canceled, or consumed. Set parameter to null for all products