Cancel Purchase state not returning correctly - Google Play IAP ver 3

Hi

I have been battling away with IAP version 3 plugin and finally managed to find a nice way to consumePurchases if already purchased by adding some catches into the unknown transaction.state catch. Just when I thought I had solved my woes I realised that cancel purchase is also returning as a unknown event thus firing code I do not want to. 

Has any one else had this problem? I can see in ADB output that the core underlying api is returning a cancelled event but corona does not give this back as the same. Please help its fairly important to get the cancelled state back as it should be. 

ADB output, which should output my cancelled prints instead:

D/IabHelper(23689): Ending async operation: launchPurchaseFlow D/IabHelper(23689): Purchase canceled - Response: 1:User Canceled D/dchan (23689): User canceled. (response: -1005:User cancelled) I/Corona (23689): [IAP] event.transaction.state: nil I/Corona (23689): [IAP] event.transaction.date: nil I/Corona (23689): [IAP] event.transaction.identifier: nil I/Corona (23689): [IAP] event.transaction.productIdentifier: nil I/Corona (23689): [IAP] Unknown event I/Corona (23689): [IAP] Purchase failed I/Corona (23689): [IAP] store.finishTransaction!!!!!!!: nil

My code looks like this :slight_smile:

Please assist. Thanks or confirm it should work etc. 

http://docs.coronalabs.com/daily/plugin/google-iap-v3/purchase.html

?

You should check event.transaction.isError, event.transaction.errorType, and event.transaction.errorString to see why an error occurred.  I’ll also update the documentation for the plugin.

Ok thanks, so instead of it returning cancelled for a cancel store event I should check the error string to see it equals “User canceled. (response: -1005:User cancelled)” or the ErrorType “-1005”. Not ideal, I think it should just return cancelled if working well.

?

You should check event.transaction.isError, event.transaction.errorType, and event.transaction.errorString to see why an error occurred.  I’ll also update the documentation for the plugin.

Ok thanks, so instead of it returning cancelled for a cancel store event I should check the error string to see it equals “User canceled. (response: -1005:User cancelled)” or the ErrorType “-1005”. Not ideal, I think it should just return cancelled if working well.