Open Shay-M opened 3 months ago
@Shay-M Hi! First you must turn on option "multi-quantity purchases" for product in Play Console settings. After users will have ability to buy more than one instance, uses standard purchase interface. On processing this purchase in parameter "quantity" you receive actual data.
@code-with-max Hii, Yes, I marked it and it still doesn't show
Maybe I'm doing something wrong?
func process_purchase(purchase):
for product in purchase["products"]:
if (product in ITEM_ACKNOWLEDGED) or (product in SUBSCRIPTIONS):
# Acknowledge the purchase
if not purchase["is_acknowledged"]:
print("Acknowledging: " + purchase["purchase_token"])
billing.acknowledgePurchase(purchase["purchase_token"])
# Here, process the use of the product in your game.
else:
print("Already acknowledged")
# if not SceneManager.user_preferences.is_removing_ads: successful()
elif product in ITEM_CONSUMATED:
# Consume the purchase
print("Consuming: " + purchase["purchase_token"])
billing.consumePurchase(purchase["purchase_token"])
GPrint.text("purchase: " + purchase["quantity"]) <<<<<<----
successful()
#
# Here, process the use of the product in your game.
#
else:
print("Product not found: " + str(product))
purchase_error.emit("Product not found: " + str(product))
@Shay-M I'm sorry that I didn't answer for a long time. At first glance, everything looks fine, you don't need to change anything in the code, just billing will return you a quantity of more than one. Are there any errors in the logcat output?
@code-with-max Thank you for getting back to me.
Regarding the issue, there are no errors in the logcat output; however, there is no printout for the quantity.
for this :
Gprint.text("purchase: " + purchase["purchase_token"])
Gprint.text("purchase: " + purchase["quantity"])
I’m only receiving the purchase_token, but the line for purchase["quantity"] does not produce any output.
@Shay-M In the next version, I will try to implement a method that returns data received from Google directly without converting it. This will help you understand if there is information about the quantity in the original response from the server.
@code-with-max Okay, thanks!
Hello, first of all, thank you very much for the plugin! I wanted to ask how I can get the amount of the purchase made? I tried
purchase["quantity"]
According to the example: https://github.com/code-with-max/godot-google-play-iapp/blob/master/examples/purchase_updated_inapp.jsonbut nothing is received