Search Unity

【Android】PurchaseFailureReason.UserCancelled is called on resumption after interrupting...

Discussion in 'Unity IAP' started by norimatsu_yusuke, Oct 7, 2021.

  1. norimatsu_yusuke

    norimatsu_yusuke

    Joined:
    Sep 17, 2019
    Posts:
    4
    【Android】PurchaseFailureReason.UserCancelled is called on resumption after interrupting an on going purchase in Google Store, but payment is done.

    Unity IAP version is 4.0.3.

    When user resume their app through the Android Launcher after interrupting an ongoing purchase,
    IStoreListener.OnPurchaseFailed(PurchaseFailureDescription.reason: PurchaseFailureReason.UserCancelled)
    is called on resumption.

    However, the payment is completed and email that notifies it is sent.

    So, the situation that payment is completed but product is not provided to user may be occurred.


    How can we distinguish between purchase cancelation by user selection on regular purchase flow and by resumption after interrupting an on going purchase?
     
    Last edited: Oct 7, 2021
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide specific steps to reproduce, we have heard of similar reports.
     
  3. norimatsu_yusuke

    norimatsu_yusuke

    Joined:
    Sep 17, 2019
    Posts:
    4
    Thanks for your reply.

    The following steps reproduce the case.

    1. Click purchase button in app and start purchase flow.
    (Execute
    IStoreController.InitiatePurchase()
    .)
    2. Purchase confirm dialog of Google Play is opened.
    3. Click buy button.
    4. Payment completion dialog of Google Play is opened.
    5. While payment completion dialog is opening, send app to the background via the device's Home key.
    6. Resume app by tapping the app's icon in the Android Launcher.
    7.
    IStoreListener.OnPurchaseFailed(PurchaseFailureDescription.reason: PurchaseFailureReason.UserCancelled)
    is sent but the email notifying payment completion is sent from Google Play.
     
    Last edited: Oct 7, 2021
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it, I will test similarly.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I have been able to reproduce, thank you for providing good details. I will let engineering know.
     
  6. norimatsu_yusuke

    norimatsu_yusuke

    Joined:
    Sep 17, 2019
    Posts:
    4