Exemplo n.º 1
0
        public string OnlineDepositPayNotify(OnlineDepositPayNotifyRequest request)
        {
            var commandRequest = Mapper.DynamicMap <Core.Payment.Interface.Data.OnlineDepositPayNotifyRequest>(request);

            var commandResponse = _onlineDepositCommands.PayNotify(commandRequest);

            return(commandResponse);
        }
Exemplo n.º 2
0
        public void Can_paynotify_online_deposit()
        {
            var request = new OnlineDepositPayNotifyRequest
            {
                OrderIdOfMerchant = "XP-0-20151202154756",
                OrderIdOfRouter   = "ROID20151202154803",
                OrderIdOfGateway  = "GOID20151202154803",
                Language          = "zh-CN",
                PayMethod         = "XPAY",
                Signature         = "EB1DA0FA24C29F809885B5AC7A1233F4"
            };
            var response = _depositCommands.PayNotify(request);

            response.Should().Be("SUCCESS", "Response should be 'SUCCESS'");

            _processingOnlineDeposit.OrderIdOfGateway.Should().Be(request.OrderIdOfGateway, "OrderIdOfGateway");
            _processingOnlineDeposit.OrderIdOfRouter.Should().Be(request.OrderIdOfRouter, "OrderIdOfRouter");
            _processingOnlineDeposit.Status.Should().Be(OnlineDepositStatus.Approved, "Status");
            _processingOnlineDeposit.ApprovedBy.Should().Be("TestPlayer", "ApprovedBy");
            _processingOnlineDeposit.Approved.Should().HaveValue("Approved");

            _paymentTestHelper.AssertBalance(_testPlayer.Id, total: 5000, playable: 5000, main: 5000, free: 5000);
        }
Exemplo n.º 3
0
        private string NotifyOnlineDeposit(string transactionNumber)
        {
            var notifyRequest = new OnlineDepositPayNotifyRequest
            {
                OrderIdOfMerchant = transactionNumber,
                OrderIdOfRouter   = "ROID" + DateTime.Now.ToString("yyyyMMddHHmmss"),
                OrderIdOfGateway  = "GOID" + DateTime.Now.ToString("yyyyMMddHHmmss"),
                Language          = "zh-CN",
                PayMethod         = "XPAY"
            };
            var sign = notifyRequest.OrderIdOfMerchant + notifyRequest.OrderIdOfRouter + notifyRequest.OrderIdOfGateway + notifyRequest.Language + OnlineDepositKey;

            notifyRequest.Signature = EncryptHelper.GetMD5HashInHexadecimalFormat(sign);
            var notifyResponse = _onlineDepositCommands.PayNotify(notifyRequest);

            return(notifyResponse);
        }