Refund with Google Play IAP not working

Hi, Ive been trying to get refunds working with the google play store and am not having any luck.

 

I run a restore everytime the game is loaded… I have not yet been able to get a refunded state… Actually what happens is I cancel the purchase by requesting a refund through my test account, which cancels the order in my google wallet merchant account… wait around 24 hours (Ive read you have may have to wait between 24-48 hours before google will send a refund notification). After 24 hours I no longer recieve a purchased state (or restore… or refunded)… I dont recieve anything from the transaction listener after google refunds (Im assuming) the item. 

 

Is it possible to test for a refund with an app that is side loaded with a gmail account with license testing?

 

This is how I am calling the restore… It works for restoring purchases… but when I should be getting a  refund state… I dont get anything at all from the transaction listener. I dont believe its an error with my code… since the restores/purchases work… just not getting anything back from google when the purchases are refunded.

 

[lua]

 

local function transactionCallback( event )

   print(“In transactionCallback”, event.transaction.state)

   local transaction = event.transaction

   local tstate = event.transaction.state

print(tstate …“1st tstate, at top of callback”)

    print( “product identifier”, transaction.productIdentifier )

    print( “receipt”, transaction.receipt )

    print( “transaction identifier”, transaction.identifier )

    print( “date”, transaction.date )

    print( “original receipt”, transaction.originalReceipt )

    print( “original transaction identifier”, transaction.originalIdentifier )

    print( “original date”, transaction.originalDate )

   

   if tstate == “purchased” then

    local timeStamp = transaction.date/1000

      if timeStamp + 360 < os.time() then  – if the time stamp is older than 5 minutes, we will assume a restore.

print(“map this purchase to a restore”)

         tstate = “restored”

end

   end

   if tstate == “purchased” then

print(tstate)

        print( “product identifier”, transaction.productIdentifier )

        print( “receipt”, transaction.receipt )

        print( “transaction identifier”, transaction.identifier )

        print( “date”, transaction.date )

        print( “original receipt”, transaction.originalReceipt )

        print( “original transaction identifier”, transaction.originalIdentifier )

    print( “original date”, transaction.originalDate )

if transaction.productIdentifier == nonConsumable1 then – this can be canceled in the wallet

vault:set(“IAP1”, “unlocked”)

IAP1 = “unlocked”

print(“IAP1 unlocked”)

end

if transaction.productIdentifier == nonConsumable2 then

vault:set(“IAP2”, “unlocked”)

IAP2 = “unlocked”

print(“IAP2 unlocked”)

end

if transaction.productIdentifier == consumable1 then

print(“Consumable 1 was purchased”)

store.consumePurchase({consumable1}, transactionCallback)

end

if transaction.productIdentifier == consumable2 then

print(“Consumable 2 was purchased”)

store.consumePurchase({consumable2}, transactionCallback)

end

        native.showAlert(“Thank you!”, “Your support is greatly appreciated!”, {“Okay”})

vault:save()

        store.finishTransaction( transaction )

   elseif  tstate == “restored” then

        print(tstate)

        print(“Transaction restored (from previous session)”)

if transaction.productIdentifier == nonConsumable1 then – this can be canceled in the wallet

vault:set(“IAP1”, “unlocked”)

IAP1 = “unlocked”

print(“IAP1 was restored”)

end

if transaction.productIdentifier == nonConsumable2 then

vault:set(“IAP2”, “unlocked”)

IAP2 = “unlocked”

print(“IAP2 was restored”)

end

if IAPRestore == “unlocked” then

native.showAlert(“Thank you”, “Your purchases have been restored.”, {“Okay”})

        end

vault:save()

store.finishTransaction( transaction )  

   elseif tstate == “refunded” then

        print(tstate)

        print( “product identifier”, transaction.productIdentifier )

        print( “receipt”, transaction.receipt )

        print( “transaction identifier”, transaction.identifier )

        print( “date”, transaction.date )

        print( “original receipt”, transaction.originalReceipt )

        print( “original transaction identifier”, transaction.originalIdentifier )

        print( “original date”, transaction.originalDate )

        print(“User requested a refund – locking app back”)

if transaction.productIdentifier == nonConsumable1 then – this can be canceled in the wallet

vault:set(“IAP1”, “locked”)

IAP1 = “locked”

print(“IAP1 was locked for refund”)

end

if transaction.productIdentifier == nonConsumable2 then

vault:set(“IAP2”, “locked”)

IAP2 = “locked”

print(“IAP2 was locked for refund”)

end

 if IAPRestore == “unlocked” then

 native.showAlert(“Thank you”, “Your purchases have been refunded.”, {“Okay”})

      end

 vault:save()

 store.finishTransaction( transaction )

   elseif tstate == “cancelled” then

      print(tstate)

      print(“User cancelled transaction”)

      store.finishTransaction( transaction )

   elseif tstate == “failed” then

      print(tstate)

      print(“Transaction failed, type:”, transaction.errorType, transaction.errorString)

      native.showAlert(“Transaction Failed”, " type:" …transaction.errorType …"String: " …transaction.errorString, {“Okay”})

 store.finishTransaction( transaction )

   elseif tstate == “consumed” then

if transaction.productIdentifier == consumable1 then

print(“Consumable 1 was consumed”)

end

if transaction.productIdentifier == consumable2 then

print(“Consumable 2 was consumed”)

end

   store.finishTransaction( transaction )

   else

      print(“unknown event”)

      store.finishTransaction( transaction )

   end

      vault:save()

      print(“Finsihed with Store”)

end

 

 

timerStash.storeInit = timer.performWithDelay(1000, function() store.init( “google”, transactionCallback ) end, 1)

if (store.isActive) then

print(“Continuous Restore Check Fired”)

timerStash.storeRestoreTimer = timer.performWithDelay(15000, function() store.restore() end, 1)

end

 

[/lua]

 

 

Has anyone been able to get a refunded state back from google play?

I’m still struggling with this. Does anyone know if it is a problem with the v3 plugin? Or maybe refunds are something I shouldn’t worry about implementing as perhaps a lot of users do not know refunds are available through google?

Has anyone successfuly gotten a refund state from the google play store with the v3 plugin?

There will be refunds, but it’s very low percentage of your transactions.  The worst case is that the person keeps whatever they unlocked since you were not told to lock it back.

There have been other people in other threads seemingly having issues with this, but we don’t have any firm bug reports.  I’m not sure how easy it is to test refunds anyway.

Rob

@havochare4, you are not alone. I also have not been able to get the refunded state. I’ve done the same as you – make a purchase, refund it, wait and wait and every few hours check if the refund took effect within my app. Haven’t had any results. It’s hard to test when you have to wait days to get a result back…

It would be nice if other developers or someone at Corona confirmed that it worked, and listed the steps they took to make it work.

I realize that most users probably won’t ask for refunds, but the last thing I want is users figuring out that they can essentially get all the purchases in my app for free.

I would file a bug report, but given that I haven’t been able to actually see a refund event, I cannot prove whether it’s a bug or just something that I’m doing wrong.

I filed a bug report, case 39610.

Last year I had 5569 canceled/refunded orders, representing 14.9% of all my orders. So it is a significant issue which needs to be dealt with properly.

Testing a refund is trivial. Make a purchase from a non-test account, open the Google Wallet for your Google Play accound, refund the order.

Has anyone been able to get a refunded state back from google play?

I’m still struggling with this. Does anyone know if it is a problem with the v3 plugin? Or maybe refunds are something I shouldn’t worry about implementing as perhaps a lot of users do not know refunds are available through google?

Has anyone successfuly gotten a refund state from the google play store with the v3 plugin?

There will be refunds, but it’s very low percentage of your transactions.  The worst case is that the person keeps whatever they unlocked since you were not told to lock it back.

There have been other people in other threads seemingly having issues with this, but we don’t have any firm bug reports.  I’m not sure how easy it is to test refunds anyway.

Rob

@havochare4, you are not alone. I also have not been able to get the refunded state. I’ve done the same as you – make a purchase, refund it, wait and wait and every few hours check if the refund took effect within my app. Haven’t had any results. It’s hard to test when you have to wait days to get a result back…

It would be nice if other developers or someone at Corona confirmed that it worked, and listed the steps they took to make it work.

I realize that most users probably won’t ask for refunds, but the last thing I want is users figuring out that they can essentially get all the purchases in my app for free.

I would file a bug report, but given that I haven’t been able to actually see a refund event, I cannot prove whether it’s a bug or just something that I’m doing wrong.

I filed a bug report, case 39610.

Last year I had 5569 canceled/refunded orders, representing 14.9% of all my orders. So it is a significant issue which needs to be dealt with properly.

Testing a refund is trivial. Make a purchase from a non-test account, open the Google Wallet for your Google Play accound, refund the order.