Difference between revisions of "FBInstant.payments.consumePurchaseAsync"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
<languages />
 
'''<translate>Available since</translate>:''' Gideros 2018.3<br/>
 
'''<translate>Available since</translate>:''' Gideros 2018.3<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/Payments|Payments]]<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/Payments|Payments]]<br/>
Line 6: Line 7:
 
Consumes a specific purchase belonging to the current player. Before provisioning a product's effects to the player, the game should request the consumption of the purchased product. Once the purchase is successfully consumed, the game should immediately provide the player with the effects of their purchase.<br />
 
Consumes a specific purchase belonging to the current player. Before provisioning a product's effects to the player, the game should request the consumption of the purchased product. Once the purchase is successfully consumed, the game should immediately provide the player with the effects of their purchase.<br />
 
<br /></translate>
 
<br /></translate>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
  FBInstant.payments.consumePurchaseAsync(purchaseToken,callback)
 
  FBInstant.payments.consumePurchaseAsync(purchaseToken,callback)
</source>
+
</syntaxhighlight>
 
=== <translate>Parameters</translate> ===
 
=== <translate>Parameters</translate> ===
 
'''purchaseToken''': (string) <translate>The purchase token of the purchase that should be consumed.</translate> <br/>
 
'''purchaseToken''': (string) <translate>The purchase token of the purchase that should be consumed.</translate> <br/>
Line 14: Line 15:
 
=== <translate>Examples</translate> ===
 
=== <translate>Examples</translate> ===
 
'''Example'''<br/>
 
'''Example'''<br/>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
FBInstant.payments.consumePurchaseAsync("54321", function(result,error)
 
FBInstant.payments.consumePurchaseAsync("54321", function(result,error)
 
     if result then
 
     if result then
Line 20: Line 21:
 
end
 
end
 
end)
 
end)
<br/></source>
+
<br/></syntaxhighlight>
 +
 
 +
{{FBInstant.payments}}

Latest revision as of 15:27, 13 July 2023


Available since: Gideros 2018.3
Class: Payments

Description


Consumes a specific purchase belonging to the current player. Before provisioning a product's effects to the player, the game should request the consumption of the purchased product. Once the purchase is successfully consumed, the game should immediately provide the player with the effects of their purchase.

 FBInstant.payments.consumePurchaseAsync(purchaseToken,callback)

Parameters

purchaseToken: (string) The purchase token of the purchase that should be consumed.
callback: (function) A function that will be called with two arguments: True when the purchase has been consumed successfully otherwise the operation failed, and an error code if the function failed.

Examples

Example

FBInstant.payments.consumePurchaseAsync("54321", function(result,error)
    if result then
		print("Consumed!")
	end
end)
<br/>