Public Sub Billing_Client_PurchasesUpdated(Result As BillingResult, Purchases As List)
'-------------------------------------------------------------------------------------------------------------------------
' This event will be raised when the status of one or more of the purchases has changed.
' It will usually happen as a result of calling LaunchBillingFlow however it can be called in other cases as well.
'-------------------------------------------------------------------------------------------------------------------------
If Result.IsSuccess Then
For Each p As Purchase In Purchases
If p.PurchaseState = p.STATE_PURCHASED Then
'--------------------------------------------------------------------------
' Verify the purchase signature.
'--------------------------------------------------------------------------
#if Debug
Log("BKey:" &gBMK &CRLF &"DKey:" &Debug_gBillingManagerKey)
#end if
If gBillingClient.VerifyPurchase(p, gBMK) Then
'----------------------------------------------------------------------
' Was Purchase is Acknowledged???
'----------------------------------------------------------------------
If p.IsAcknowledged = False Then
'------------------------------------------------------------------
' we either acknowledge the product or consume it.
'------------------------------------------------------------------
Wait For(gBillingClient.AcknowledgePurchase(p.PurchaseToken, gSubscriptions.SubscriptionToString(BillingSubscription, True))) Billing_Client_AcknowledgeCompleted(Result As BillingResult)
If Result.IsSuccess Then
Log("Starter::Billing_Client_PurchasesUpdated - Acknowledged: " & Result.IsSuccess)
end if
end if
end if
end if
next
end if