Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
code-with-max committed Jun 19, 2024
1 parent 6694635 commit a0cb773
Showing 1 changed file with 41 additions and 4 deletions.
45 changes: 41 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>, 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<String>, 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:

Expand All @@ -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<String>, base_plan_id: List<String>, 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.

---

Expand Down

0 comments on commit a0cb773

Please sign in to comment.