Esempio n. 1
0
        public PayInfoParam GetPayInfoParamBeforeDeliveryInfoInsert(OrderItem orderItem, UserItem userItem, bool fromOrderConfirm)
        {
            DeliveryInfoItem deliveryInfoItem = DeliveryInfoDao.FindById(orderItem.DeliveryInfoId);

            PayInfoParam param = new PayInfoParam();

            param.OrderItem        = orderItem;
            param.DeliveryInfoItem = deliveryInfoItem;
            param.UserItem         = userItem;
            OrderService.SetPriceInPayInfoParam(orderItem.Id, param);
            param.PayInfoItem = GetPayInfoItem(param.OrderItem.PayInfoId);
            if (param.OrderItem.PayInfoId == 0)
            {
                if (orderItem.HighPrintId > 0)
                {
                    param.PayInfoItem.PayType        = "BANK"; // 우선 출력 상품의 경우 대인불가
                    param.PayInfoItem.ShippingCharge = 0;
                    param.PayInfoItem.ManPaidCharge  = 0;
                }
                else
                {
                    param.PayInfoItem.PayType        = "MAN";
                    param.PayInfoItem.ShippingCharge = TradeUtil.GetShippingCharge(param.GoodsPrice, deliveryInfoItem);
                    param.PayInfoItem.ManPaidCharge  = TradeUtil.ManPaidCharge(param.PayInfoItem.ProductCharge + param.PayInfoItem.ShippingCharge - param.PayInfoItem.PointPaid);
                }
                param.PayInfoItem.ProductCharge = param.TaxAddedPrice;
                param.PayInfoItem.CashPrice     = param.PayInfoItem.ComputedCashPrice();
            }
            param.BankInfoSelectList = GetBankInfoSelectList(param.PayInfoItem.BankType);
            param.FromOrderConfirm   = fromOrderConfirm;
            return(param);
        }
Esempio n. 2
0
        //private int InsertPayInfo(OrderItem orderItem, int payInfoId, PayInfoItem payInfoItem)
        //{
        //    payInfoId = PayInfoDao.Insert(payInfoItem);
        //    orderItem.PayInfoId = payInfoId;
        //    OrderDao.UpdatePayInfo(orderItem);
        //    if (payInfoItem.PointPaid > 0)
        //    {
        //        SubtractPoint(orderItem, payInfoItem);
        //    }
        //    return payInfoId;
        //}

        //private void SubtractPoint(OrderItem orderItem, PayInfoItem payInfoItem)
        //{
        //    string title = "[" + orderItem.Code + "]ポイント支払い";
        //    PointService.SubtractPoint(title, payInfoItem.PointPaid, orderItem.UserId);
        //}

        internal PayInfoItem GetPayInfoItem(OrderItem orderItem, int pointPaid, string payType, string bankType, string bankUserName, int shippingCharge)
        {
            PayInfoItem item = new PayInfoItem();

            item.ProductCharge  = OrderService.GetTaxAddedPrice(orderItem.Id);
            item.ShippingCharge = shippingCharge;
            item.PayType        = payType;
            if (item.PayType.Equals("MAN"))
            {
                item.ManPaidCharge = TradeUtil.ManPaidCharge(item.ProductCharge + item.ShippingCharge - pointPaid);
            }
            item.PointPaid         = pointPaid;
            item.TelegramCommision = TradeUtil.GetTelegramCommision(item.PayType, item.TotalChargeBanTelegramCommision);
            item.CashPrice         = item.TotalCharge - pointPaid;
            if (item.PayType.Equals("BANK"))
            {
                item.BankType = bankType;
                string modifiedBankUserName;
                if (item.BankType.Equals("1"))
                {
                    modifiedBankUserName = TradeUtil.HalfToFull(bankUserName);
                }
                else
                {
                    modifiedBankUserName = TradeUtil.FullToHalf(bankUserName);
                }
                item.BankUserName = modifiedBankUserName;
            }
            item.UserId = orderItem.UserId;
            return(item);
        }