Example #1
0
    private static void ReceivePurchaserInfoMethod(string arguments, PurchaserInfoFunc callback)
    {
        if (callback == null)
        {
            return;
        }

        var response = JSON.Parse(arguments);

        if (ResponseHasError(response))
        {
            callback(null, new Error(response["error"]));
        }
        else
        {
            var info = new PurchaserInfo(response["purchaserInfo"]);
            callback(info, null);
        }
    }
Example #2
0
    private static void ReceivePurchaserInfoMethod(string arguments, PurchaserInfoFunc callback)
    {
        if (callback == null)
        {
            return;
        }
        var response = JsonUtility.FromJson <ReceivePurchaserInfoResponse>(arguments);

        var error = response.error.message != null ? response.error : null;
        var info  = response.purchaserInfo.activeSubscriptions != null
            ? new PurchaserInfo(response.purchaserInfo)
            : null;

        if (error != null)
        {
            callback(null, error);
        }
        else
        {
            callback(info, null);
        }
    }
Example #3
0
 // ReSharper disable once UnusedMember.Global
 public void GetPurchaserInfo(PurchaserInfoFunc callback)
 {
     GetPurchaserInfoCallback = callback;
     _wrapper.GetPurchaserInfo();
 }
Example #4
0
 // ReSharper disable once Unity.IncorrectMethodSignature
 // ReSharper disable once UnusedMember.Global
 public void Reset(PurchaserInfoFunc callback)
 {
     ResetCallback = callback;
     _wrapper.Reset();
 }
Example #5
0
 public void Identify(string appUserId, PurchaserInfoFunc callback)
 {
     IdentifyCallback = callback;
     _wrapper.Identify(appUserId);
 }
Example #6
0
 // ReSharper disable once UnusedMember.Global
 public void CreateAlias(string newAppUserId, PurchaserInfoFunc callback)
 {
     CreateAliasCallback = callback;
     _wrapper.CreateAlias(newAppUserId);
 }
Example #7
0
 public void RestoreTransactions(PurchaserInfoFunc callback)
 {
     RestoreTransactionsCallback = callback;
     _wrapper.RestoreTransactions();
 }