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"); }
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); } }
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); }
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 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); } }
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"); }
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); } }
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); } }
public void FromModifiedXml(ModifiedXmlDocument doc, string path) { Name = doc.GetStringFromXml(path + "/ACTION"); }
public void FromModifiedXml(ModifiedXmlDocument doc, string path) { Code = doc.GetIntFromXml(path + "/ERROR/CODE"); Message = doc.GetStringFromXml(path + "/ERROR/MESSAGE"); }