Android Question In-App Purchase say 'Unable to buy item, Error response: 7:Item Already Owned'

cenyu

Active Member
Licensed User
Longtime User
Hello, i trying to create a DONATE button with this code but when i click seccond time on same button - "Unable to buy item, Error response: 7:Item Already Owned"
Where is my mistake?

B4X:
Sub Donate_Click
    
    'manager For Donation
 
    manager.RequestPayment("donate_soccer","inapp", False) 'request purchase with ID "donate_soccer"
    
End Sub

Sub manager_PurchaseCompleted (Success As Boolean, Product As Purchase)
    Log(Product)
    Log(Success)
    
    If Success Then
        If Product.ProductId = "donate_soccer" Then
            ToastMessageShow(langThanksForSupport,True)
        End If
    End If
End Sub
 

cenyu

Active Member
Licensed User
Longtime User
I find solution!
Of course thanks to Erel's post!

https://www.b4x.com/android/forum/threads/android-in-app-billing-v3-tutorial.29997/

Purchasing a product is done by calling: manager.RequestPayment. The user will be asked to approve the payment. The PurchaseCompleted event will be raised when the operation completes.

Note that managed products can only be purchased once. Only after you call ConsumeProduct will the user be able to purchase the same item again.

Consuming purchased products is done by calling manager.ConsumeProduct.



Thank you Erel!
 
Last edited:
Upvote 0
Top