Search Unity

Payload is empty when restoring in UnityIAP

Discussion in 'Unity IAP' started by churapps_yw, Sep 21, 2021.

  1. churapps_yw

    churapps_yw

    Joined:
    Jul 9, 2018
    Posts:
    6
    In UnityIAP, the payload may be empty when restoring. Can anyone tell me why this is happening and how to fix it?
    I've been able to charge without any problems, but this is only happening to one user.
    I haven't done any Unity update or IAP update.

    Unity version: 2019.4.20
    IAP version: 2.2.7

    The contents of the receipt for UnityEngine.Purchasing.Product are as follows.

    {"Store":"AppleAppStore","TransactionID":"XXXXXXXXXXXXXXXXXX","Payload":""}


    -----

    UnityIAPでリストア時にpayloadが空になってしまうことがあるのですが、こちら原因や対処方法が分かる方いらっしゃいますか?
    今まで問題無く課金出来ていましたが、1人のユーザーだけ起きている現象となっています。
    その間にUnityアップデートやIAPのアップデートはしてない状態となります。

    Unityバージョン:2019.4.20
    IAPバージョン:2.2.7

    UnityEngine.Purchasing.Productのreceiptの中身は以下になります。
    {"Store":"AppleAppStore","TransactionID":"XXXXXXXXXXXXXXXXXX","Payload":""}
     
    clpmatsu likes this.
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The stores have removed the payload feature, for security. What are you using the payload for?
     
  3. churapps_yw

    churapps_yw

    Joined:
    Jul 9, 2018
    Posts:
    6
    It is used for receipt verification on the server side.
    Except for this user

    {"Store":"AppleAppStore","TransactionID":"XXXXXXXXXXXXXXXXXX","Payload":""}


    has an apple receipt in its payload.

    ---

    サーバー側でレシート検証の為に使用しています。
    このユーザー以外は
    {"Store":"AppleAppStore","TransactionID":"XXXXXXXXXXXXXXXXXX","Payload":""}
    のpayloadの中身にappleのレシートがある状態となっています。
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The developer payload is not longer available from the store API's.
     
  5. churapps_yw

    churapps_yw

    Joined:
    Jul 9, 2018
    Posts:
    6
    {"Store":"AppleAppStore","TransactionID":"XXXXXXXXXXXXXXXXXX","Payload":""}


    is the "product.receipt" returned by UnityPurchasing.
    It is different from the developer payload.

    ---

    {"Store":"AppleAppStore","TransactionID":"XXXXXXXXXXXXXXXXXX","Payload":""}
    はUnityPurchasingが返している「product.receipt」となります。
    developer payloadとは別のものです。
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Understood. Please provide specific steps to reproduce and the code you are using. Is this in TestFlight? We just pass along the information that the Apple Storekit provides to us. Is it just this one user? What is different about this user? Please keep in mind that in testing, a user can only renew a subscription 6 times, perhaps related.
     
  7. churapps_yw

    churapps_yw

    Joined:
    Jul 9, 2018
    Posts:
    6
    This is an issue that has only occurred for one user.
    The problem started on September 16, and the bug was fixed on September 30.
    The bug was resolved when the app version was upgraded one level from the version where the problem occurred.
    It is likely that the bug was resolved when the version was upgraded.
    We didn't include any support for this issue in the version upgrade. We expect that the receipt information cached locally by Unity was cleared at that time.
    It was the next version after the one that was resolved that we put in a fix that we thought would fix it.

    We are not sure what caused the problem, but it is solved. Thank you very much.

    ---

    これは1人のユーザーのみに発生した問題です。
    この問題は9月16日から起こっていて、9月30日のタイミングでバグが解消されました。
    解消されたのは問題が発生したバージョンからアプリバージョンが1つ上がったときでした。
    恐らく、バージョンアップ時にバグが解消されたと思われます。
    バージョンアップ時にこの問題に対する対応は入れていませんでした。そのタイミングでUnity側がローカルにキャッシュしているレシート情報がクリアされたんじゃないかと予想しています。
    我々がこれで直るんじゃないか、という対策を入れたのは解消されたバージョンの次のバージョンでした。

    原因ははっきりしませんが、解決しました。ありがとうございました。
     
  8. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    390
    I'm confused about this. Are you saying that the payload is not available in StoreKit Test environments? On real user devices, the payload should always be provided, correct? Because there's a whole section in the manual about doing client-side validation that relies on the receipt payload being there in order to validate a purchase. It even talks about provided a StoreKitTest certificate tangle for testing environments. How can we validate Apple purchases if this payload is missing?