Exemple #1
0
        public void GetOrderStatus()
        {
            var request = new GetOrderStatus()
            {
                Meta  = { MerchantId = 7454, Version = "2.0" },
                Order =
                {
                    OrderId = 1200003770
                }
            };

            var text   = request.ToString();
            var caller = new ServiceApiCaller("HTTPS://ps.gcsip.nl/wdl/wdl");

            // Act
            var responseText = caller.Send(text);

            // Assert
            AssertResponseOk(responseText);

            var response = new GetOrderStatus();

            response.FromModifiedXml(new ModifiedXmlDocument(responseText), string.Empty);

            Assert.NotNull(response.Response);
            Assert.AreEqual(1200003770, response.Response.Status.OrderId);
        }
Exemple #2
0
        public void ReadGetOrderStatusResponse_With_Errors()
        {
            // Arrange
            // Act
            var response = new GetOrderStatus();

            response.FromModifiedXml(new ModifiedXmlDocument(OrderStatusTextWithErrors), string.Empty);

            // Assert
            Assert.AreEqual("OK", response.Response.Result);
            Assert.AreEqual(100, response.Response.Status.StatusId);
            Assert.AreEqual(1, response.Response.Status.Errors.Count);
            Assert.AreEqual("B", response.Response.Status.Errors.First().Type);
            Assert.AreEqual(430396, response.Response.Status.Errors.First().Code);
            Assert.AreEqual("430396 Not authorised", response.Response.Status.Errors.First().Message);
        }
        public virtual IOrderStatus GetOrderStatus(PaymentMethod paymentMethod, long orderId)
        {
            var request = new GetOrderStatus()
            {
                Meta =
                {
                    MerchantId = paymentMethod.DynamicProperty <int>().MerchantId,
                    Version    = "2.0"
                },
                Order =
                {
                    OrderId = orderId
                }
            };

            var text         = request.ToString();
            var responseText = SendTextAndCheckResponseForErrors(GetServiceUrl(paymentMethod), text);

            var response = new GetOrderStatus();

            response.FromModifiedXml(new ModifiedXmlDocument(responseText), string.Empty);

            return(response.Response.Status);
        }