Exemple #1
0
        public async Task <ApiResult <string> > Add(PayType parm)
        {
            int curTimeStamp = DateTime.Now.ToTimeStamp();

            parm.Type_name   = parm.Type_name ?? "";
            parm.Type_alias  = parm.Type_alias ?? "";
            parm.Type_note   = parm.Type_note ?? "";
            parm.Update_time = curTimeStamp;
            parm.Create_time = curTimeStamp;
            var res = await PayTypeBll._.IsExist(d => d.Type_alias == parm.Type_alias);

            if (res.statusCode == 200)
            {
                if (res.success)
                {
                    return(new ApiResult <string>()
                    {
                        statusCode = (int)ApiEnum.Error, message = string.Format("已经存在{0}的支付类型", parm.Type_alias)
                    });
                }
                else
                {
                    return(await PayTypeBll._.AddAsync(parm));
                }
            }
            else
            {
                return(new ApiResult <string>()
                {
                    statusCode = (int)ApiEnum.Error, message = "唯一性检测出错"
                });
            }
        }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //支付成功前,统一跳转到此页面
        code = Request.QueryString["code"]; //支付接口编号
        type = Request.QueryString["type"]; //支付类型, OD为订单
        num  = Request.QueryString["num"];  //相应的单号

        BLL.Pay.PayEntity entity = new BLL.Pay.PayEntity(code);
        //在线支付的,跳转到指定支付页
        if (code == "01")
        {
            if (!string.IsNullOrEmpty(entity.sendURL))
            {
                string key = BLL.Pay.PayHepler.dataEncrypt(num + type + code);
                string url = entity.sendURL + "?code=" + code
                             + "&num=" + num + "&type=" + type + "&key=" + key;
                Response.Redirect(entity.sendURL + "?code=" + code
                                  + "&num=" + num + "&type=" + type + "&key=" + key);
                Response.End();
            }
            else
            {
                //非在线支付的,直接输出内容
                Response.Write(entity.content);
                Response.End();
            }
        }
        else if (code == "02")
        {
            PayType paytype = PayTypeFac.getPayType(type, num);//生成一个支付类型
            payaccount = entity.payAccount;
            amount     = paytype.amount * 100;
        }
    }
Exemple #3
0
        private void Button_MoveToLeft_Click(object sender, RoutedEventArgs e)
        {
            PayType          item   = new PayType();
            OrderCheckItemVM itemVM = (OrderCheckItemVM)ListBox_SelectedPayTypeList.SelectedItem;

            if (itemVM != null)
            {
                item.SysNo       = Convert.ToInt32(itemVM.ReferenceContent);
                item.PayTypeName = itemVM.Description;
                if (leftList == null)
                {
                    leftList = new List <PayType>();
                }
                leftList.Add(item);
                rightList.Remove(itemVM);
                ListBox_PayTypeList.ItemsSource         = null;
                ListBox_PayTypeList.ItemsSource         = leftList;
                ListBox_SelectedPayTypeList.ItemsSource = null;
                ListBox_SelectedPayTypeList.ItemsSource = rightList;
            }
            else
            {
                Window.Alert(ResOrderCheck.Msg_SelectMoveItem);
            }
        }
Exemple #4
0
    private bool ShowAlipayWechatChooser(ProductVo productVo, PayType payType)
    {
        if (payType == PayType.None && Channel.CheckShowPayChooser())
        {
            IconSelectWindow win = PopupManager.ShowWindow <IconSelectWindow>(Constants.IconSelectWindowPath);
            win.SetData("", IconType.Alipay, IconType.WeChatFriend);
            win.clickCallback = (m) =>
            {
                if (m == IconType.Alipay)
                {
                    this.payType = PayType.AliPay;
                }
                else if (m == IconType.WeChatFriend)
                {
                    this.payType = PayType.WechatPay;
                }

                CreateOrder(productVo);
                win.Close();
            };
            return(true);
        }

        return(false);
    }
Exemple #5
0
        // start upgrade
        public bool Upgrade()
        {
            if (InUpgrade)
            {
                return(false);
            }
            if (bt.LevelMax <= Level)
            {
                return(false);
            }
            if (defNext == null)
            {
                return(false);
            }

            // check whether user has enough resources or not
            // decrease user's resource
            PayType payTypeReturn = PayforBuild(defNext);

            if (payTypeReturn != PayType.None)
            {
                if (payTypeReturn == PayType.Gold)
                {
                    UIDialogMessage.Show("Insufficient Gold", "Ok", "Error");
                }
                else if (payTypeReturn == PayType.Elixir)
                {
                    UIDialogMessage.Show("Insufficient Elixir", "Ok", "Error");
                }
                else if (payTypeReturn == PayType.Gem)
                {
                    UIDialogMessage.Show("Insufficient Gem", "Ok", "Error");
                }
                else
                {
                }

                return(false);
            }

            // prepare upgrade
            UpgradeCompleted = false;
            InUpgrade        = true;

            // if upgrade time is zero(like wall) then upgrade immediately
            if (UpgradeTimeTotal > 0)
            {
                UpgradeTimeLeft            = UpgradeTimeTotal;
                uiInfo.TimeLeft.text       = BENumber.SecToString(Mathf.CeilToInt(UpgradeTimeLeft));
                uiInfo.Progress.fillAmount = (UpgradeTimeTotal - UpgradeTimeLeft) / UpgradeTimeTotal;
                BETween.alpha(uiInfo.groupProgress.gameObject, 0.3f, 0.0f, 1.0f);
                uiInfo.groupProgress.gameObject.SetActive(true);
            }
            else
            {
                UpgradeEnd();
            }

            return(true);
        }
        public override int GetHashCode()
        {
            int hashCode = 2078452856;

            if (JobTitle != null)
            {
                hashCode += JobTitle.GetHashCode();
            }

            if (PayType != null)
            {
                hashCode += PayType.GetHashCode();
            }

            if (HourlyRate != null)
            {
                hashCode += HourlyRate.GetHashCode();
            }

            if (AnnualRate != null)
            {
                hashCode += AnnualRate.GetHashCode();
            }

            if (WeeklyHours != null)
            {
                hashCode += WeeklyHours.GetHashCode();
            }

            return(hashCode);
        }
Exemple #7
0
    public static string GetPaySdk(PayType payType)
    {
        switch (payType)
        {
        case PayType.NoDefined:
            break;

        case PayType.None:
            return(AppConfig.Instance.payChannel);

        case PayType.AliPay:
            return("ALIPAY");

        case PayType.WechatPay:
            return("WX");

        case PayType.MyCard:
            break;

        case PayType.GooglePlay:
            break;

        case PayType.ApplePay:
            break;
        }

        return(AppConfig.Instance.payChannel);
    }
Exemple #8
0
        public virtual PayType Create(PayType entity)
        {
            if (ObjectFactory <IPayTypeDA> .Instance.IsExistPayTypeID(entity.PayTypeID))
            {
                throw new BizException(string.Format("支付方式编码为{0}的数据已存在!", entity.PayTypeID));
            }

            if (ObjectFactory <IPayTypeDA> .Instance.IsExistPayTypeName(entity.PayTypeName))
            {
                throw new BizException(string.Format("支付方式名称为{0}的数据已存在!", entity.PayTypeName));
            }

            PayType tmpObj;

            using (TransactionScope scope = new TransactionScope())
            {
                tmpObj = ObjectFactory <IPayTypeDA> .Instance.Create(entity);

                string log = string.Format(@"用户""{0}""增加了系统编号为{1}的支付方式。", ServiceContext.Current.UserSysNo, entity.SysNo);
                ObjectFactory <LogProcessor> .Instance.CreateOperationLog(log, BizLogType.Basic_PayType_Add, (int)BizLogType.Basic_PayType_Add, "8601", ServiceContext.Current.ClientIP);

                scope.Complete();
            }
            return(tmpObj);
        }
Exemple #9
0
        public void ShowGoodsInfo(uint ItemID, tagFishRechargeInfo payInfo, PayType type)
        {
            m_Paytype         = type;
            m_ItemID          = ItemID;
            m_ItemIcon.sprite = ResManager.Instance.LoadSprite("BuYu/Texture/GoodsIcon/" + payInfo.Icon);
            m_ItemName.text   = payInfo.Name;
            if (type == PayType.ITEM)
            {
            }
            else if (type == PayType.Gold)
            {
            }

            m_DesItemSum.text     = payInfo.AddMoney.ToString();
            m_DisCountIcon.sprite = ResManager.Instance.LoadSprite("Lobby/Achieve/" + payInfo.sDisCountPicName);

            //不打折扣
            if (payInfo.dDisCountPrice == payInfo.dPreDisCountPrice)
            {
                m_ItemOldPrice.text = payInfo.dDisCountPrice.ToString();
                m_ItemCurPrice.text = payInfo.dDisCountPrice.ToString();
                m_ItemCurPrice.gameObject.SetActive(false);
                m_OverLine.gameObject.SetActive(false);
            }
            else
            {
                m_ItemOldPrice.text = payInfo.dPreDisCountPrice.ToString();
                m_ItemCurPrice.text = payInfo.dDisCountPrice.ToString();
                m_OverLine.gameObject.SetActive(true);
            }
        }
Exemple #10
0
        /// <summary>
        /// Faz uma recorrência.
        /// </summary>
        public ResponseBase Recurring(String merchantId, String merchantKey, String referenceNum, decimal chargeTotal
                                      , String creditCardNumber, String expMonth, String expYear, String cvvInd, String cvvNumber, String processorId
                                      , String numberOfInstallments, String chargeInterest, String ipAddress, String action
                                      , String startDate, String frequency, String period, String installments, String failureThreshold
                                      , String currencyCode)
        {
            FillRecurringBase(merchantId, merchantKey, referenceNum, chargeTotal, processorId, numberOfInstallments
                              , chargeInterest, ipAddress, action, startDate, frequency, period, installments
                              , failureThreshold, currencyCode);
            //ATENCAO: installments é o campo a ser usado (numberOfInstallments é referente ao Parcelamento)

            TransactionDetail detail = this.request.Order.RecurringPayment.TransactionDetail;

            PayType payType = detail.PayType;

            CreditCard creditCard = new CreditCard();

            payType.CreditCard = creditCard;

            creditCard.CvvInd    = cvvInd;
            creditCard.CvvNumber = cvvNumber;
            creditCard.ExpMonth  = expMonth;
            creditCard.ExpYear   = expYear;
            creditCard.Number    = creditCardNumber;

            return(new Utils().SendRequest <TransactionRequest>(this.request, this.Environment));
        }
 public void ShowGoodsInfo(uint ItemID, tagFishRechargeInfo payInfo, PayType type)
 {
     m_Paytype             = type;
     m_ItemID              = ItemID;
     m_ProductID           = payInfo.ProductID;
     m_ItemIcon.spriteName = payInfo.Icon;
     m_ItemName.text       = payInfo.Name;
     if (type == PayType.Gold)
     {
         m_DesItemIcon.spriteName = "HallBtn_Gold";
         //m_ItemPriceIcon.spriteName = "rmb_logo";
     }
     else
     {
         m_DesItemIcon.spriteName = "HallBtn_Diamond";
         //m_ItemPriceIcon.spriteName = "rmb_logo";
     }
     m_DesItemSum.text         = Utility.NumToThousand(payInfo.AddMoney);
     m_DisCountIcon.spriteName = payInfo.sDisCountPicName;
     //不打折扣
     if (payInfo.dDisCountPrice == payInfo.dPreDisCountPrice)
     {
         //m_ItemOldPrice.text = payInfo.dDisCountPrice.ToString();
         m_ItemCurPrice.text = Utility.NumToString(payInfo.dDisCountPrice);
         //m_ItemCurPrice.gameObject.SetActive(false);
         //m_OverLine.SetActive(false);
     }
     else
     {
         //m_ItemOldPrice.text = payInfo.dPreDisCountPrice.ToString();
         m_ItemCurPrice.text = payInfo.dDisCountPrice.ToString();
         //m_OverLine.SetActive(true);
     }
 }
Exemple #12
0
        public WeinXinPay(PayType type, string title, int total_fee, bool isdebug, string appid, string mch_id, string key, string openid)
        {
            Random rd = new Random();

            nonce_str       = rd.Next(999999).ToString();
            nonceStr        = nonce_str;
            this.trade_type = type.ToString();

            this.openid = openid;
            this.appid  = appid;
            this.mch_id = mch_id;
            this.key    = key;

            this.isdebug = isdebug;

            if (this.isdebug)
            {
                notify_url     = "http://tf.cqeasy.com/wxpay/PayFromGZ";//通知地址
                this.total_fee = 1;
            }
            else
            {
                notify_url     = "http://tf.cqeasy.com/wxpay/PayFromGZ";//通知地址
                this.total_fee = total_fee;
            }

            this.body = title;
        }
Exemple #13
0
        public void InNetworkPreSettle(InPayParameter para)
        {
            InPayPara = para;


            //在 住院预结算 和 住院结算的时候 在函数最开始   加入一下判断
            if (InPayPara.SettleInfo != null && InPayPara.SettleInfo.MedAmountTotal != 0)
            {
                PayType _payType = new PayType();
                _payType.PayTypeId    = 4;
                _payType.PayTypeName  = "医保";
                _payType.PayAmount    = InPayPara.SettleInfo.MedAmountTotal;
                InPayPara.PayTypeList = new List <PayType>();
                InPayPara.PayTypeList.Add(_payType);
                return;
            }



            if (InPayPara.RegInfo.MemberNo == null)
            {
                throw new Exception("没有找到联网登记信息,请确认是否联网登记!");
            }

            InterfaceInit();
            InReimUpItems();
            dicSettleInfo = handelModel.SettleZY();

            SaveInSettleMain();


            isInit = false;
        }
Exemple #14
0
        // get total resource capacity with given resource type
        public int GetCapacityTotal(PayType type)
        {
            int iReturn = 0;

            for (int i = 0; i < 10; ++i)
            {
                for (int j = 0; j < Buildings[i].Count; ++j)
                {
                    // exclude in creation building
                    if (Buildings[i][j].Level == 0)
                    {
                        continue;
                    }

                    // exclude production building such as gold mine, because gols mine has it's own capacity
                    if (Buildings[i][j].def.eProductionType == type)
                    {
                        continue;
                    }

                    iReturn += Buildings[i][j].def.Capacity[(int)type];
                }
            }

            return(iReturn);
        }
Exemple #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string code    = Request["code"]; //支付接口编号
        string type    = Request["type"]; //支付类型, OD为订单
        string num     = Request["num"];  //相应的单号
        string md5sign = Request["key"];  //MD5 Sign
        string payno   = num;

        //检查数据传递完整
        if (!PayHepler.dataCheck(num + type + code, md5sign))
        {
            Response.Redirect("~/default.aspx");
            Response.End();
        }
        PayEntity entity  = new PayEntity(code);                     //生成一个接口类型
        PayType   paytype = PayTypeFac.getPayType(type, num, payno); //生成一个支付类型


        string status = Request["payment_status"];

        if (status == "Completed" || status == "Pending")
        {
            paytype.success();
            Common.WriteToFile.WriteToTxt("PayPal支付异常----支付单号:" + Request["txn_id"] + "----" + Request["business"] + "----" + DateTime.Now.ToString(), "pay/PayPal/Log/");
            //Response.Redirect("../payend.aspx?code=" + code + "&type=" + type + "&key=" + md5sign + "&num=" + num + "&status=success");
        }
        else
        {
            paytype.failed();
            Common.WriteToFile.WriteToTxt("PayPal支付异常----支付单号:" + Request["txn_id"] + "----" + Request["business"] + "----" + DateTime.Now.ToString(), "pay/PayPal/Log/");
            //Response.Redirect("../payend.aspx?code=" + code + "&type=" + type + "&key=" + md5sign + "&num=" + num + "&status=failed");
        }
    }
Exemple #16
0
        public async Task <ApiResult <string> > ModifyPayMch(PayType parm)
        {
            var res = await PayTypeBll._.IsExist(d => d.Type_id != parm.Type_id && d.Type_alias == parm.Type_alias);

            if (res.statusCode == 200)
            {
                if (res.success)
                {
                    return(new ApiResult <string>()
                    {
                        statusCode = (int)ApiEnum.Error, message = string.Format("已经存在{0}的支付类型", parm.Type_alias)
                    });
                }
            }
            else
            {
                return(new ApiResult <string>()
                {
                    statusCode = (int)ApiEnum.Error, message = "唯一性检测出错"
                });
            }
            Dictionary <Field, object> model = new Dictionary <Field, object>();

            model.Add(PayType._.Type_name, parm.Type_name.SqlFilters() ?? "");
            model.Add(PayType._.Type_alias, parm.Type_alias.SqlFilters() ?? "");
            model.Add(PayType._.Type_note, parm.Type_note.SqlFilters() ?? "");
            model.Add(PayType._.Update_time, DateTime.Now.ToTimeStamp());
            return(await PayTypeBll._.UpdateAsync(model, d => d.Type_id == parm.Type_id));
        }
Exemple #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string code    = Request.QueryString["code"]; //支付接口编号
        string type    = Request.QueryString["type"]; //支付类型, OD为订单
        string num     = Request.QueryString["num"];  //相应的单号
        string md5sign = Request.QueryString["key"];  //MD5 Sign
        string webSite = "http://" + Request.Url.Host;

        //检查数据传递完整
        if (!PayHepler.dataCheck(num + type + code, md5sign))
        {
            Response.Redirect("~/default.aspx");
            Response.End();
        }
        PayEntity entity  = new PayEntity(code);              //生成一个接口类型
        PayType   paytype = PayTypeFac.getPayType(type, num); //生成一个支付类型

        business      = entity.payAccount;
        item_name     = paytype.num;
        item_number   = paytype.num;
        a3            = paytype.amount.ToString("f2");
        notify_url    = webSite + "/" + entity.notifyURL + "?code=" + code + "&type=" + type + "&key=" + md5sign + "&num=" + num;
        returnUrl     = webSite + "/" + entity.returnURL + "?code=" + code + "&type=" + type + "&key=" + md5sign + "&num=" + num;
        cancel_return = webSite + "/pay/payend.aspx?code=" + code + "&type=" + type + "&key=" + md5sign + "&num=" + num + "&status=failed";
    }
Exemple #18
0
        public Order CreateOrder(int userid, OrderType orderType, decimal money, PayType payType, int fromuserId = 0,
                                 decimal?rawprice = 0, QuestionStrategy strategy = null, int questionId = 0)
        {
            var order = new Order()
            {
                UserId     = userid,
                OrderType  = orderType,
                Amount     = money,
                PayType    = payType,
                RawPrice   = rawprice != null ? rawprice.Value : money,
                FromUserId = fromuserId,
                QuestionId = questionId
            };

            if (orderType == OrderType.Reward)
            {
                order.FromUserId = fromuserId;
            }
            if (orderType == OrderType.QuestionStrategy)
            {
                if (strategy == null)
                {
                    return(null);
                }
                order.RelationId = strategy.Id;
                order.QuestionId = questionId;
            }
            InsertOrder(order);
            return(GetOrderByOrderNumber(order.OrderNumber));
        }
Exemple #19
0
        private void Button_MoveToRight_Click(object sender, RoutedEventArgs e)
        {
            OrderCheckItemVM itemVM = new OrderCheckItemVM();
            PayType          item   = (PayType)ListBox_PayTypeList.SelectedItem;

            if (item != null)
            {
                itemVM.ReferenceContent = item.SysNo.ToString();
                itemVM.Description      = item.PayTypeName;
                itemVM.ReferenceType    = "PT";
                itemVM.Status           = OrderCheckStatus.Valid;
                leftList.Remove(item);
                if (rightList == null)
                {
                    rightList = new List <OrderCheckItemVM>();
                }
                rightList.Add(itemVM);
                ListBox_PayTypeList.ItemsSource         = null;
                ListBox_PayTypeList.ItemsSource         = leftList;
                ListBox_SelectedPayTypeList.ItemsSource = null;
                ListBox_SelectedPayTypeList.ItemsSource = rightList;
            }
            else
            {
                Window.Alert(ResOrderCheck.Msg_SelectMoveItem);
            }
        }
Exemple #20
0
        public CommandButton(GameObject _go, Sprite _symbol, string _text, PayType _payType, int _buyPrice, UnityAction _call)
        {
            go         = _go;
            Background = go.GetComponent <Image>();
            Title      = go.transform.Find("Title").GetComponent <Text>();
            Icon       = go.transform.Find("Icon").GetComponent <Image>();
            Price      = go.transform.Find("Price").GetComponent <Text>();
            PriceIcon  = go.transform.Find("PriceIcon").GetComponent <Image>();
            Symbol     = _symbol;
            Title.text = _text;
            call       = _call;
            Disabled   = false;
            Locked     = false;

            payType  = _payType;
            BuyPrice = _buyPrice;

            Icon.overrideSprite = Symbol;

            Price.text = (BuyPrice == 0) ? "" : BuyPrice.ToString("#,##0");
            PriceIcon.overrideSprite = TBDatabase.GetPayTypeIcon(_payType);
            PriceIcon.gameObject.SetActive((BuyPrice == 0) ? false : true);
            //PriceIcon.gameObject.SetActive (false);

            State(false);
        }
            private int[]    price;         //переменная нужна для подсчета суммы заказа

            public void CollectionInf()
            {
                Console.WriteLine("Enter orders code:");
                codeOrder = int.Parse(Console.ReadLine());

                Console.WriteLine("Enter the name client:");
                nameClient = Console.ReadLine();

                do
                {
                    Console.WriteLine("Select payment type:");
                    select = int.Parse(Console.ReadLine());

                    switch (select)
                    {
                    case 0:
                        payType = PayType.Cash; break;

                    case 1:
                        payType = PayType.BankCard; break;

                    case 2:
                        payType = PayType.EripSystem; break;

                    default:
                        Console.WriteLine("There is no number this type payment! Try again  from 0 to 2");
                        break;
                    }
                } while (select < 0 || select > 2);
            }
Exemple #22
0
        private void ComputeGainGoldcoin()
        {
            PayType payType = GetPayType();

            int     payMoney = (int)this.numRechargeRMB.Value;
            decimal gainGoldCoin;

            if (payType == PayType.Diamand)
            {
                int spendRMB = (int)Math.Ceiling(payMoney / GlobalData.GameConfig.Diamonds_RMB);
                gainGoldCoin = spendRMB * GlobalData.GameConfig.RMB_GoldCoin;
            }
            else
            {
                gainGoldCoin = payMoney * GlobalData.GameConfig.RMB_GoldCoin;
            }

            if (payType == PayType.Diamand)
            {
                this.txtPayUnit.Text = "钻石";
            }
            else if (payType == PayType.Credits)
            {
                this.txtPayUnit.Text = "积分";
            }
            else
            {
                this.txtPayUnit.Text = "灵币";
            }
            if (this.txtGainGoldCoin != null)
            {
                this.txtGainGoldCoin.Text = gainGoldCoin.ToString();
            }
        }
Exemple #23
0
        public void LoadPayType(int?sysNo, EventHandler <RestClientEventArgs <CommissionTypeQueryVM> > callback)
        {
            string relativeUrl = "/CommonService/PayType/Load/" + sysNo;

            if (sysNo.HasValue)
            {
                restClient.Query <PayType>(relativeUrl, (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }
                    CommissionTypeQueryVM _viewModel = null;
                    PayType entity = args.Result;
                    if (entity == null)
                    {
                        _viewModel = new CommissionTypeQueryVM();
                    }
                    else
                    {
                        _viewModel = entity.Convert <PayType, CommissionTypeQueryVM>();
                    }
                    callback(obj, new RestClientEventArgs <CommissionTypeQueryVM>(_viewModel, restClient.Page));
                });
            }
        }
 public static DateTime DetermineMonthlyNextDate(DateTime date, PayType frequency)
 {
     while (date <= DateTime.Now)
     {
         date = date.AddMonths((int)frequency);
     }
     return(date);
 }
 public static DateTime DetermineWeeklyNextDate(DateTime date, PayType frequency)
 {
     while (date <= DateTime.Now)
     {
         date = date.AddDays((double)frequency);
     }
     return(date);
 }
 public void OnToggleZhiFuBaoClick(bool isSelect)
 {
     if (isSelect == true)
     {
         payType = PayType.ZhiFuBao;
         Debug.Log("Alipay");
     }
 }
Exemple #27
0
 public Pay_Order Reverse(Pay_Order order, PayType payType)
 {
     order.State    = OrderState.Reversed;
     order.Pay_Type = payType;
     order.DUpdate  = DateTime.Now;
     Session.Update(order);
     return(order);
 }
Exemple #28
0
        public string trade_type = "";//交易类型

        public PayForWeiXin(PayType type)
        {
            Random rd = new Random();

            nonce_str       = rd.Next(999999).ToString();
            nonceStr        = rd.Next(999999).ToString();
            this.trade_type = type.ToString();
        }
 public void OnToggleWeiXinClick(bool isSelect)
 {
     if (isSelect == true)
     {
         payType = PayType.WeiXin;
         Debug.Log("WeChat");
     }
 }
 public ChargeMapData[] DoChargeByMengzhu (long[] xiakeIds, int value, PayType payType, string comments)
 {
     lock (LockObject)
     {
         Init();
         return mClient.Service.DoChargeByMengzhu(xiakeIds,value,payType,comments);
     }
 }
Exemple #31
0
 public Request(string Code, Client Client, Request.PayType Payment, List <RequestItem> ItemList)
 {
     this.Code     = Code;
     this.Client   = Client.DeepCopy(Client);
     this.Day      = DateTime.Today;
     this.ItemList = ItemList.Select(item => (RequestItem)item.DeepCopy(item)).ToList();
     this.Payment  = Payment;
 }
 public ActionResult Edit(PayType paytype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(paytype).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(paytype);
 }
Exemple #33
0
 public Request(int orderid, int clientid, DateTime orderdate, RequestItem prods, float prodprice, int prodqty, PayType pmttype)
 {
     this.OrderID = orderid;
     this.ClientID = clientid;
     this.OrderDate = orderdate;
     this.Products = prods;
     this.ProductPrice = prodprice;
     this.ProductQty = prodqty;
     this.PmtType = pmttype;
 }
Exemple #34
0
        public CombinationChargeData SearchChargesByMengzhu(PayType[] payTypes, ChargeMode[] chargeModes, DateTime startTime, DateTime endTime , bool isTimeRangeRequired, long lastId)
        {
            var result = new CombinationChargeData();
            using (var db = DbContextFactory.CreateDbContext())
            {
                
               
                IQueryable<Charge> charges = db.Charges.Include(a => a.TargetXiake).Include(a=>a.Handler).OrderByDescending(a => a.Id);

                if (lastId != 0)
                {
                    charges = charges.Where(a => a.Id < lastId);
                }

                charges = charges.Where(a => payTypes.Contains(a.PayType));
                charges = charges.Where(a => chargeModes.Contains(a.ChargeMode));

                if (isTimeRangeRequired)
                {

                    charges = charges.Where(a => a.CreateTime >= startTime && a.CreateTime <= endTime);

                }
                if (lastId == 0)
                {
                    result.TotalCount = charges.Count();
                }

                charges = charges.Take(DomainDefinition.PAGE_SIZE);
                foreach (Charge dp in charges)
                {
                    var x = new  ChargeData()
                    {
                        ID = dp.Id,
                        ChargeTime = dp.CreateTime,
                        ChargeMode = dp.ChargeMode,
                        Comments = dp.Comments,
                        Handler = dp.Handler.XiakeName,
                        PayType = dp.PayType,
                        Value = dp.Value,


                    };
                    result.Items .Add(x);
                }
                if (result.Items .Count < DomainDefinition.PAGE_SIZE)
                {
                    result.IsLoadedAllData = true;
                }


            }
            return result;
        }
        public ActionResult Create(PayType paytype)
        {
            if (ModelState.IsValid)
            {
                db.PayTypes.Add(paytype);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(paytype);
        }
 public CombinationChargeData SearchChargesByMengzhu (PayType[] payTypes,
     ChargeMode[] chargeModes,
     DateTime startTime,
     DateTime endTime,
     bool isTimeRangeRequired,
     long lastId)
 {
     lock (LockObject)
     {
         Init();
         return  mClient.Service.SearchChargesByMengzhu(payTypes, chargeModes,startTime,endTime,isTimeRangeRequired,lastId);
     }
 }
    public void RechargeMoneyFunction(PayType type)
    {

        Debug.Log("RechargeMoneyFunction--------  充值类型------------" + (int)type);

        CurrentType =  (int)type;

		purcharsePanel = Instantiate(contentPanel) as GameObject;
		GameObject root = GameObject.Find("UI Root");
		purcharsePanel.gameObject.transform.parent = root.gameObject.transform;
		purcharsePanel.transform.localScale = new Vector3(1, 1, 1);

      	SDK.CallFunction_iOS_PayGods(CurrentType);
    }
Exemple #38
0
 public static OnlineUtils GetInstance(PayType type)
 {
     var name = type.ToString();
     OnlineUtils instance;
     if (!string.IsNullOrEmpty(name))
     {
         var ass = Assembly.Load("Shoy.OnlinePay");
         instance =
             (OnlineUtils)
             ass.CreateInstance("Shoy.OnlinePay." + name + ".Base");
     }
     else
         instance = null;
     return instance;
 }
Exemple #39
0
 internal static PartnerInfo GetPartnerInfos(PayType type)
 {
     const string key = "partnerInfo";
     var cache = HttpRuntime.Cache;
     if (cache[key] == null)
     {
         var path = HttpContext.Current.Server.MapPath("~/App_Data/xml/ShoyApp.config");
         cache.Insert(key, GetPartnerInfos(), new CacheDependency(path));
     }
     var rlist = cache[key] as List<PartnerInfo>;
     PartnerInfo item = null;
     if (rlist != null)
         item = rlist.FirstOrDefault(t => t.Type == type);
     return item;
 }
 public void FromBin(NetSocket.ByteArray bin)
 {
     byte v;
     bin.Get_(out v);
     type = (PayType)v;
     bin.Get_(out uValue);
 }
Exemple #41
0
 public Request(long requestID, Client requestClient, DateTime requestDateTime, PayType requestPayType)
 {
     this.requestID = requestID;
     this.requestClient = requestClient;
     this.requestDateTime = requestDateTime;
     this.requestPayType = requestPayType;
     requestRequestItems = new List<RequestItem>();
 }
Exemple #42
0
        private ChargeMapData DoCharge (long xiakeId, int value, PayType payType, string comments )
        {
            
            using(var db = DbContextFactory.CreateDbContext())
            {
                var mz = db.Xiakes.FirstOrDefault(a => a.XiakeName == Thread.CurrentPrincipal.Identity.Name); 
                var xk = db.Xiakes.Where(a => a.Id == xiakeId).Include(a=>a.Credits).FirstOrDefault();
                var credits = xk.Credits;
                var ci = new Charge()
                {
                    Handler = mz,
                    ChargeMode = ChargeMode.ByXiaoer, 
                    Comments = comments,
                    PayType = payType,
                    TargetXiake = xk,
                    Value = value
                };
                credits.FreeCredits += value;
                db.Charges.Add(ci);

                try
                {
                    db.SaveChanges();
                } catch(DbUpdateConcurrencyException)
                {
                    Thread.Sleep(100);
                    return DoCharge(xiakeId, value, payType, comments);
                } catch(Exception e)
                {
                    
                }

                mMasterServiceProxy.PushCreditsChangeMessage(xk.Id, xk.Credits.FreeCredits, xk.Credits.FreezeCredits);
                 
                return new ChargeMapData()
                {
                    XiakeId = xk.Id,
                    Credits = xk.Credits.FreeCredits
                };

                   
            }
            
        }
 private List<ConsumeVO> GetConsumeList(List<ComsumeItemViewModel> list,CustomerVO cust, ConsumeType conType,PayType paytype)
 {
     List<ConsumeVO> conList = new List<ConsumeVO>();
     DateTime date = DateTime.Now;
     list.ForEach(item =>
     {
         conList.Add(new ConsumeVO
         {
             ItemID = item.Itemid,
             ItemName = item.ItemName,
             ConsumeStore = Emp.StroeName,
             ConsumeCount = item.ItemConNum,
             OriginalPrice = item.ItemTotalPrice,
             CreatedDate = date,
             CreatorID = Emp.UserName,
             LastModifiedDate = date,
             LastModifierID = Emp.UserName,
             ConsumeDate = date,
             ConsumeType = (int)conType,
             ClubCardPackageID = "",
             PackageDetailID = 0,
             ClubCardNo = "",
             ClubCardID = 0,
             CustID = cust.CustomerID,
             CustName = cust.Name,
             OriginalStore = "",
             RemainCount = 0,
             Reserved1 = Emp.StoreId.ToString(),
             Reserved2=paytype.ToString()
         });
     });
     return conList;
 }
Exemple #44
0
 public ChargeMapData[] DoChargeByMengzhu( long[] xiakeIds, int value, PayType payType, string comments)
 {
     var result = new List<ChargeMapData>();
     using (var db = DbContextFactory.CreateDbContext())
     {
         var xiake = db.Xiakes.FirstOrDefault(a => a.XiakeName == Thread.CurrentPrincipal.Identity.Name);
         if (xiake.UserType == XiakeType.Biaoju || xiake.UserType== XiakeType.Zhanggui)
             throw new FaultException("非管理帐号不可以充值");
         foreach(var item in xiakeIds)
         {
             result.Add(DoCharge(item, value, payType, comments));
         } 
     }
     return result.ToArray();
 }
Exemple #45
0
 public Request(uint clientId_, uint orderId_, string orderProducts_, ref List<RequestItem> listRequestItem, ref  List<Article> listArticle)
 {
     clientId = clientId_;
     orderId = orderId_;
     orderProducts = "";
     orderSumma = 0;
     enumPayType = PayType.Cash;
     List<uint> productCount = new List<uint>();
     string[] stArray = orderProducts_.Split(' ');
     uint key = 0;
     double price = 0;
     for (int i = 0, count = stArray.Length; i < count; ++i)
     {
         try
         {
             key = uint.Parse(stArray[i]);
             // ищем количество
             foreach (RequestItem ri in listRequestItem)
             {
                 if (ri.productId == key)
                 {
                     productCount.Add(ri.productCount);
                 }
             }
             // ищем цену
             foreach (Article ar in listArticle)
             {
                 if (ar.productId == key)
                 {
                     price = ar.productPrice;
                     orderProducts += ar.productName + " ";
                     break;
                 }
             }
             foreach (int pCount in productCount)
             {
                 orderSumma += pCount * price;
             }
         }
         catch (Exception)
         {
             Console.WriteLine("Недопустимый ввод. ");
         }
     }
 }
       private static bool addLinesHelper(TimeClockContext db, Punch punch, Timecard tc, PayType pt, double weeklyWorked, double dailyWorked, DateTime splitStart, DateTime splitEnd, bool seventhDay)
        {
            // a simple base case, to stop spawing extra lines -- Not sure if this is needed
            if (splitStart.Subtract(splitEnd).TotalMinutes == 0)
                return true;

        // Determin the correct pay type for this line.
           while (weeklyWorked > pt.getWeeklyMax(seventhDay))
               pt = pt.NextPayType;

           while (dailyWorked > pt.getDailyMax(seventhDay))
               pt = pt.NextPayType;

        // Calculate dailyLeft and weeklyLeft
           double dailyLeft = (double) pt.getDailyMax(seventhDay) - dailyWorked;
           double weeklyLeft = (double) pt.getWeeklyMax(seventhDay) - dailyWorked;

           double splitLength = splitEnd.Subtract(splitStart).TotalMinutes;


        // Check if we reach over the weekly -- if
           if (weeklyWorked + splitLength > pt.getWeeklyMax(seventhDay))
           {
               addLinesHelper(db, punch, tc, pt, weeklyWorked, dailyWorked, splitStart, splitStart.AddMinutes(weeklyLeft), seventhDay);
               addLinesHelper(db, punch, tc, pt.NextPayType, weeklyWorked + weeklyLeft, dailyWorked + weeklyLeft, splitStart.AddMinutes(weeklyLeft), splitEnd, seventhDay);
           }
               // Check if we reached over the daily limit
           else if (dailyWorked + splitLength > pt.getDailyMax(seventhDay))
           {
               addLinesHelper(db, punch, tc, pt, weeklyWorked, dailyWorked, splitStart, splitStart.AddMinutes(dailyLeft), seventhDay);
               addLinesHelper(db, punch, tc, pt.NextPayType, weeklyWorked + dailyLeft, dailyWorked + dailyLeft, splitStart.AddMinutes(dailyLeft), splitEnd, seventhDay);
           }
               // we can safely add the line to the DB
           else 
           { 
               db.Lines.Add(new Line()
                    {
                        TimecardID = tc.TimecardID,
                        PunchID = punch.PunchID,
                        SplitStart = splitStart,
                        SplitEnd = splitEnd,
                        PayTypeID = pt.PayTypeID
                    });
               db.SaveChanges();
             
           }

           return true;
       }