Example #1
0
        public void Pay(EB.IAP.Item item, EB.IAP.Transaction transaction, System.Action <int> callback)
        {
            EB.Debug.Log("QiHooSDKManager.Pay={0}");
            if (!mInitialized)
            {
                EB.Debug.LogError("QiHooSDKManager.Pay: not initialized");
                callback(QiHooPayStatusCode.FAIL);
                return;
            }

            mPayCallback += callback;
            var    user       = Hub.Instance.LoginManager.LocalUser;
            object obj        = EB.JSON.Parse(transaction.payload);
            string servername = EB.Dot.String("serverName", obj, "111");
            int    balance    = EB.Dot.Integer("balance", obj, 1000);
            string aname      = EB.Dot.String("aName", obj, "111");

            EB.Debug.Log(servername + balance + aname);
            QiHooGameSDK.Pay(GetUserId(), item.cents.ToString(), item.longName, item.productId, mNotifyUrl, user.Name, user.Id.ToString(), transaction.transactionId
                             , 1, user.WorldId.ToString(), servername, 10, "钻石", user.Level, balance, user.Vip.ToString(), aname);
        }
Example #2
0
        static StackObject *Invoke_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            EB.IAP.Transaction @arg2 = (EB.IAP.Transaction) typeof(EB.IAP.Transaction).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            EB.IAP.Item @arg1 = (EB.IAP.Item) typeof(EB.IAP.Item).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.Action <EB.IAP.Item, EB.IAP.Transaction> instance_of_this_method = (System.Action <EB.IAP.Item, EB.IAP.Transaction>) typeof(System.Action <EB.IAP.Item, EB.IAP.Transaction>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Invoke(@arg1, @arg2);

            return(__ret);
        }
Example #3
0
        public void Pay(EB.IAP.Item item, EB.IAP.Transaction transaction, System.Action <int> callback)
        {
            EB.Debug.Log("AlipaySDKManager.Pay");
            if (!mInitialized)
            {
                //EB.Debug.LogError("AlipaySDKManager.Pay: not initialized");
                //callback(AlipaySDKResultCode.Failed);
                //return;
                IAPInit();
            }
            mPayCallback += callback;

            object extraInfo = EB.JSON.Parse(transaction.payload);
            string info      = EB.Dot.String("ret", extraInfo, string.Empty);

            int    je   = (int)item.cost;
            string mark = transaction.transactionId;
            string name = item.longName;

            EB.Debug.Log("AlipaySDKManager.Pay: je = {0}, mark={1}, name = {2}", je, mark, name);
            AlipaySDK.Pay(info);
        }
Example #4
0
        static StackObject *PurchaseOffer_3(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Collections.Hashtable @table = (System.Collections.Hashtable) typeof(System.Collections.Hashtable).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            EB.IAP.Item @item = (EB.IAP.Item) typeof(EB.IAP.Item).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            EB.Sparx.WalletManager instance_of_this_method = (EB.Sparx.WalletManager) typeof(EB.Sparx.WalletManager).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.PurchaseOffer(@item, @table);

            return(__ret);
        }
Example #5
0
        public void Pay(EB.IAP.Item item, EB.IAP.Transaction transaction, Action <int> callback)
        {
            if (!mInitialized)
            {
                callback(YiJieSDKConfig.PAY_FAILURE);
                EB.Debug.LogError("YiJiSDK.Pay: not initialized");
                return;
            }
            mPayCallback += callback;
            int    unitPrice = 10;
            string unitName  = EB.Localizer.GetString("ID_LADDER_STAGE_ZUANSHI");
            int    count     = item.cents / 10;

            if (item.productId == "com.manhuang.fusesandbox.aliancecard" || item.productId == "com.manhuang.fusesandbox.monthcard")
            {
                unitPrice = item.cents;
                unitName  = item.longName;
                count     = 1;
            }
            string callbackInfo = transaction.transactionId;

            YiJieSDK.pxPay(unitPrice, unitName, count, callbackInfo, mCallbackUrl);
            EB.Debug.Log("YiJieSDKManager.Pay unitPrice = {0} unitName = {1} count = {2} callBackInfo = {3} callBackUrl = {4}", unitPrice, unitName, count, callbackInfo, mCallbackUrl);
        }
Example #6
0
        public void Pay(EB.IAP.Item item, EB.IAP.Transaction transaction, System.Action <int, object> callback)
        {
            EB.Debug.Log("VivoSDKManager.Pay");
            if (!mInitialized)
            {
                EB.Debug.LogError("QiHooSDKManager.Pay: not initialized");
                callback(VivoStatusCode.FAIL, null);
                return;
            }

            mPayCallback += callback;
            var  user = Hub.Instance.LoginManager.LocalUser;
            long uid  = user.Id.Value;
            //int worldId = user.WorldId;
            string userName    = user.Name;
            int    level       = user.Level;
            int    vipLevel    = user.Vip;
            object payload     = JSON.Parse(transaction.payload);
            string accessKey   = EB.Dot.String("accessKey", payload, string.Empty);
            string orderNumber = EB.Dot.String("orderNumber", payload, string.Empty);

            VivoGameSDK.Pay(item.cents, level, item.longName, item.localizedDesc, vipLevel.ToString(), "noalliance", uid.ToString(), userName, "serverName", orderNumber, accessKey);
            //EB.Debug.LogError("price={0},level={1},productName={2},productDes={3},vip={4},party={5},roleId={6},roleName={7},serverName={8},transNo={9},accessKey={10}", item.cents, level, item.longName, item.localizedDesc, vipLevel.ToString(), "noalliance", uid.ToString(), userName, "serverName", orderNumber, accessKey);
        }
Example #7
0
 private void SetDataAfterCharge(EB.IAP.Item item, EB.IAP.Transaction trans)
 {
     TimerManager.instance.AddTimer(3000, 1, SetChargeDataDelay);
 }
Example #8
0
        private void OnBattlePassBtnClick()
        {
            if (!sTaskOver || LTWelfareGrowUpController.ActivityOver)
            {
                return;
            }
            sTaskOver = false;
            InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f);

            if (!LTWelfareModel.Instance.HasBattlePass)//需要购买密令
            {
                EB.IAP.Item GiftItem = null;
                EB.Sparx.Hub.Instance.WalletManager.GetGiftItem(6001, out GiftItem);
                //GlobalMenuManager.Instance.Open("LTChargeStoreGiftUI", GiftItem);
                GlobalMenuManager.Instance.Open("LTBattlePassTipsView", GiftItem);
            }
            else//领奖
            {
                LTWelfareModel.Instance.RequestBattlePassComplete(Data.TaskId.ToString(), delegate(bool success) {
                    if (success)
                    {
                        if (LTWelfareEvent.WelfareGrowUpUpdata != null)
                        {
                            LTWelfareEvent.WelfareGrowUpUpdata();
                        }

                        {
                            var ht = Johny.HashtablePool.Claim();
                            ht.Add("0", TitleLabel.text);
                            MessageTemplateManager.ShowMessage(901036, ht, null);
                            Johny.HashtablePool.Release(ht);
                        }

                        System.Action callback = delegate()
                        {
                            if (EB.Sparx.Hub.Instance.LevelRewardsManager.IsLevelUp)
                            {
                                LTMainHudManager.Instance.CheckLevelUp(delegate() {
                                    sTaskOver = true;
                                });
                            }
                            else
                            {
                                sTaskOver = true;
                            }
                        };
                        List <LTShowItemData> ItemDatas = Hotfix_LT.Data.TaskTemplateManager.Instance.GetBattlePassByTaskId(Data.TaskId);
                        for (int i = 0; i < ItemDatas.Count; i++)
                        {
                            if (ItemDatas[i].id == "hc")
                            {
                                FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.hc, ItemDatas[i].count, "福利成长获得");
                            }
                            if (ItemDatas[i].id == "gold")
                            {
                                FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.gold, ItemDatas[i].count, "福利成长获得");
                            }
                        }

                        {
                            var ht = Johny.HashtablePool.Claim();
                            ht.Add("reward", ItemDatas);
                            ht.Add("callback", callback);
                            GlobalMenuManager.Instance.Open("LTShowRewardView", ht);
                        }
                    }
                    sTaskOver = true;
                });
            }
            sTaskOver = true;
        }
Example #9
0
        static StackObject *GetGiftItem_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            EB.IAP.Item @item = (EB.IAP.Item) typeof(EB.IAP.Item).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack));

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 @id = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            EB.Sparx.WalletManager instance_of_this_method = (EB.Sparx.WalletManager) typeof(EB.Sparx.WalletManager).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            var result_of_this_method = instance_of_this_method.GetGiftItem(@id, out @item);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.StackObjectReference:
            {
                var    ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                object ___obj = @item;
                if (___dst->ObjectType >= ObjectTypes.Object)
                {
                    if (___obj is CrossBindingAdaptorType)
                    {
                        ___obj = ((CrossBindingAdaptorType)___obj).ILInstance;
                    }
                    __mStack[___dst->Value] = ___obj;
                }
                else
                {
                    ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain);
                }
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @item;
                }
                else
                {
                    var ___type = __domain.GetType(___obj.GetType()) as CLRType;
                    ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @item);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var ___type = __domain.GetType(ptr_of_this_method->Value);
                if (___type is ILType)
                {
                    ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @item;
                }
                else
                {
                    ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @item);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as EB.IAP.Item[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = @item;
            }
            break;
            }

            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            __intp.Free(ptr_of_this_method);
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
Example #10
0
 public virtual void OnOfferPurchaseSuceeded(EB.IAP.Item item, EB.IAP.Transaction trans)
 {
     EB.Util.BroadcastMessage("OnOfferPurchaseSuceeded", item);
 }
Example #11
0
        private void TriggerLimitedTimeGift(Hotfix_LT.Data.LimitedTimeGiftTemplate data)
        {
            //额度检测
            int   PayoutID  = 0;
            float Recharge  = LTChargeManager.CumulativeRecharge;
            float Weighting = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("LimitTimeGiftWeighting");

            //本地额度运用
            Recharge = Recharge / Mathf.Max(Weighting, 1f);
            float LocalWeighting = GetLocalWeighting(Recharge);

            if (LocalWeighting > 0)
            {
                Recharge = Recharge - LocalWeighting;
            }
            EB.IAP.Item item = null;
            for (int i = 0; i < data.GiftList.Count; ++i)
            {
                if (EB.Sparx.Hub.Instance.WalletManager.GetGiftItem(data.GiftList[i], out item))
                {
                    PayoutID = item.payoutId;
                    if (item.cost * 100 > Recharge)
                    {
                        break;
                    }
                }
            }
            if (PayoutID > 0)
            {
                ArrayList ArrTemp;
                DataLookupsCache.Instance.SearchDataByID <ArrayList>(string.Format("userLimitedTimeGift.{0}.data", data.ID), out ArrTemp);
                int count = 0;
                if (ArrTemp != null)
                {
                    for (int j = 0; j < ArrTemp.Count; ++j)
                    {
                        int PID = EB.Dot.Integer("payoutId", ArrTemp[j], 0);
                        if (PID == PayoutID)
                        {
                            int OverTime = EB.Dot.Integer("overTime", ArrTemp[j], 0);
                            if (EB.Time.Now < OverTime)
                            {
                                count++;
                            }
                        }
                    }
                    if (item != null && item.limitNum > 0 && count >= item.limitNum)
                    {
                        return;
                    }
                }
                Api.RequestTriggerLimitedTimeGift(data.ID, PayoutID, delegate(Hashtable result)
                {
                    if (result != null)
                    {
                        DataLookupsCache.Instance.CacheData(result);
                        ReflashLimitedTimeGiftInfo();
                        if (!GuideNodeManager.IsGuide && !ShowGiftList.Contains(PayoutID))
                        {
                            ShowGiftList.Enqueue(PayoutID);
                        }
                        //增加本地额度
                        SetLocalWeightingList(data.ID);
                    }
                });
            }
        }
Example #12
0
 private static void OnPurchaseSucced(EB.IAP.Item offer, EB.IAP.Transaction trans)
 {
     PostPay(offer.cost, trans.platform, offer.value);
 }
Example #13
0
 public abstract void Pay(EB.IAP.Item item, EB.IAP.Transaction transaction, System.Action <int> callback);
Example #14
0
        public override void Pay(EB.IAP.Item item, EB.IAP.Transaction transaction, System.Action <int> callback)
        {
            EB.Debug.Log("XinkuaiSDKManager.Pay");

            if (item == null || transaction == null)
            {
                EB.Debug.LogError("XinkuaiSDKManager.Pay: item == null || transaction == null!!!");
                callback?.Invoke(XinkuaiSDKResultCode.Failed);
                return;
            }

            if (!mInitialized)
            {
                EB.Debug.LogError("XinkuaiSDKManager.Pay: not initialized!!!");
                callback?.Invoke(XinkuaiSDKResultCode.Failed);
                return;
            }

            mPayCallback += callback;

            object extraInfo   = EB.JSON.Parse(transaction.payload);
            int    price       = Mathf.FloorToInt(item.cost * 100f);
            string productId   = item.productId;
            string productName = item.longName;
            string productDesc = item.localizedDesc;
            string orderId     = transaction.transactionId;
            string roleId      = roleData.roleId;
            string roleName    = roleData.roleName;
            int    roleLevel   = roleData.roleLevel;
            string serverId    = roleData.serverId;
            string serverName  = roleData.serverName;

#if UNITY_IPHONE
            string extension = EB.Dot.String("callbackInfo", extraInfo, "0");
#else
            string extension = EB.Dot.String("callbackInfo", extraInfo, string.Empty);
#endif


            EB.Debug.Log("XinkuaiSDKManager.Pay: roleId = {0},roleName = {1},roleLevel = {2},serverId = {3},serverName = {4},CurHCCount = {5}", roleId, roleName, roleLevel, serverId, serverName, CurHCCount);
#if UNITY_ANDROID
            //price, productId, productName, productDesc, orderId, roleId, roleName, roleLevel, serverId, serverName, coinNum, payNotifyUrl, extension
            XinkuaiSDK.Pay(price, productId, productName, productDesc, orderId, roleId, roleName, roleLevel, serverId, serverName, CurHCCount, mNotifyUrl, extension);
#endif

#if UNITY_IPHONE
            //rmb 充值金额 单位元
            //productID iTunes 苹果后台配置的内购物品的产品ID
            //name 商品名
            //charid 角色ID
            //serverid 服务器ID
            //info 扩展信息
            //cporderid 游戏商订单ID
            // string payInfo = cost + ";"
            //     + transaction.productId + ";"
            //     + name + ";"
            //     + charId + ";"
            //     + serverId + ";"
            //     + callbackInfo + ";"
            //     + cporderId;
            // Debug.LogError("支付内容:payInfo:" + payInfo);
            EB.Debug.Log("XinkuaiSDKManager.Pay: productName = {0},productDesc = {1},orderId = {2},productId = {3},price = {4},extension = {5}", productName, productDesc, orderId, productId, price, extension);
            XinkuaiSDK.Pay(productName, productDesc, orderId, productId, serverId, price, extension /*, mNotifyUrl*/);
#endif
        }
Example #15
0
 public static void Wallet_OnOfferPurchaseSuceeded(EB.IAP.Item item, EB.IAP.Transaction trans)
 {
     Messenger.Raise(Hotfix_LT.EventName.OnOfferPurchaseSuceeded, item, trans);
 }
Example #16
0
        public override void SetMenuData(object param)
        {
            if (param == null)
            {
                return;
            }

            base.SetMenuData(param);

            if (param is EB.IAP.Item)
            {
                curGiftType   = EGiftType.eCharge;
                curChargeData = param as EB.IAP.Item;

                //设置商品价钱
                if (MoneyPriceLab != null && curChargeData != null)
                {
                    MoneyPriceLab.text = curChargeData.localizedCost;
                }

                //设置奖励图标
                if (ShowItemList == null)
                {
                    //写死的密令奖励展示
                    string   str          = Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("BattlePassTips");
                    string[] allItemInfos = str.Split(',');
                    ShowItemList = new List <LTShowItem>();
                    string[] itemInfo;

                    if (ItemObj == null)
                    {
                        ItemObj = controller.transform.FindEx("Container/Content/Item").gameObject;
                    }

                    for (int i = 0; i < allItemInfos.Length; i++)
                    {
                        itemInfo = allItemInfos[i].Split(':');
                        GameObject itemObj  = GameObject.Instantiate(this.ItemObj, Grid.transform);
                        LTShowItem tempItem = itemObj.transform.Find("LTShowItem").GetMonoILRComponent <LTShowItem>();
                        itemObj.SetActive(true);
                        tempItem.LTItemData = new LTShowItemData(itemInfo[0], int.Parse(itemInfo[2]), itemInfo[1], false);
                        ShowItemList.Add(tempItem);
                    }

                    if (Grid != null)
                    {
                        Grid.enabled = true;
                        Grid.Reposition();
                    }

                    if (ScrollView != null)
                    {
                        SpringPanel.Begin(ScrollView.gameObject, new Vector3(0, -40, 0), 13.0f);
                        ScrollView.enabled = allItemInfos.Length > 12;
                    }
                }
            }
            else
            {
                EB.Debug.LogError("[{0}]为什么传入的数据类型不是 EB.IAP.Item? param.GetType():{1}", Time.frameCount, param.GetType());
            }
        }