Launch Billing Flow

This is an asynchronous function which enables you to Launch a Google Play Billing window (powered by Google) for a purchase.

The parameters include the Product ID (from the Google Play Console), Product Type, whether or not it is a personalised offer and optionally an Offer Token.

Once the asynchronous operation has completed, one of two delegates will be called to handle the success and failure situations.

1

Product Id

The Product ID of the product to purchase. This ID can be sourced from the Google Play Console.

2

Product Type

Product Type can either be Subscription or InApp products.

3

Is Offer Personalised

Indicate whether or not the offer is personalised.
You must consult Art. 6 (1) (ea) CRD of the Consumer Rights Directive (2011/83/EU) to determine if the price you are offering to users is personalized.

4

Offer Token

A Token retrieved when Querying Product Details which would indicate a specific offer on a Subscription's base plan.
This is not required for consumable/non-consumable in app purchases.
You can use the Get Subscription Offer Token blueprint node to extract the desired offer token.

5

On Success

A delegate that will be called when the player has successfully purchased the product. The delegate will produce a Purchase object for you to use.
You can simply click and drag this pin to create a custom event.

6

On Failure

A delegate that will be called if there is an error launcching the billing flow. 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.

Examples

In the below example, we are initiating a purchase of an INAPP product given the product ID retrieved from the Google Play Console.
Depending on your use case, you can create your own function to handle the purchase of the in app product and reward the player appropriately. Similarly you can create your own method to handle errors.

For INAPP product purchases, there are no offer tokens required, so you can simply leave this field blank.

In the below example, we are initiating a purchase of a Subscription product given the product ID retrieved from the Google Play Console.
Depending on your use case, you can create your own function to handle the purchase of the subscription product and reward the player appropriately. Similarly you can create your own method to handle errors.

The only difference here is the use of the provided Get Subscription Offer Token quality of life blueprint node.
In the event when you have multiple base plans and/or offers on these base plans, you may want to choose which one to use. In this case, you would want to have saved the Subscription Product Details when Querying Subscription Product Details to a variable to be used here.
In the event you do not have multiple offers/base plans on a subscription, you can simply leave the offer token blank and it will take the first (and only) offer seen.