Skip to content

Commit 59c874c

Browse files
syntaxerror247mhilbrunnerAThousandShips
authored
Apply suggestions from code review
Co-authored-by: Max Hilbrunner <[email protected]> Co-authored-by: A Thousand Ships <[email protected]>
1 parent 3d8c877 commit 59c874c

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tutorials/platform/android/android_in_app_purchases.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Initialize the plugin
2222
To use the ``GodotGooglePlayBilling`` API:
2323

2424
1. Access the ``BillingClient`` autoload singleton, it's automatically added when the plugin is enabled.
25-
2. Connect to its signals to receive billing results
26-
3. Call ``start_connection``
25+
2. Connect to its signals to receive billing results.
26+
3. Call ``start_connection``.
2727

2828
Initialization example:
2929

@@ -58,17 +58,17 @@ Return values for ``get_connection_state()``:
5858
DISCONNECTED, # This client was not yet connected to billing service or was already closed.
5959
CONNECTING, # This client is currently in process of connecting to billing service.
6060
CONNECTED, # This client is currently connected to billing service.
61-
CLOSED # This client was already closed and shouldn't be used again.
61+
CLOSED, # This client was already closed and shouldn't be used again.
6262
}
6363

6464

6565
Query available items
6666
~~~~~~~~~~~~~~~~~~~~~
6767

6868
Once the API has connected, query product IDs using `query_product_details()`. You must successfully complete
69-
an product details query before calling the ``purchase()``, ``purchase_subscription()``, or ``update_subscription()`` functions,
69+
a product details query before calling the ``purchase()``, ``purchase_subscription()``, or ``update_subscription()`` functions,
7070
or they will return an error. ``query_product_details()`` takes two parameters: an array
71-
of product ID strings, and the type of product being queried.
71+
of product ID strings and the type of product being queried.
7272
The product type should be ``BillingClient.ProductType.INAPP`` for normal in-app purchases or ``BillingClient.ProductType.SUBS`` for subscriptions.
7373
The ID strings in the array should match the product IDs defined in the Google Play Console entry
7474
for your app.
@@ -78,7 +78,7 @@ Example use of ``query_product_details()``:
7878
::
7979

8080
func _on_connected():
81-
BillingClient.query_product_details(["my_iap_item"], BillingClient.ProductType.INAPP) # BillingClient.ProductType.SUBS for subscriptions
81+
BillingClient.query_product_details(["my_iap_item"], BillingClient.ProductType.INAPP) # BillingClient.ProductType.SUBS for subscriptions.
8282

8383
func _on_query_product_details_response(query_result: Dictionary):
8484
if query_result.response_code == BillingClient.BillingResponseCode.OK:
@@ -98,7 +98,7 @@ a product type to query. The product type should be
9898
``BillingClient.ProductType.INAPP`` for normal in-app purchases or ``BillingClient.ProductType.SUBS`` for subscriptions.
9999
The ``query_purchases_response`` signal is sent with the result.
100100
The signal has a single parameter: a :ref:`Dictionary <class_Dictionary>` with
101-
a response code and either an array of purchases or debug message.
101+
a response code and either an array of purchases or a debug message.
102102
Only active subscriptions and non-consumed one-time purchases are
103103
included in the purchase array.
104104

@@ -107,7 +107,7 @@ Example use of ``query_purchases()``:
107107
::
108108

109109
func _query_purchases():
110-
BillingClient.query_purchases(BillingClient.ProductType.INAPP) # Or BillingClient.ProductType.SUBS for subscriptions
110+
BillingClient.query_purchases(BillingClient.ProductType.INAPP) # Or BillingClient.ProductType.SUBS for subscriptions.
111111

112112
func _on_query_purchases_response(query_result: Dictionary):
113113
if query_result.response_code == BillingClient.BillingResponseCode.OK:
@@ -132,7 +132,7 @@ offers are `personallised <https://developer.android.com/google/play/billing/int
132132
Reminder: you **must** query the product details for an item before you can
133133
pass it to ``purchase()``.
134134
This method returns a dictionary indicating whether the billing flow was successfully launched.
135-
It includes a response code and either an array of purchases or debug message.
135+
It includes a response code and either an array of purchases or a debug message.
136136

137137
Example use of ``purchase()``:
138138

@@ -273,9 +273,9 @@ Example use of ``acknowledge_purchase()``:
273273
if result.response_code == BillingClient.BillingResponseCode.OK:
274274
print("Acknowledge purchase success")
275275
_handle_purchase_token(result.token, true)
276-
else:
277-
print("Acknowledge purchase failed")
278-
print("response_code: ", result.response_code, "debug_message: ", result.debug_message, "purchase_token: ", result.token)
276+
else:
277+
print("Acknowledge purchase failed")
278+
print("response_code: ", result.response_code, "debug_message: ", result.debug_message, "purchase_token: ", result.token)
279279

280280
# Find the product associated with the purchase token and award the
281281
# product if successful
@@ -301,7 +301,7 @@ If you support upgrading or downgrading between different subscription levels,
301301
you should use ``update_subscription()`` to use the subscription update flow to
302302
change an active subscription. Like ``purchase()``, results are returned by the
303303
``on_purchases_updated`` signal.
304-
There are following parameters to ``update_subscription()``:
304+
These are the parameters of ``update_subscription()``:
305305

306306
1. old_purchase_token: The purchase token of the currently active subscription
307307
2. replacement_mode: The replacement mode to apply to the subscription
@@ -334,7 +334,7 @@ The replacement modes values are defined as:
334334
CHARGE_FULL_PRICE = 5,
335335

336336
# The new purchase takes effect immediately, the new plan will take effect when the old item expires.
337-
DEFERRED = 6
337+
DEFERRED = 6,
338338
}
339339

340340

0 commit comments

Comments
 (0)