Beispiel #1
0
        public override void CheckAccount(ref Context context)
        {
            var request = new TestDepositionRequest()
            {
                AgentId           = agentId,
                ClientOrderId     = ((Guid)context["PaymentContext.Payment.Id"]).ToString(),
                RequestDT         = (DateTime)context["PaymentContext.Payment.ServerTime"],
                DstAccount        = (string)context["PaymentContext.Payment.Account"],
                Amount            = (1).ToString(".00", CultureInfo.InvariantCulture),
                Currency          = currency,
                Contract          = "Зачисление на кошелек",
                DepositionPointId = (context["PaymentContext.Point.Serial"]).ToString()
            };

            var response = client.TestDepositionRequest(request);

            if (response.Status == 0)
            {
                context.Status = State.AccountExists;
            }
            if (response.Status == 1)
            {
                context.Status = State.DenialOfService;
            }
            if (response.Status == 3)
            {
                context.Status = State.AccountNotExists;
            }

            logger.WriteMessage($"request {request.DstAccount} {request.Amount}", 1);

            logger.WriteMessage($"check status {response.Status}: {OperationStatuses.Instance[response.Status]}", 1);
            logger.WriteMessage($"check error {response.Error}: {ErrorCodes.Instance[response.Error]}", 3);
        }
Beispiel #2
0
        public TestDepositionResponse TestDepositionRequest(TestDepositionRequest depositionRequest)
        {
            var testUri    = new Uri(@"/webservice/deposition/api/testDeposition", UriKind.Relative);
            var xmlRequest = xmlSerializer.Serialize(depositionRequest);
            var response   = Request <TestDepositionRequest>(xmlRequest, testUri);

            return(xmlSerializer.Deserialize <TestDepositionResponse>(response));
        }