Check for Purchases

This is an asynchronous function which enables you to check for any pending purchases that may have completed while the app was not running. This situation can occur when the player uses a slow card method of payment.
It is highly recommended to call this blueprint node for both product types (if you offer both) on game startup.

The parameters include the Product Type to check for pending purchases.

Once the asynchronous operation has completed, one of two delegates will be called to handle the success and failure situations.
If there are no pending purchases to be handled and no failure occurred attempting to find any, neither delegate will be called.

1

Product Type

Product Type can either be Subscription or InApp products.

2

On Success

A delegate that will be called when a pending purchase has successfully been completed. The delegate will produce a Purchase object for you to use.
You can simply click and drag this pin to create a custom event.

3

On Failure

A delegate that will be called if there is an error attempting to look for any pending transactions. The delegate will produce a Billing Response Code and debug message for the developer to handle appropriately. You can simply click and drag this pin to create a custom event.

Example

In the below example, we are checking for any pending transactions which may have completed while your app was closed/offline.
Depending on your use case, you can create your own function to handle the purchase and reward the player appropriately. Similarly you can create your own method to handle errors.

This should be run at application start-up to reward the player appropriately for any purchases made.

The ProductType parameter to allow you to handle subscriptions and inapp products seperately if so desired, but do not forget to check for both.