Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved Testing a purchase on Google results in an order cancellation

Discussion in 'Unity IAP' started by unity_XKc65YPcwTlESg, Jan 11, 2023.

  1. unity_XKc65YPcwTlESg

    unity_XKc65YPcwTlESg

    Joined:
    Jan 20, 2020
    Posts:
    3
    On Android、
    Using Unity 2020.3.38
    and Unity In App Purchasing 4.5.2.
    Language:Japanese
    Model:SC-02K

    Issue occured while purchasing a NonConsumable on the Play Console's closed test application,
    executing storeController.InitiatePurchase();

    Google Play's purchase dialogue shows up as "Test card, 1-click purchase".
    After this, we opened the device's setting screen and signed out of the application.

    We quickly returned to the application, and pressed 1-click purchase

    Following that, the following completion message was displayed:
    Processing.
    Payment complete.

    And an email with the following headline was recieved:
    Recieved order for「Test: Google Play」

    But about 5 minutes later we recieved an email reading:
    cancellation details for「Test: Google Play」

    The application called IStoreListener.ProcessPurchase(),
    and checking GooglePurchaseState.Purchased shows the item was recieved,
    and in ProcessPurchase(), PurchaseProcessingResult.Complete is being returned.

    To summarize, currently the item is being recieved, while a few minutes later the order is being canceled,
    and until UnityPurchasing.Initialize() is called again the item can be freely used.

    Is there a way to prevent this cancellation
    Or alternatively, is there a way to detect a sign out?
     
  2. aVerrecchia

    aVerrecchia

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    34
    Hello @unity_XKc65YPcwTlESg
    Does this issue only happen in testing environment ?
    Can you reproduce the issue on apple ?
    By sign out did you mean : a user disconnection from the playstore / appstore ?

    For now we rely on what purchases we retrieve to say if a subscription is entitled or not. Restoring transactions is a way to check if the product is still entitled.
    Our next major release (5.0.0) will include a way for our user to check a product entitlement status.
     
  3. unity_XKc65YPcwTlESg

    unity_XKc65YPcwTlESg

    Joined:
    Jan 20, 2020
    Posts:
    3
    Thank you aVerrecchia

    >Does this issue only happen in testing environment ?
    Since it is an application before release, it is confirmed only in the test environment.
    Is it possible that it doesn't occur in a release environment?

    >Can you reproduce the issue on apple ?
    Apple cannot reproduce the problem.

    >By sign out did you mean : a user disconnection from the playstore / appstore ?
    yes. It will be the operation of deleting the account from the play store app.

    Why is the order canceled even though I am returning PurchaseProcessingResult.Complete?
     
  4. aVerrecchia

    aVerrecchia

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    34
    Thank you for your feedback,
    on google testing environment some in app purchase like subscriptions have a limited life time (for testing purposes) so yes your issue could only happen in testing.
    We do not have a "onUserDisconnectedFromStore" but we have error management when the google billing is unavailable for any reason, if a user's account is deleted from the play store app he won't be able to make any kind of purchase / transaction.
    Other Question : can you reproduce your issue "on demand" ?

    have a nice day :)
     
  5. unity_XKc65YPcwTlESg

    unity_XKc65YPcwTlESg

    Joined:
    Jan 20, 2020
    Posts:
    3
    Non-test card purchases had no issues.

    Thank you :)