Exemplo n.º 1
0
        public static List <PaymentReportInfoDecorator> GetPaymentReports(PaymentReportsRequest paymentReportsRequest)
        {
            if (paymentReportsRequest == null)
            {
                paymentReportsRequest = new PaymentReportsRequest();
            }
            var restClient = (PaymentReportsRestClient)GetRestClient("PaymentReportsRestClient");

            var paymentReports = restClient.GetPaymentReportsInfo(paymentReportsRequest);

            if (paymentReports == null)
            {
                return(null);
            }

            //return paymentReports.ConvertAll<PaymentReportDecorator>(delegate(TicketMan.Platform.Api.Shared.Protocol.ObjectModel.Payments.PaymentReportInfo x) { return PaymentReportDecorator(x); };

            var paymentReportDecorators = new List <PaymentReportInfoDecorator>();

            foreach (TicketMan.Platform.Api.Shared.Protocol.ObjectModel.Payments.PaymentReportInfo paymentReportinfo in paymentReports)
            {
                var paymentReportDecorator = new PaymentReportInfoDecorator(paymentReportinfo);
                paymentReportDecorators.Add(paymentReportDecorator);
            }
            return(paymentReportDecorators);
        }
Exemplo n.º 2
0
        public void GetPaymentReports()
        {
            var restClient = CreateRestClient();

            var paymentReportsRequest = new PaymentReportsRequest();

            paymentReportsRequest.PageNumber    = 0;                         //Первая страница
            paymentReportsRequest.PageSize      = 0;                         //Два платежа на страницу
            paymentReportsRequest.CreatedOnFrom = DateTime.Now.AddDays(-30); //Платежи за последние 30 дней

            //paymentReportsRequest.PaymentSystemCodes — содержит коды платежных систем, если пустой, то фильтрация по ним не производится.

            var paymentReports = restClient.GetPaymentReportsInfo(paymentReportsRequest);

            Assert.NotNull(paymentReports);

            foreach (var paymentReport in paymentReports)
            {
                Assert.Greater(paymentReport.PaymentAmount, 0);    //Сумма платежа

                Assert.Greater(paymentReport.RecivingAmount, 0);   //Сумма зачисленная на счет получателя

                Assert.Greater(paymentReport.CommissionAmount, 0); //Сумма реальной комиссии платежного агента

                Assert.NotNull(paymentReport.PaymentSystem);       //Код платежной системы

                Assert.NotNull(paymentReport.Payer.Name);          //Имя плаительщика

                Assert.NotNull(paymentReport.Beneficiar.Name);     //Название организаци-получателя
            }
        }
Exemplo n.º 3
0
        PaymentReportsRequest GetPaymentReportsRequest()
        {
            if (_paymentReportsRequest == null)
            {
                _paymentReportsRequest = new PaymentReportsRequest();
            }

            //_paymentReportsRequest.OrderUniqueNumber = null;

            if (txtOrderNumberFilter2.Text != "")
            {
                _paymentReportsRequest.CreatedOnFrom = null;
                _paymentReportsRequest.CreatedOnTo   = null;

                //  _paymentReportsRequest.OrderUniqueNumber = txtOrderNumberFilter2.Text;
                return(_paymentReportsRequest);
            }
            _paymentReportsRequest.CreatedOnFrom = dateRangeControl_PaymentReports.From;
            _paymentReportsRequest.CreatedOnTo   = dateRangeControl_PaymentReports.To;

            return(_paymentReportsRequest);
        }