Beispiel #1
0
        protected void lnkPOAccept_Click(object sender, EventArgs e)
        {
            var poNumber = lstPO.SelectedItem.Value;

            ShowTransaction(PayManager.PurchaseOrderAccept(poNumber));
            PopulatePOList();
        }
Beispiel #2
0
        protected void lnkPointsNewCharge_Click(object sender, EventArgs e)
        {
            var points = ParsePoints(PointsNewAmountField.Text);

            ShowTransaction(PayManager.RewardsPointsCharge(string.Empty, points));
            LoadPointsLists();
        }
Beispiel #3
0
        protected void lnkCheckReceive_Click(object sender, EventArgs e)
        {
            var amount      = ParseMoney(CheckAmountField.Text);
            var checkNumber = CheckNumberField.Text.Trim();

            ShowTransaction(PayManager.CheckReceive(amount, checkNumber));
        }
Beispiel #4
0
        protected void lnkCreditCardAddInfo_Click(object sender, EventArgs e)
        {
            var card = ucCreditCardInput.GetCardData();

            ShowTransaction(PayManager.CreditCardAddInfo(card, 0));
            LoadCreditCardLists();
        }
Beispiel #5
0
        private static bool GetPayment(int game, int server, string account, string userID)
        {
            try
            {
                GameUser userInfo = new PersonalCacheStruct <GameUser>().FindKey(userID);
                if (userInfo == null)
                {
                    return(false);
                }
                var         chatService = new TjxChatService();
                OrderInfo[] model       = PayManager.getPayment(game, server, account);
                foreach (OrderInfo order in model)
                {
                    userInfo.PayGold = MathUtils.Addition(userInfo.PayGold, order.GameCoins, int.MaxValue);
                    //userInfo.Update();
                    PayManager.Abnormal(order.OrderNO);

                    DialHelper.ReturnRatioGold(userID, order.GameCoins);  //大转盘抽奖奖励充值返还
                    chatService.SystemSendWhisper(userInfo, string.Format(LanguageManager.GetLang().PaySuccessMsg, order.GameCoins));

                    DoGiff(userID, order);
                    FestivalHelper.GetPayReward(userInfo, order.GameCoins, FestivalType.PayReward);
                }
                return(true);
            }
            catch (Exception ex)
            {
                BaseLog log = new BaseLog("PaymentLog");
                log.SaveLog(ex);
                return(false);
            }
        }
Beispiel #6
0
        protected void lnkCompanyAccountAccept_Click(object sender, EventArgs e)
        {
            var accountNumber = lstCompanyAccount.SelectedItem.Value;

            ShowTransaction(PayManager.CompanyAccountAccept(accountNumber));
            PopulateCompanyAccountList();
        }
Beispiel #7
0
        public void CertificateState()
        {
            //Setup
            var provider = new Provider()
            {
                PersonId = 1,
                Name     = "Carlos",
                LastName = "Mambrake",
            };

            var pay = new Pay()
            {
                Date         = DateTime.Now,
                Provider     = provider,
                ProviderId   = 1,
                Certificated = false,
            };

            var payManager = new PayManager(dataServiceMock.Object);
            var salesList  = payManager.GetPendingToLiquidateSales(provider);

            pay.SaleList = salesList;

            //Act
            payManager.CertificatePay(pay);

            //Asserts
            dataServiceMock.Verify(m => m.Update <Pay>(pay), Times.Exactly(1));
            dataServiceMock.Verify(m => m.Update <Sale>(It.IsAny <Sale>()), Times.Exactly(2));

            Assert.IsTrue(pay.Certificated);
            Assert.AreEqual(SaleState.Certificated, sales.ElementAt(0).SaleState);
            Assert.AreEqual(SaleState.Certificated, sales.ElementAt(1).SaleState);
        }
Beispiel #8
0
        /// <summary>
        /// 子类实现Action处理
        /// </summary>
        /// <returns></returns>
        public override bool TakeAction()
        {
            OrderInfo orderInfo = new OrderInfo();

            orderInfo.OrderNO         = _orderNo;
            orderInfo.MerchandiseName = _productID;
            orderInfo.Currency        = _currency;
            orderInfo.Amount          = _amount;
            orderInfo.PassportID      = _passportID;
            orderInfo.RetailID        = _retailID;
            orderInfo.PayStatus       = 1;
            orderInfo.GameID          = _gameID;
            orderInfo.ServerID        = _serverID;
            orderInfo.GameName        = _gameName;
            orderInfo.ServerName      = _serverName;
            orderInfo.GameCoins       = (_amount * 10).ToInt();
            orderInfo.SendState       = 1;
            orderInfo.PayType         = _payType;
            orderInfo.Signature       = "000000";
            orderInfo.DeviceID        = _deviceID;

            if (PayManager.AddOrder(orderInfo))
            {
                DoSuccess(orderInfo);
                _payStatus = orderInfo.PayStatus;
                TraceLog.ReleaseWriteFatal(string.Format("PayNormal Order:{0},pid:{1} successfully!", _orderNo, _passportID));
                return(true);
            }
            ErrorCode = Language.Instance.ErrorCode;
            ErrorInfo = Language.Instance.AppStorePayError;
            TraceLog.ReleaseWriteFatal(string.Format("PayNormal Order:{0},pid:{1} faild!", _orderNo, _passportID));
            return(false);
        }
Beispiel #9
0
        protected void lnkPOAdd_Click(object sender, EventArgs e)
        {
            var amount   = ParseMoney(PONewAmount.Text);
            var poNumber = PONewNumber.Text.Trim();

            ShowTransaction(PayManager.PurchaseOrderAddInfo(poNumber, amount));
            PopulatePOList();
        }
Beispiel #10
0
        protected void lnkGiftCardCharge_Click(object sender, EventArgs e)
        {
            var card   = GiftCardNew.Text.Trim();
            var amount = ParseMoney(AmountGiftCardNew.Text);

            ShowTransaction(PayManager.GiftCardDecreaseWithCard(card, amount));
            LoadGiftCardLists();
        }
Beispiel #11
0
        public override bool TakeAction()
        {
            decimal Amount = amount.ToDecimal();
            int     silver = (Amount * (decimal)6.5).ToInt();

            PayManager.AddOrderInfo(orderno, Amount, _passportId, _serviceID, _gameID, silver, _deviceId, _RetailID);
            return(true);
        }
Beispiel #12
0
        public override bool TakeAction()
        {
            SaveLog(string.Format("91SKD充值>>Order:{0},Pid:{1},servicename:{2}", OrderID, passportId, servicename));
            //PaymentService.Get91Payment(gameID, serviceID, passportId, servicename, OrderID);

            PayManager.get91PayInfo(gameID, serviceID, passportId, servicename, OrderID, _RetailID);
            return(true);
        }
Beispiel #13
0
        protected void lnkGiftCardVoidHold_Click(object sender, EventArgs e)
        {
            var transactionId = lstGiftCardHold.SelectedItem.Value;
            var amount        = ParseMoney(AmountGiftCardHold.Text);

            ShowTransaction(PayManager.GiftCardUnHold(transactionId, amount));
            LoadGiftCardLists();
        }
Beispiel #14
0
        protected void lnkPayPalVoidHold_Click(object sender, EventArgs e)
        {
            var transactionId = lstPayPalHold.SelectedItem.Value;
            var amount        = ParseMoney(PayPalHoldAmount.Text);

            ShowTransaction(PayManager.PayPalExpressVoid(transactionId, amount));
            LoadPayPalLists();
        }
Beispiel #15
0
        protected void lnkCompanyAccountAdd_Click(object sender, EventArgs e)
        {
            var amount        = ParseMoney(CompanyAccountNewAmount.Text);
            var accountNumber = CompanyAccountNewNumber.Text.Trim();

            ShowTransaction(PayManager.CompanyAccountAddInfo(accountNumber, amount));
            PopulateCompanyAccountList();
        }
Beispiel #16
0
        protected void lnkCreditCardCharge_Click(object sender, EventArgs e)
        {
            var cardId       = lstCreditCards.SelectedItem.Value;
            var amount       = ParseMoney(CreditCardChargeAmount.Text);
            var securityCode = CreditCardChargeSecurityCode.Text.Trim();

            ShowTransaction(PayManager.CreditCardCharge(cardId, amount, securityCode));
            LoadCreditCardLists();
        }
Beispiel #17
0
        protected void btnCashRefund_Click(object sender, EventArgs e)
        {
            var amount = ParseMoney(CashAmount.Text);

            if (!RefundAmountValidate(amount))
            {
                ucMessageBox.ShowWarning("Refund amount should be less then order charged amount.");
                return;
            }

            ShowTransaction(PayManager.CashRefund(amount, RmaId));
        }
Beispiel #18
0
 /// <summary>
 /// Start is called on the frame when a script is enabled just before
 /// any of the Update methods is called the first time.
 /// </summary>
 void Start()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         DontDestroyOnLoad(gameObject);
         instance = this;
     }
 }
Beispiel #19
0
        protected void btnCashRefund_Click(object sender, EventArgs e)
        {
            var amount = ParseMoney(CashAmount.Text);

            if (!RefundAmountValidate(amount))
            {
                ucMessageBox.ShowWarning(Localization.GetString("RefundAmountError"));
                return;
            }

            ShowTransaction(PayManager.CashRefund(amount, RmaId));
        }
Beispiel #20
0
        protected void lnkGiftCardRefund_Click(object sender, EventArgs e)
        {
            var transactionId = lstGiftCardCharges.SelectedItem.Value;
            var amount        = ParseMoney(AmountGiftCardRefund.Text);

            if (AmountGiftCardRefund.Text.Trim() == string.Empty)
            {
                var refTrans = PayManager.FindTransactionById(transactionId);
                amount = refTrans.Amount;
            }
            ShowTransaction(PayManager.GiftCardIncrease(transactionId, amount, RmaId));
            LoadGiftCardLists();
        }
Beispiel #21
0
        protected void lnkGiftCardCapturHold_Click(object sender, EventArgs e)
        {
            var transactionId = lstGiftCardHold.SelectedItem.Value;
            var amount        = ParseMoney(AmountGiftCardHold.Text);

            if (string.IsNullOrWhiteSpace(AmountGiftCardHold.Text))
            {
                var authTrans = PayManager.FindTransactionById(transactionId);
                amount = authTrans.Amount;
            }
            ShowTransaction(PayManager.GiftCardCapture(transactionId, amount));
            LoadGiftCardLists();
        }
Beispiel #22
0
        protected void lnkPointsCaptureAuth_Click(object sender, EventArgs e)
        {
            var transactionId = lstPointsHeld.SelectedItem.Value;
            var points        = ParsePoints(PointsHeldAmount.Text);

            if (string.IsNullOrWhiteSpace(PointsHeldAmount.Text))
            {
                var authTrans = PayManager.FindTransactionById(transactionId);
                points = HccApp.CustomerPointsManager.PointsNeededForPurchaseAmount(authTrans.Amount);
            }
            ShowTransaction(PayManager.RewardsPointsCapture(transactionId, points));
            LoadPointsLists();
        }
Beispiel #23
0
        protected void lnkCheckReturn_Click(object sender, EventArgs e)
        {
            var amount = ParseMoney(CheckAmountField.Text);

            if (!RefundAmountValidate(amount))
            {
                ucMessageBox.ShowWarning("Refund amount should be less then order charged amount.");
                return;
            }
            var checkNumber = CheckNumberField.Text.Trim();

            ShowTransaction(PayManager.CheckReturn(amount, checkNumber, RmaId));
        }
Beispiel #24
0
        protected void lnkPayPalCaptureHold_Click(object sender, EventArgs e)
        {
            var transactionId = lstPayPalHold.SelectedItem.Value;
            var amount        = ParseMoney(PayPalHoldAmount.Text);

            if (string.IsNullOrWhiteSpace(PayPalHoldAmount.Text))
            {
                var authTrans = PayManager.FindTransactionById(transactionId);
                amount = authTrans.Amount;
            }
            ShowTransaction(PayManager.PayPalExpressCapture(transactionId, amount));
            LoadPayPalLists();
        }
Beispiel #25
0
        protected void lnkCheckReturn_Click(object sender, EventArgs e)
        {
            var amount = ParseMoney(CheckAmountField.Text);

            if (!RefundAmountValidate(amount))
            {
                ucMessageBox.ShowWarning(Localization.GetString("RefundAmountError"));
                return;
            }
            var checkNumber = CheckNumberField.Text.Trim();

            ShowTransaction(PayManager.CheckReturn(amount, checkNumber, RmaId));
        }
Beispiel #26
0
        private void PopulateCompanyAccountList()
        {
            var acts = PayManager.CompanyAccountInfoListAllNonAccepted();

            lstCompanyAccount.Items.Clear();
            if (acts.Count < 1)
            {
                lstCompanyAccount.Items.Add(new ListItem("No Company Accounts Found.", string.Empty));
            }
            foreach (var t in acts)
            {
                lstCompanyAccount.Items.Add(new ListItem(t.CompanyAccountNumber + " - " + t.Amount.ToString("c"),
                                                         t.CompanyAccountNumber));
            }
        }
Beispiel #27
0
        protected void lnkCreditCardCaptureAuth_Click(object sender, EventArgs e)
        {
            var transactionId = lstCreditCardAuths.SelectedItem.Value;
            var amount        = ParseMoney(CreditCardAuthAmount.Text);

            if (string.IsNullOrWhiteSpace(CreditCardAuthAmount.Text))
            {
                var authTrans = PayManager.FindTransactionById(transactionId);
                amount = authTrans.Amount;
            }
            var securityCode = CreditCardAuthSecurityCode.Text.Trim();

            ShowTransaction(PayManager.CreditCardCapture(transactionId, amount, securityCode));
            LoadCreditCardLists();
        }
Beispiel #28
0
        private void PopulatePOList()
        {
            var pos = PayManager.PurchaseOrderInfoListAllNonAccepted();

            lstPO.Items.Clear();
            if (pos.Count < 1)
            {
                lstPO.Items.Add(new ListItem("No Purchase Orders Found.", string.Empty));
            }

            foreach (var t in pos)
            {
                lstPO.Items.Add(new ListItem(t.PurchaseOrderNumber + " - " + t.Amount.ToString("c"),
                                             t.PurchaseOrderNumber));
            }
        }
Beispiel #29
0
        private void LoadGiftCardLists()
        {
            // List Auths for Collection
            var giftCardAuth = PayManager.GiftCardHoldListAll();

            lstGiftCardHold.Items.Clear();
            if (giftCardAuth.Count < 1)
            {
                lstGiftCardHold.Items.Add(new ListItem("No Pending Holds.", string.Empty));
                lnkGiftCardCapturHold.Enabled = false;
                lnkGiftCardVoidHold.Enabled   = false;
            }
            else
            {
                foreach (var t in giftCardAuth)
                {
                    lstGiftCardHold.Items.Add(new ListItem(t.Amount.ToString("c"), t.IdAsString));
                }
                lnkGiftCardCapturHold.Enabled = true;
                lnkGiftCardVoidHold.Enabled   = true;
            }

            // List charges for refunds
            var charges = PayManager.GiftCardChargeListAllRefundable();

            lstGiftCardCharges.Items.Clear();
            if (charges.Count < 1)
            {
                lstGiftCardCharges.Items.Add(new ListItem("No Charges to Refund", string.Empty));
                lnkGiftCardRefund.Enabled = false;
            }
            else
            {
                foreach (var t in charges)
                {
                    lstGiftCardCharges.Items.Add(new ListItem(t.GiftCard.CardNumber + " - " + t.Amount.ToString("c"),
                                                              t.IdAsString));
                }
                lnkGiftCardRefund.Enabled = true;
            }

            var giftCardProcessor = HccApp.CurrentStore.Settings.PaymentCurrentGiftCardProcessor();

            lnkGiftCardHold.Visible = giftCardProcessor.CanAuthorize;

            CheckIsRefunded();
        }
Beispiel #30
0
        public void AddNewPay()
        {
            //Setup

            var provider = new Provider()
            {
                PersonId = 1,
                Name     = "Carlos",
                LastName = "Mambrake",
            };

            var pay = new Pay()
            {
                Date         = DateTime.Now,
                Provider     = provider,
                ProviderId   = 1,
                Certificated = false,
            };

            dataServiceMock.Setup(m => m.Insert <Pay>(pay))
            .Returns(new Pay()
            {
                PayId        = 1,
                Date         = pay.Date,
                Provider     = pay.Provider,
                ProviderId   = 1,
                Certificated = false,
                SaleList     = pay.SaleList,
            }).Verifiable();

            var payManager = new PayManager(dataServiceMock.Object);
            var salesList  = payManager.GetPendingToLiquidateSales(provider);

            pay.SaleList = salesList;

            //Act
            var payExpected = payManager.Add(pay);

            //Asserts
            dataServiceMock.Verify(m => m.Update <Sale>(It.IsAny <Sale>()), Times.Exactly(2));
            dataServiceMock.Verify();

            Assert.AreEqual(1, payExpected.PayId);
            Assert.AreEqual(SaleState.Liquidated, sales.ElementAt(0).SaleState);
            Assert.AreEqual(SaleState.Liquidated, sales.ElementAt(1).SaleState);
        }