diff options
author | volzhs <volzhs@gmail.com> | 2015-10-28 15:48:37 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2015-10-28 15:48:37 +0900 |
commit | 3fbaa479e33466394cd243ab652bd1c4c082549a (patch) | |
tree | b36d3601497b511bdf75a51a425a0690605bf2ef /scene/resources/default_theme/logo.png | |
parent | bd736e5af2ec5113c23fef58523f57a0b2e11fb2 (diff) |
improve android payments
GodotPaymentV3 currently consumes purchased item right after purchasing.
But, some in-app item should not consume like "remove ads permanently"
So, I added "setAutoConsume(boolean)", "requestPurchased()",
"consume(sku_string)".
AutoConsume is true by default as before.
usage:
func _ready():
var payment = Globals.get_singleton("GodotPayments")
payment.setPurchaseCallbackId(get_instance_ID())
payment.setAutoConsume(false) # default : true
payment.requestPurchased() # callback : has_purchased
payment.purchase("item_name") # callback : purchase_success,
purchase_fail, purchase_cancel, purchase_owned
payment.consume("item_name") # callback : consume_success
func purchase_success(receipt, signature, sku):
print("purchase_success : ", sku)
func purchase_fail():
print("purchase_fail")
func purchase_cancel():
print("purchase_cancel")
func purchase_owned(sku):
print("purchase_owned : ", sku)
func consume_success(receipt, signature, sku):
print("consume_success : ", sku)
func has_purchased(receipt, signature, sku):
if sku == "":
print("has_purchased : nothing")
else:
print("has_purchased : ", sku)
Diffstat (limited to 'scene/resources/default_theme/logo.png')
0 files changed, 0 insertions, 0 deletions