Search Unity

OnPurchaseFailed reports Android PurchaseFailureReason.PaymentDeclined as Unknown instead

Discussion in 'Unity IAP' started by skullthug, Jan 26, 2021.

  1. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    202
    Currently in the process of converting our store handling from Android Native Pro to Unity IAP.
    Using latest 2.2.6 Unity IAP on Unity 2018.4.26. Primary testing device is a Galaxy Note 5.
    I've discovered an annoying bug where if I use Google's purchase testing flow to simulate a charge card being declined, Unity IAP will report the result as PurchaseFailureReason.Unknown instead of PurchaseFailureReason.PaymentDeclined.

    This is annoying because I have specific error messaging I use for Unknown only as a last ditch effort (Unknown Error occurred, maybe check your network connection yada yada), and having that messaging appear when the payment was declined is confusing, redundant, and bad UX- because the user just received a bunch of messages from Google Play itself saying what went wrong, and then I'm at the end with my un-necessary Unknown Error.
     
    greay likes this.
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We are a pass through service for the Google API, we don't generate the error message. I don't follow your at the end comment, was there additional text returned?
     
  3. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    202
    This isn't about the error message, this is about the result being reported on the OnPurchaseFailed(Product product, PurchaseFailureReason failureReason) event. PurchaseFailureReason always comes back as PurchaseFailureReason.Unknown instead of PurchaseFailureReason.PaymentDeclined.


    Ignore the bit about the additional text, that is just me rambling about how I can't catch this result anymore and handle it appropriately with the UI.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Correct. We have no control over the error reason either.
     
  5. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    202
    That's very strange. My Android Native Pro billing usage was able to catch it, but that implementation is going on 2 years old now and predates whatever the V3 Billing system Google put out is.
    I guess I'll also see if this occurs on newer devices. It's frustrating because, well.. what is PurchaseFailureReason.PaymentDeclined on Android even good for then?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Good for? Is that another rhetorical question? I'm not always sure, I might suggest to minimize the emotive comments, thanks. My suspicion is that Google is not explicitly returning PaymentDeclined, so we may be mapping the actual reason code to Unknown (the catch all). It could be an artifact of their Decline test process too. Which means your users would not see this. We can look into this as a feature request to investigate further (so no specific time frame)
     
  7. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    202
    Sorry that was not meant as any aggression, more just me being puzzled about if this is an oversight by Google.
    Only because Google lets you set up a test situation that specifically lets you try out the declined flow, so why would they not actually send the correct result is weird.

    Again this wasn't a problem with the previous billing package I was using, but I have no idea if Stan's Assets was doing some odd stuff to make it work. And so much has changed with the Google billing stuff in the last 2 years I can't really call anything out here confidently.
     

    Attached Files:

    JeffDUnity3D likes this.