Пример #1
0
        public void Settlement_Close_Batch_Request_Returns_Successfully()
        {
            var paymentsControllerTests = new PaymentsControllerTests();

            paymentsControllerTests.Credit_Card_Present_AuthorizationOnly_And_PriorAuthCapture_Requests_Returns_Successfully();
            paymentsControllerTests.Credit_Card_Not_Present_Charge_Authorization_And_Capture_Request_Returns_Successfully();
            paymentsControllerTests.Credit_Card_Not_Present_Include_Addres_Request_Returns_Successfully();

            // Arrange
            var request = new BatchCloseRequest()
            {
                DeveloperApplication = new DeveloperApplication()
                {
                    DeveloperId = 12345678,
                    Version     = "1.2"
                }
            };
            var apiContext = new APIContext();
            var controller = new BatchesController();

            // Act
            var response = controller.ProcessRequest <BatchCloseResponse>(apiContext, request);

            // Assert
            Assert.IsNotNull(response);
            Assert.IsTrue(response.Success);
        }
        public void Transaction_Reporting_And_Management_Search_Transaction_Request_Returns_Successfully()
        {

            var paymentsController = new PaymentsControllerTests();
            int transactionId = paymentsController.Credit_Card_Present_AuthorizationOnly_Request_Returns_Successfully();
            // Arramge
            var request = new TransactionSearchRequest
            {
                TransactionId = transactionId,
                StartDate = DateTime.UtcNow.AddDays(-1),
                EndDate = DateTime.UtcNow.AddDays(1),
                Amount = 11.00m,
                DeveloperApplication = new DeveloperApplication
                {
                    DeveloperId = 12345678,
                    Version = "1.2"
                }
            };

            var apiContext = new APIContext();
            var controller = new TransactionsController();

            // Act
            var response = controller.ProcessRequest<TransactionSearchResponse>(apiContext, request);

            // Assert
            Assert.IsNotNull(response);
            Assert.IsTrue(response.Success);
        }
        public void Settlement_Close_Batch_Request_Returns_Successfully()
        {
            var paymentsControllerTests = new PaymentsControllerTests();
            paymentsControllerTests.Credit_Card_Present_AuthorizationOnly_And_PriorAuthCapture_Requests_Returns_Successfully();
            paymentsControllerTests.Credit_Card_Not_Present_Charge_Authorization_And_Capture_Request_Returns_Successfully();
            paymentsControllerTests.Credit_Card_Not_Present_Include_Addres_Request_Returns_Successfully();

            // Arrange
            var request = new BatchCloseRequest()
            {
                DeveloperApplication = new DeveloperApplication()
                {
                    DeveloperId = 12345678, 
                    Version = "1.2"
                }
            };
            var apiContext = new APIContext();
            var controller = new BatchesController();

            // Act
            var response = controller.ProcessRequest<BatchCloseResponse>(apiContext, request);

            // Assert
            Assert.IsNotNull(response);
            Assert.IsTrue(response.Success);
        }
        public void Transaction_Reporting_And_Management_Search_Transaction_Request_Returns_Successfully()
        {
            var paymentsController = new PaymentsControllerTests();
            int transactionId      = paymentsController.Credit_Card_Present_AuthorizationOnly_Request_Returns_Successfully();
            // Arramge
            var request = new TransactionSearchRequest
            {
                TransactionId        = transactionId,
                StartDate            = DateTime.UtcNow.AddDays(-1),
                EndDate              = DateTime.UtcNow.AddDays(1),
                Amount               = 11.00m,
                DeveloperApplication = new DeveloperApplication
                {
                    DeveloperId = 12345678,
                    Version     = "1.2"
                }
            };

            var apiContext = new APIContext();
            var controller = new TransactionsController();

            // Act
            var response = controller.ProcessRequest <TransactionSearchResponse>(apiContext, request);

            // Assert
            Assert.IsNotNull(response);
            Assert.IsTrue(response.Success);
        }
        public void Transaction_Reporting_And_Management_Retrieve_Transaction_Request_Returns_Successfully()
        {
            var paymentsController = new PaymentsControllerTests();
            int transactionId = paymentsController.Credit_Card_Present_AuthorizationOnly_Request_Returns_Successfully();
            // Arrange
            var request = new TransactionRetrieveRequest
            {
                TransactionId = transactionId 
            };

            var apiContext = new APIContext();
            var controller = new TransactionsController();

            // Act
            var response = controller.ProcessRequest<TransactionRetrieveResponse>(apiContext, request);

            // Assert
            Assert.IsNotNull(response);
            Assert.IsTrue(response.Success);
        }
        public void Transaction_Reporting_And_Management_Retrieve_Transaction_Request_Returns_Successfully()
        {
            var paymentsController = new PaymentsControllerTests();
            int transactionId      = paymentsController.Credit_Card_Present_AuthorizationOnly_Request_Returns_Successfully();
            // Arrange
            var request = new TransactionRetrieveRequest
            {
                TransactionId = transactionId
            };

            var apiContext = new APIContext();
            var controller = new TransactionsController();

            // Act
            var response = controller.ProcessRequest <TransactionRetrieveResponse>(apiContext, request);

            // Assert
            Assert.IsNotNull(response);
            Assert.IsTrue(response.Success);
        }