Issue when purchase testing Android IAP product using "Slow test card" method

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

  1. On method “Slow test card, approves after few minutes”, the transaction state should become PENDING. After few minutes, transaction state becomes PURCHASED
  2. On method “Slow test card, declines after few minutes”, the transaction state should become PENDING. After few minutes, transaction state becomes FAILED or error
1 Like

Thank you for reporting this! I was not aware of slow test cards. How do you use them?

Could you please create a ticket in the extension-iap repository on GitHub so that we can start an investigation?

1 Like

That’s great. Thank you.

I still encounter the same issue when using the newest version of IAP extension.

here is my logcat when purchase testing google play products using the “Slow test card, approves after few minutes” method :

Hmm, ok, I was not able to reproduce this. Which Android OS version are you testing on?

Samsung A32 (Android 12) & Google Pixel 4 (Android 11)