Bug Description
When using “Slow test card, approves after few minutes” method on purchase testing, the transaction state become error
with reason iap.REASON_UNSPECIFIED
. After 3-5 minutes, transaction state become iap.TRANS_STATE_PURCHASED
.
Same with “Slow test card, declines after few minutes”, the transaction state also become error
with reason iap.REASON_UNSPECIFIED
. But after 3-5 minutes, the API does not give any information if the pending transaction is fail/error.
I use this listener code for testing Google play IAP Billing :
local function buy_listener(self, transaction, error)
pprint(transaction)
if error == nil then
if transaction.state == iap.TRANS_STATE_PURCHASING then
print("Purchasing...")
elseif transaction.state == iap.TRANS_STATE_PURCHASED then
print("Purchased!")
print("transaction id : " .. transaction.ident)
elseif transaction.state == iap.TRANS_STATE_UNVERIFIED then
print("Unverified!")
elseif transaction.state == iap.TRANS_STATE_FAILED then
print("Failed!")
elseif transaction.state == iap.TRANS_STATE_RESTORED then
print("Restored")
end
elseif error then
print(error.error)
if error.reason == iap.REASON_USER_CANCELED then
print("Reason User Canceled")
elseif error.reason == iap.REASON_UNSPECIFIED then
print("Reason Unspecified")
end
end
end
Expected behaviour
- On method “Slow test card, approves after few minutes”, the transaction state should become
PENDING
. After few minutes, transaction state becomesPURCHASED
- On method “Slow test card, declines after few minutes”, the transaction state should become
PENDING
. After few minutes, transaction state becomesFAILED
orerror