Exemple #1
0
    public virtual void OnCheckOrdersSuccess(CheckOrderRess resList)
    {
        Debug.Log("OnCheckOrdersSuccess==>ObjectDumper Length:" + resList.CheckOrderRess_.Count + "\n" +
                  ObjectDumper.Dump(resList));

        PayHelper.SetGlobal(resList);

        List <string> list = new List <string>();

        foreach (var res in resList.CheckOrderRess_)
        {
            list.Add(res.OrderId);

            JSONObject json = new JSONObject(res.Extra);
            Debug.Log("OnCheckOrdersSuccess==>res.Extra " + res.Extra);

            ProductVo vo = GlobalData.PayModel.GetProduct(res.CommodityId);
            SdkHelper.StatisticsAgent.OnPayEnd(res.OrderId, PayChannel, vo);

            if (res.Amount <= 0 || string.IsNullOrEmpty(res.OrderId))
            {
                BuglyAgent.ReportException("PayAgent", "Amount:" + res.Amount + "  OrderId:" + res.OrderId, "none");
            }

            payChecker.RemoveOrder(res.OrderId);
        }

        if (resList.Awards?.Count > 0)
        {
            RewardUtil.AddReward(resList.Awards);
            AwardWindow awardWindow = PopupManager.ShowWindow <AwardWindow>("GameMain/Prefabs/AwardWindow/AwardWindow");
            awardWindow.SetData(resList.Awards, I18NManager.Get("Common_RechargeSuccess"));
        }

        Debug.Log("GlobalData.PlayerModel.PlayerVo.ExtInfo" + resList.UserExtraInfo);

        EventDispatcher.TriggerEvent(EventConst.GetPayInfoSuccess, resList.UserBuyRmbMall);

        if (resList.TriggerId != null && resList.TriggerId.Count > 0)
        {
            Debug.LogWarning("resList.TriggerId-------->" + resList.TriggerId[0]);
            EventDispatcher.TriggerEvent(EventConst.TriggerGiftPaySuccess, resList.TriggerId);
        }

        if (resList.UserBuyRmbMall == null)
        {
            string orderId = "none";
            if (list.Count > 0)
            {
                orderId = list[0];
            }
            BuglyAgent.ReportException("checkOrderSuccess UserBuyRmbMall", "resList.UserBuyRmbMall为空 orderId:" + orderId, "");
        }
    }
Exemple #2
0
    private void OnCheckPayListSuccess(CheckOrderRess resList)
    {
        PayHelper.SetGlobal(resList);

        if (resList.Awards?.Count > 0)
        {
            RewardUtil.AddReward(resList.Awards);

            AwardWindow awardWindow = PopupManager.ShowWindow <AwardWindow>("GameMain/Prefabs/AwardWindow/AwardWindow");
            awardWindow.SetData(resList.Awards);
        }

        EventDispatcher.TriggerEvent(EventConst.GetPayInfoSuccess, resList.UserBuyRmbMall);

        List <string> list = new List <string>();

        foreach (var res in resList.CheckOrderRess_)
        {
            list.Add(res.OrderId);
            if (res.Status == OrderStatusPB.StatusFiish)
            {
                Debug.Log("充值成功---TransactionId:" + res.TransactionId);
            }
            else
            {
                Debug.Log("充值状态:" + res.Status + " ---TransactionId:" + res.TransactionId);
            }

            ProductVo vo = GlobalData.PayModel.GetProduct(res.CommodityId);
            SdkHelper.StatisticsAgent.IOSPay(res, vo);
        }

        Debug.Log("OnCheckPayListSuccess resList.TransactionId=======>" + ObjectDumper.Dump(resList.TransactionId));

        Debug.Log("first" + GlobalData.PlayerModel.PlayerVo.FirstRecharges.Count);

        GalaSDKBaseFunction.EndPay(GalaSDKBaseFunction.GalaSDKType.Apple, resList.TransactionId.ToArray());

        if (resList.TriggerId != null && resList.TriggerId.Count > 0)
        {
            Debug.LogWarning("resList.TriggerId-------->" + resList.TriggerId[0]);
            EventDispatcher.TriggerEvent(EventConst.TriggerGiftPaySuccess, resList.TriggerId);
        }

        if (resList.UserBuyRmbMall == null)
        {
            string orderId = "none";
            if (list.Count > 0)
            {
                orderId = list[0];
            }
            BuglyAgent.ReportException("checkOrderSuccess UserBuyRmbMall", "resList.UserBuyRmbMall为空 orderId:" + orderId, "");
        }
    }
    private void OnCheckOrdersSuccess(CheckOrderRess resList)
    {
        Debug.Log("OnCheckOrdersSuccess==>ObjectDumper Length:" + resList.CheckOrderRess_.Count + "\n" +
                  ObjectDumper.Dump(resList));

        PayHelper.SetGlobal(resList);

        List <string> list = new List <string>();

        foreach (var res in resList.CheckOrderRess_)
        {
            JSONObject json = new JSONObject(res.Extra);
            Debug.Log("OnCheckOrdersSuccess==>res.Extra " + res.Extra);

            string data = json["signedData"].str;
            data = data.Replace("\\", "");

            JSONObject signedData = new JSONObject(data);

            JSONObject purchaseToken = signedData["purchaseToken"];

            Debug.Log("OnCheckOrdersSuccess==>purchaseToken " + purchaseToken.str);

            list.Add(purchaseToken.str);

            ProductVo vo = GlobalData.PayModel.GetProduct(res.CommodityId);
            SdkHelper.StatisticsAgent.OnPayEnd(res.OrderId, PayAgent.PayChannel, vo);

            if (res.Amount <= 0 || string.IsNullOrEmpty(res.OrderId))
            {
                BuglyAgent.ReportException("GooglePlay_Pay", "Amount:" + res.Amount + "  OrderId:" + res.OrderId, "none");
            }
        }

        GalaSDKBaseFunction.EndPay(GalaSDKBaseFunction.GalaSDKType.Google, list.ToArray());

        if (resList.Awards?.Count > 0)
        {
            RewardUtil.AddReward(resList.Awards);
            AwardWindow awardWindow = PopupManager.ShowWindow <AwardWindow>("GameMain/Prefabs/AwardWindow/AwardWindow");
            awardWindow.SetData(resList.Awards);
        }

        Debug.Log("GlobalData.PlayerModel.PlayerVo.ExtInfo" + resList.UserExtraInfo);
        EventDispatcher.TriggerEvent(EventConst.GetPayInfoSuccess, resList.UserBuyRmbMall);

        if (resList.TriggerId != null && resList.TriggerId.Count > 0)
        {
            Debug.LogWarning("resList.TrigerId-------->" + resList.TriggerId[0]);
            EventDispatcher.TriggerEvent(EventConst.TriggerGiftPaySuccess, resList.TriggerId);
        }
    }