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"); } }
public async Task Test() { var lParams = new GetPaymentProductsParams { CountryCode = "NL", CurrencyCode = "EUR" }; using (Client client = GetClient()) { GetPaymentProductsResponse response = await client .WithNewMerchant(GetMerchantId()) .Products .GetPaymentProducts(lParams) .ConfigureAwait(false); Assert.That(response.PaymentProducts, Is.Not.Empty); } }
public void TestPaymentProducts() { var paymentProducts = new GetPaymentProductsResponse { PaymentProducts = new List <PaymentProduct> { new PaymentProduct { Id = 1 } } }; string json = DefaultMarshaller.Instance.Marshal(paymentProducts); Assert.AreEqual("{\"paymentProducts\":[{\"id\":1}]}", json); var unmarshalledPaymentProducts = DefaultMarshaller.Instance.Unmarshal <GetPaymentProductsResponse>(json); Assert.AreEqual(paymentProducts.PaymentProducts.Count, unmarshalledPaymentProducts.PaymentProducts.Count); Assert.AreEqual(paymentProducts.PaymentProducts[0].Id, unmarshalledPaymentProducts.PaymentProducts[0].Id); }