diff --git a/README.md b/README.md index c927b2c..a646d1b 100644 --- a/README.md +++ b/README.md @@ -154,9 +154,10 @@ See an example of [product](https://github.com/code-with-max/godot-google-play-i > But if you are planning to switch to this version, you should know that I have implemented two separate functions for buying products and subscribing to plans. --- -`purchase(id: List, is_personalized: bool)`: purchase a product from Google Play Billing. -`id`: ID of the product or subscription wrapped in a list. -`is_personalized`: This is to ensure compliance with the [EU directive](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02011L0083-20220528), you can clarify this [here](https://developer.android.com/google/play/billing/integrate#personalized-price), but if you don't understand why, just set it to `false`. +`purchase(product_id: List, is_personalized: bool)`: purchase a product from Google Play Billing. + +- `product_id`: ID of the product wrapped in a list. +- `is_personalized`: This is to ensure compliance with the [EU directive](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02011L0083-20220528), you can clarify this [here](https://developer.android.com/google/play/billing/integrate#personalized-price), but if you don't understand why, just set it to `false`. Emit signals: @@ -167,7 +168,43 @@ Emit signals: - `purchase_update_error`: If there is an error updating the purchase information. > [!IMPORTANT] -> Do not forget consume or acknowledge the purchase. +> Do not forget **consume or acknowledge** the purchase. + +--- +`subscribe(subscription_id: List, base_plan_id: List, is_personalized: bool)`: subscribe to a subscription plan from Google Play Billing. + +- `subscription_id`: ID of the subscription wrapped in a list. +- `base_plan_id`: ID of the base subscription plan wrapped in a list. +- `is_personalized`: This is to ensure compliance with the [EU directive](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02011L0083-20220528), you can clarify this [here](https://developer.android.com/google/play/billing/integrate#personalized-price), but if you don't understand why, just set it to `false`. + +Emit signals: + +- `purchase_updated`: Emitted when the purchase information is updated. The purchase process was successful. [Example of response](https://github.com/code-with-max/godot-google-play-iapp/blob/master/examples/purchase_updated_subs.json) +`query_product_details_error`: If an error occurred while receiving information about the subscription being purchased. +- `purchase_error`: If there is an error during the purchase process. +- `purchase_cancelled`: If a purchase is cancelled by the user. +- `purchase_update_error`: If there is an error updating the purchase information. + +> [!IMPORTANT] +> Do not forget **acknowledge** the subscription. + +--- +`consumePurchase(purchase["purchase_token"]`: consume a purchase from Google Play Billing. +`purchase["purchase_token"]`: Purchase token from purchase updated [response](https://github.com/code-with-max/godot-google-play-iapp/blob/master/examples/purchase_updated_inapp.json). + +Emit signals: + +- `purchase_consumed`: If a purchase is successfully consumed. +- `purchase_consumed_error`: If there is an error consuming the purchase. + +--- +`acknowledgePurchase(purchase["purchase_token"])`: acknowledge a purchase from Google Play Billing. +`purchase["purchase_token"]`: Purchase token from purchase updated response. + +Emit signals: + +- `purchase_acknowledged`: If a purchase is successfully acknowledged. +- `purchase_acknowledged_error`: If there is an error acknowledging the purchase. ---