コード例 #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);
        }
        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);
        }