public void TestGetPaymentMethodsResponseFailure()
        {
            var responseXml = new XmlDocument();

            responseXml.LoadXml(@"<?xml version='1.0' encoding='UTF-8'?>
                        <response>
                            <statuscode>107</statuscode>
                        </response>");
            GetPaymentMethodsResponse response = GetPaymentMethods.Response(responseXml);

            Assert.That(response.StatusCode, Is.EqualTo(107));
            Assert.That(response.Accepted, Is.False);
            Assert.That(response.ErrorMessage, Is.EqualTo("Transaction rejected by bank."));
            Assert.That(response.PaymentMethods.Count, Is.EqualTo(0));
        }
        public void TestGetPaymentMethodsResponse()
        {
            var responseXml = new XmlDocument();

            responseXml.LoadXml(@"<?xml version='1.0' encoding='UTF-8'?>
                        <response>
                            <statuscode>0</statuscode>
                            <paymentmethods>
                                <paymentmethod>BANKAXESS</paymentmethod>
                                <paymentmethod>DBNORDEASE</paymentmethod>
                            </paymentmethods>
                        </response>");
            GetPaymentMethodsResponse response = GetPaymentMethods.Response(responseXml);

            Assert.That(response.StatusCode, Is.EqualTo(0));
            Assert.That(response.Accepted, Is.True);
            Assert.That(response.ErrorMessage, Is.Empty);
            Assert.That(response.PaymentMethods.Count, Is.EqualTo(2));
            Assert.That(response.PaymentMethods[0], Is.EqualTo("BANKAXESS"));
            Assert.That(response.PaymentMethods[1], Is.EqualTo("DBNORDEASE"));
        }
 private static List <Com.Adyen.Checkout.Base.Model.Paymentmethods.PaymentMethod> ParsePaymentMethodResponse(GetPaymentMethodsResponse response)
 {
     return(response?.PaymentMethods?.Select(x => new Com.Adyen.Checkout.Base.Model.Paymentmethods.PaymentMethod
     {
         Name = x.Name,
         Type = x.Type,
         SupportsRecurring = x.SupportsRecurring
     }).ToList() ?? new List <Com.Adyen.Checkout.Base.Model.Paymentmethods.PaymentMethod>());
 }