|
|
|
|
WLanguage procedure called by inAppPurchaseProduct Procedure ("Callback") called by inAppPurchaseProduct when the response to the purchase request is received. This procedure can be a local, global or internal procedure. MyProduct is inAppProduct = arrProduct[nIndex] inAppPurchaseProduct(MyProduct, ValidateProductPurchase) PROCÉDURE ValidateProductPurchase(bSuccess is boolean, Product is inAppProduct, Receipt)  IF NOT bSuccess THEN ToastDisplay(ErrorInfo()) RETURN ELSE // Android case IF InAndroidMode() THEN // Consume the product (optional) inAppConsumeProduct(Product, Receipt, ConsumeProduct) END // iOS case IF IniOSMode() THEN // Activate the product in the application EnableProduct(Product) // Save the purchase in the application preferences SaveParameter(Product.Identifier, 1) END END Syntax
inAppPurchaseProduct_Callback(<Success> , <Product> , <Received> , <Quantity>)
<Success>: Boolean - True if the purchase was validated,
- False otherwise. To get more details on the error, use ErrorInfo before any other call to a WLanguage function (this would reinitialize the error). ErrorInfo associated with the errCode constant returns one of the following error codes:
| | inAppCancellation | Purchase canceled by the user.
| inAppInvalidResponse | Invalid response. | inAppSignatureError | Error while checking the data signature received for the purchase validation (security problem). | inAppUnknownError | Unknown error. |
<Product>: inAppProduct variable inAppProduct variable that corresponds to the product or subscription purchased. <Received>: Character string - <Receipt> is not available. To validate a purchase, you must use inAppListPurchase and make sure the purchase is in the list.
- <Receipt> is a character string corresponding to the purchase identifier. Then, this identifier can be used to consume the product that was purchased (inAppConsumeProduct).
<Quantity>: Integer Quantity of products purchased. - For a subscription, this parameter is always set to 1.
- This parameter is always set to 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|