コード例 #1
0
 public void FromModifiedXml(ModifiedXmlDocument doc, string path)
 {
     foreach (var parameter in _parameters)
     {
         parameter.FromModifiedXml(doc, path + "/PARAMS");
     }
 }
コード例 #2
0
 public void FromModifiedXml(ModifiedXmlDocument doc, string path)
 {
     PaymentProductId = doc.GetNullableLongFromXml(path + "/GENERAL/PAYMENTPRODUCTID");
     CountryCode      = doc.TryGetStringFromXml(path + "/GENERAL/COUNTRYCODE");
     CurrencyCode     = doc.TryGetStringFromXml(path + "/GENERAL/CURRENCYCODE");
     LanguageCode     = doc.TryGetStringFromXml(path + "/GENERAL/LANGUAGECODE");
 }
コード例 #3
0
        public void FromModifiedXml(ModifiedXmlDocument doc, string path)
        {
            OrderId           = doc.GetNullableLongFromXml(path + "/ORDER/ORDERID");
            MerchantOrderId   = doc.GetNullableLongFromXml(path + "/ORDER/MERCHANTORDERID");
            Amount            = doc.GetNullableLongFromXml(path + "/ORDER/AMOUNT");
            CurrencyCode      = doc.TryGetStringFromXml(path + "/ORDER/CURRENCYCODE");
            LanguageCode      = doc.TryGetStringFromXml(path + "/ORDER/LANGUAGECODE");
            CountryCode       = doc.TryGetStringFromXml(path + "/ORDER/COUNTRYCODE");
            MerchantReference = doc.TryGetStringFromXml(path + "/ORDER/MERCHANTREFERENCE");

            BillingAddress = new Address()
            {
                FirstName   = doc.TryGetStringFromXml(path + "/ORDER/FIRSTNAME"),
                LastName    = doc.TryGetStringFromXml(path + "/ORDER/SURNAME"),
                PhoneNumber = doc.TryGetStringFromXml(path + "/ORDER/PHONENUMBER"),
                StreetLine1 = doc.TryGetStringFromXml(path + "/ORDER/STREET"),
                StreetLine2 = doc.TryGetStringFromXml(path + "/ORDER/ADDITIONALADDRESSINFO"),
                City        = doc.TryGetStringFromXml(path + "/ORDER/CITY"),
                Zip         = doc.TryGetStringFromXml(path + "/ORDER/ZIP"),
                State       = doc.TryGetStringFromXml(path + "/ORDER/STATE"),
                CompanyName = doc.TryGetStringFromXml(path + "/ORDER/COMPANYNAME")
            };

            ShippingAddress = new Address()
            {
                FirstName   = doc.TryGetStringFromXml(path + "/ORDER/SHIPPINGFIRSTNAME"),
                LastName    = doc.TryGetStringFromXml(path + "/ORDER/SHIPPINGSURNAME"),
                StreetLine1 = doc.TryGetStringFromXml(path + "/ORDER/SHIPPINGSTREET"),
                StreetLine2 = doc.TryGetStringFromXml(path + "/ORDER/SHIPPINGADDITIONALADDRESSINFO"),
                City        = doc.TryGetStringFromXml(path + "/ORDER/SHIPPINGCITY"),
                Zip         = doc.TryGetStringFromXml(path + "/ORDER/SHIPPINGZIP"),
                State       = doc.TryGetStringFromXml(path + "/ORDER/SHIPPINGSTATE"),
                CompanyName = doc.TryGetStringFromXml(path + "/ORDER/SHIPPINGCOMPANYNAME")
            };
        }
コード例 #4
0
        public void Read_Meta()
        {
            var doc  = new ModifiedXmlDocument("<META><MERCHANTID>123</MERCHANTID><IPADDRESS>123.123.123.123</IPADDRESS><VERSION>2.0</VERSION></META>");
            var meta = new Meta(doc, string.Empty);

            Assert.AreEqual(123, meta.MerchantId);
            Assert.AreEqual("123.123.123.123", meta.IpAddress);
            Assert.AreEqual("2.0", meta.Version);
        }
コード例 #5
0
        public void Read_Partial_Meta()
        {
            var doc  = new ModifiedXmlDocument("<META><MERCHANTID>123</MERCHANTID></META>");
            var meta = new Meta(doc, string.Empty);

            Assert.AreEqual(123, meta.MerchantId);
            Assert.IsNull(meta.IpAddress);
            Assert.IsNull(meta.Version);
        }
        public void FromModifiedXml(ModifiedXmlDocument doc, string path)
        {
            Result = doc.GetStringFromXml(path + "/RESULT");
            Meta   = new ResponseMeta();
            Meta.FromModifiedXml(doc, path);
            Status = new OrderStatus();

            Status.FromModifiedXml(doc, path + "/STATUS");
        }
        public override void FromModifiedXml(ModifiedXmlDocument doc, string path)
        {
            base.FromModifiedXml(doc, path);

            if (doc.Exists("XML/REQUEST/RESPONSE"))
            {
                Response = new InsertOrderWithPaymentResponse();
                Response.FromModifiedXml(doc, "XML/REQUEST/RESPONSE");
            }
        }
コード例 #8
0
        public override void FromModifiedXml(ModifiedXmlDocument doc, string path)
        {
            base.FromModifiedXml(doc, path);

            if (doc.Exists("XML/REQUEST/RESPONSE"))
            {
                Response = new GetPaymentProductsResponse();
                Response.FromModifiedXml(doc, "XML/REQUEST/RESPONSE");
            }
        }
コード例 #9
0
 public void FromModifiedXml(ModifiedXmlDocument doc, string path)
 {
     PaymentMethodName  = doc.GetStringFromXml(path + "/ROW/PAYMENTMETHODNAME");
     PaymentProductId   = doc.GetIntFromXml(path + "/ROW/PAYMENTPRODUCTID");
     PaymentProductName = doc.GetStringFromXml(path + "/ROW/PAYMENTPRODUCTNAME");
     MinimumAmount      = doc.GetNullableLongFromXml(path + "/ROW/MINAMOUNT");
     MaximumAmount      = doc.GetNullableLongFromXml(path + "/ROW/MAXAMOUNT");
     CurrencyCode       = doc.GetStringFromXml(path + "/ROW/CURRENCYCODE");
     OrderTypeIndicator = doc.GetIntFromXml(path + "/ROW/ORDERTYPEINDICATOR");
     PaymentProductLogo = doc.TryGetStringFromXml(path + "/ROW/PAYMENTPRODUCTLOGO");
 }
コード例 #10
0
        public void Read_Order()
        {
            var doc   = new ModifiedXmlDocument(OrderText);
            var order = new ApiOrder(doc, string.Empty);

            Assert.AreEqual(9998990005, order.OrderId);
            Assert.AreEqual(29990, order.Amount);
            Assert.AreEqual("EUR", order.CurrencyCode);
            Assert.AreEqual("NL", order.CountryCode);
            Assert.AreEqual("nl", order.LanguageCode);
            Assert.IsFalse(order.MerchantOrderId.HasValue);
        }
コード例 #11
0
        private void AssertResponseOk(string text)
        {
            Assert.AreNotEqual(string.Empty, text);

            var responseDocument = new ModifiedXmlDocument(text);
            var result           = responseDocument.GetStringFromXml("XML/REQUEST/RESPONSE/RESULT");

            if (result != "OK")
            {
                var message = responseDocument.GetStringFromXml("XML/REQUEST/RESPONSE/ERROR/MESSAGE");
                Assert.Fail(message);
            }
        }
コード例 #12
0
        public void FromModifiedXml(ModifiedXmlDocument doc, string path)
        {
            Result = doc.GetStringFromXml(path + "XML/REQUEST/RESPONSE/RESULT");
            Meta.FromModifiedXml(doc, path + "XML/REQUEST/RESPONSE");

            Errors.Clear();
            foreach (var node in doc.GetNodes(path + "XML/REQUEST/RESPONSE/ERROR"))
            {
                var row = new ErrorRow();
                row.FromModifiedXml(node, string.Empty);
                Errors.Add(row);
            }
        }
コード例 #13
0
 public void FromModifiedXml(ModifiedXmlDocument doc, string path)
 {
     ProfileToken      = doc.TryGetStringFromXml(path + "/PAYMENT/PROFILETOKEN");
     PaymentProductId  = doc.GetNullableIntFromXml(path + "/PAYMENT/PAYMENTPRODUCTID");
     Amount            = doc.GetNullableLongFromXml(path + "/PAYMENT/AMOUNT");
     CurrencyCode      = doc.TryGetStringFromXml(path + "/PAYMENT/CURRENCYCODE");
     LanguageCode      = doc.TryGetStringFromXml(path + "/PAYMENT/LANGUAGECODE");
     CountryCode       = doc.TryGetStringFromXml(path + "/PAYMENT/COUNTRYCODE");
     ReturnUrl         = doc.TryGetStringFromXml(path + "/PAYMENT/RETURNURL");
     DateCollect       = doc.GetNullableIntFromXml(path + "/PAYMENT/DATECOLLECT");
     OrderId           = doc.GetNullableLongFromXml(path + "/PAYMENT/ORDERID");
     EffortId          = doc.GetNullableIntFromXml(path + "/PAYMENT/EFFORTID");
     AttemptId         = doc.GetNullableIntFromXml(path + "/PAYMENT/ATTEMPTID");
     MerchantReference = doc.TryGetStringFromXml(path + "/PAYMENT/MERCHANTREFERENCE");
 }
コード例 #14
0
        public void ReadGetOrderStatusResponse()
        {
            // Arrange

            // Act
            var document = new ModifiedXmlDocument(GetOrderStatusResponseText);

            // Assert
            var action = document.GetStringFromXml("XML/REQUEST/ACTION");

            Assert.AreEqual("GET_ORDERSTATUS", action);

            var ipaddress = document.GetStringFromXml("XML/REQUEST/META/IPADDRESS");

            Assert.AreEqual("123.123.123.123", ipaddress);
        }
コード例 #15
0
        public void FromModifiedXml(ModifiedXmlDocument doc, string path)
        {
            Result = doc.GetStringFromXml(path + "/RESULT");
            Meta   = new ResponseMeta();
            Meta.FromModifiedXml(doc, path);
            PaymentProducts = new List <PaymentProductData>();

            var nodes = doc.GetNodes(path + "/ROW");

            foreach (var node in nodes)
            {
                var data = new PaymentProductData();
                data.FromModifiedXml(node, string.Empty);
                PaymentProducts.Add(data);
            }
        }
コード例 #16
0
 public void FromModifiedXml(ModifiedXmlDocument doc, string path)
 {
     StatusDate          = doc.GetLongFromXml(path + "/ROW/STATUSID");
     PaymentReference    = doc.GetStringFromXml(path + "/ROW/PAYMENTREFERENCE");
     AdditionalReference = doc.GetStringFromXml(path + "/ROW/ADDITIONALREFERENCE");
     OrderId             = doc.GetLongFromXml(path + "/ROW/ORDERID");
     ExternalReference   = doc.GetStringFromXml(path + "/ROW/EXTERNALREFERENCE");
     EffortId            = doc.GetIntFromXml(path + "/ROW/EFFORTID");
     Ref        = doc.GetStringFromXml(path + "/ROW/REF");
     FormAction = doc.GetStringFromXml(path + "/ROW/FORMACTION");
     FormMethod = doc.GetStringFromXml(path + "/ROW/FORMMETHOD");
     AttemptId  = doc.GetIntFromXml(path + "/ROW/ATTEMPTID");
     MerchantId = doc.GetIntFromXml(path + "/ROW/MERCHANTID");
     StatusId   = doc.GetIntFromXml(path + "/ROW/STATUSID");
     ReturnMac  = doc.GetStringFromXml(path + "/ROW/RETURNMAC");
     Mac        = doc.GetStringFromXml(path + "/ROW/MAC");
 }
コード例 #17
0
        public void FromModifiedXml(ModifiedXmlDocument doc, string path)
        {
            StatusDate      = doc.GetStringFromXml(path + "/STATUSDATE");
            PaymentMethodId = doc.GetIntFromXml(path + "/PAYMENTMETHODID");
            OrderId         = doc.GetLongFromXml(path + "/ORDERID");
            EffortId        = doc.GetIntFromXml(path + "/EFFORTID");
            AttemptId       = doc.GetIntFromXml(path + "/ATTEMPTID");
            MerchantId      = doc.GetIntFromXml(path + "/MERCHANTID");
            StatusId        = doc.GetIntFromXml(path + "/STATUSID");

            Errors.Clear();
            foreach (var node in doc.GetNodes(path + "/ERRORS/ERROR"))
            {
                var row = new StatusErrorRow();
                row.FromModifiedXml(node, string.Empty);
                Errors.Add(row);
            }
        }
コード例 #18
0
 public ApiAction(ModifiedXmlDocument doc, string path)
 {
     FromModifiedXml(doc, path);
 }
コード例 #19
0
 public Meta(ModifiedXmlDocument doc, string path)
 {
     FromModifiedXml(doc, path);
 }
コード例 #20
0
 public OrderStatus(ModifiedXmlDocument doc, string path) : this()
 {
     FromModifiedXml(doc, path);
 }
コード例 #21
0
 public void FromModifiedXml(ModifiedXmlDocument doc, string path)
 {
     MerchantId = doc.GetLongFromXml(path + "/META/MERCHANTID");
     IpAddress  = doc.TryGetStringFromXml(path + "/META/IPADDRESS");
     Version    = doc.TryGetStringFromXml(path + "/META/VERSION");
 }
コード例 #22
0
 public ApiOrder(ModifiedXmlDocument doc, string path)
 {
     FromModifiedXml(doc, path);
 }
コード例 #23
0
 public ApiPayment(ModifiedXmlDocument doc, string path)
 {
     FromModifiedXml(doc, path);
 }
コード例 #24
0
 public General(ModifiedXmlDocument doc, string path)
 {
     FromModifiedXml(doc, path);
 }
コード例 #25
0
 public virtual void FromModifiedXml(ModifiedXmlDocument doc, string path)
 {
     Action.FromModifiedXml(doc, "XML/REQUEST");
     Meta.FromModifiedXml(doc, "XML/REQUEST");
     Params.FromModifiedXml(doc, "XML/REQUEST");
 }
コード例 #26
0
 public void FromModifiedXml(ModifiedXmlDocument doc, string path)
 {
     Name = doc.GetStringFromXml(path + "/ACTION");
 }
コード例 #27
0
 public void FromModifiedXml(ModifiedXmlDocument doc, string path)
 {
     RequestId        = doc.GetLongFromXml(path + "/META/REQUESTID");
     ResponseDatetime = doc.GetLongFromXml(path + "/META/RESPONSEDATETIME");
 }
コード例 #28
0
 public void FromModifiedXml(ModifiedXmlDocument doc, string path)
 {
     Code    = doc.GetIntFromXml(path + "/ERROR/CODE");
     Message = doc.GetStringFromXml(path + "/ERROR/MESSAGE");
 }