Android Question InApp Purchase - Purchased failed even knowing it didn't

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

I am using inAppBilling3 and when I use:

B4X:
manage.RequestPayment("365day","inapp","MyMadeUpValue")

it seems to then popup asking for the payment. So far so good..

After the payment goes though, it triggers the event manager_PurchaseCompleted.

B4X:
Sub manager_PurchaseCompleted (Success As Boolean, Product As Purchase)

    Log("success = " & Success)
    Log("product.tostring = " & Product.toString)
    Log("product = " & Product)

End Sub

However it seems to log:

sending message to waiting queue (OnActivityResult)
running waiting messages (1)
Arrived: 1, 1
Signature verification failed for Product ID 365day (response: -1003) Purchase signature verification failed)
success = false
product.tostring = Purchase(type:inapp): 365day, state = 0
product = Purchase(type:inapp): 365day, state = 0

If I open Google Play (the user account I used to make the purchase with) and view my purchases I see the purchase in the list.

When I did do the purchase, I used a promo code to pay for the purchase. Is this why the purchase failed or is there some other reason why it failed ?

The app is published on Google Play as a closed beta app, and have checked and made sure the inapp purchases are active.
 
Last edited:

aaronk

Well-Known Member
Licensed User
Longtime User
request payment has three arguments
Yeah, when I put it on the forum I manually typed it out rather than copy+paste my code since it was only one line.

My actual code looks like:

B4X:
manage.RequestPayment("365day","inapp","MyMadeUpValue")

Sub manager_PurchaseCompleted (Success As Boolean, Product As Purchase)

    Log("success = " & Success)
    Log("product.tostring = " & Product.toString)
    Log("product = " & Product)

End Sub

I think I worked it out. I created another inapp purchase item and it returned success = true.

I think I must of purchased the other in app item once before and forgot to run ConsumeProduct after the purchase so I can purchase the same item again.
 
Upvote 0
Top