Search Unity

Google developerPayload

Discussion in 'Unity IAP' started by Hema_domo, Jul 16, 2018.

  1. Hema_domo

    Hema_domo

    Joined:
    Jan 19, 2017
    Posts:
    2
    I set the google payload and then verify it on the server side, the resulting payload is always
    {"developerPayload":"*******************","is_free_trial":false,"has_introductory_price_trial":false,"is_updated":false}, that is not the string I've set.It seems Unity set a content to payload that overwrite my string. I am confused, please help me.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @Hema_domo You are receiving a string of asterisks? Can you show the code that you are using, and the payload that you are setting? Is it an ASCII string? Is this on your server?
     
  3. Hema_domo

    Hema_domo

    Joined:
    Jan 19, 2017
    Posts:
    2
    @JeffDUnity3D The code of purchase is below
    Code (CSharp):
    1.  
    2.  
    3.  
    4.     public static void Buy(string userId, string productId, LuaFunction callback) {
    5.         if (mIsBuying) {
    6.             if (callback != null) {
    7.                 callback.Call(failed_not_buying);
    8.             }
    9.             return;
    10.         }
    11.         mCurrentUserId = userId;
    12.         mCurrentProductId = productId;
    13.         mBuyCallback = callback;
    14.         mIsBuying = true;
    15.  
    16.         if (string.IsNullOrEmpty(userId)) {
    17.             SendBuyCallback(failed_user_not_found);
    18.             return;
    19.         }
    20.  
    21.         if (IsInitialized()) {
    22.             Product product = mListener.StoreController.products.WithID(productId);
    23.             if (product != null && product.availableToPurchase) {
    24.                 Debug.Log("PurchaserUtils Buy userId : " + userId);
    25.                 mListener.StoreController.InitiatePurchase(product, userId);
    26.             } else {
    27.                 SendBuyCallback(failed_product_not_found);
    28.             }
    29.         } else {
    30.             SendBuyCallback(failed_not_initialized);
    31.         }
    32.     }
    The 'userId' is a GUID string and line 'Debug.Log("PurchaserUtils Buy userId : " + userId);' hava show right userId.
    On the server side, I get purchase information from google succeed, but the payload is not the userId I've set.
    Full payload string received from google is {"developerPayload":"di1mNmUxNmJiMS0yNTJlLTRmY2UtOWJhZC1lM2UxM2I1NTJkNjA=\n","is_free_trial":false,"has_introductory_price_trial":false}
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry, I'm not quite following. Are you receiving a string of asterisks only? Please show the Debug.Log output and the corresponding string that you are seeing. And you mention "on the server side", can you elaborate? Is this your server? Where exactly are you seeing the string of asterisks?