public void SimpleSaleWithInvalidFraudCheck()
        {
            Sale saleObj = new Sale();
            saleObj.Amount = 106;
            saleObj.LitleTxnId = 123456;
            saleObj.OrderId = "12344";
            saleObj.OrderSource = OrderSourceType.Ecommerce;
            CardType cardObj = new CardType();
            cardObj.Type = MethodOfPaymentTypeEnum.VI;
            cardObj.Number = "4100000000000000";
            cardObj.ExpDate = "1210";
            saleObj.Card = cardObj;
            FraudCheckType cardholderAuthentication = new FraudCheckType();
            cardholderAuthentication.AuthenticationValue = "123456789012345678901234567890123456789012345678901234567890";
            saleObj.CardholderAuthentication = cardholderAuthentication;

            try
            {
                SaleResponse responseObj = litle.Sale(saleObj);
            }
            catch (LitleOnlineException e)
            {
                Assert.True(e.Message.StartsWith("Error validating xml data against the schema"));
            }
        }
        public void test5Sale()
        {
            Sale sale = new Sale();
            sale.OrderId = "5";
            sale.Amount = 50050;
            sale.OrderSource = OrderSourceType.Ecommerce;
            CardType card = new CardType();
            card.Type = MethodOfPaymentTypeEnum.VI;
            card.Number = "4457010200000007";
            card.ExpDate = "0512";
            card.CardValidationNum = "463";
            sale.Card = card;
            FraudCheckType authenticationvalue = new FraudCheckType();
            authenticationvalue.AuthenticationValue = "BwABBJQ1AgAAAAAgJDUCAAAAAAA=";
            sale.CardholderAuthentication = authenticationvalue;

            SaleResponse response = litle.Sale(sale);
            Assert.AreEqual("000", response.Response);
            Assert.AreEqual("Approved", response.Message);
            Assert.AreEqual("55555 ", response.AuthCode);
            Assert.AreEqual("32", response.FraudResult.AvsResult);
            Assert.AreEqual("N", response.FraudResult.CardValidationResult);

            Credit credit = new Credit();
            credit.LitleTxnId = response.LitleTxnId;
            CreditResponse creditResponse = litle.Credit(credit);
            Assert.AreEqual("000", creditResponse.Response);
            Assert.AreEqual("Approved", creditResponse.Message);

            VoidTxn newvoid = new VoidTxn();
            newvoid.LitleTxnId = creditResponse.LitleTxnId;
            LitleOnlineResponseTransactionResponseVoidResponse voidResponse = litle.DoVoid(newvoid);
            Assert.AreEqual("000", voidResponse.Response);
            Assert.AreEqual("Approved", voidResponse.Message);
        }
        public void test5AVS()
        {
            Authorization authorization = new Authorization();
            authorization.OrderId = "5";
            authorization.Amount = 0;
            authorization.OrderSource = OrderSourceType.Ecommerce;
            CardType card = new CardType();
            card.Type = MethodOfPaymentTypeEnum.VI;
            card.Number = "4457010200000007";
            card.ExpDate = "0512";
            card.CardValidationNum = "463";
            authorization.Card = card;
            FraudCheckType authenticationvalue = new FraudCheckType();
            authenticationvalue.AuthenticationValue = "BwABBJQ1AgAAAAAgJDUCAAAAAAA=";
            authorization.CardholderAuthentication = authenticationvalue;

            AuthorizationResponse response = litle.Authorize(authorization);
            Assert.AreEqual("000", response.Response);
            Assert.AreEqual("Approved", response.Message);
            Assert.AreEqual("55555 ", response.AuthCode);
            Assert.AreEqual("32", response.FraudResult.AvsResult);
            Assert.AreEqual("N", response.FraudResult.CardValidationResult);
        }
        public void test2Sale()
        {
            Sale sale = new Sale();
            sale.OrderId = "2";
            sale.Amount = 20020;
            sale.OrderSource = OrderSourceType.Ecommerce;
            Contact contact = new Contact();
            contact.Name = "Mike J. Hammer";
            contact.AddressLine1 = "2 Main St.";
            contact.AddressLine2 = "Apt. 222";
            contact.City = "Riverside";
            contact.State = "RI";
            contact.Zip = "02915";
            contact.Country = CountryTypeEnum.US;
            sale.BillToAddress = contact;
            CardType card = new CardType();
            card.Type = MethodOfPaymentTypeEnum.MC;
            card.Number = "5112010000000003";
            card.ExpDate = "0212";
            card.CardValidationNum = "261";
            sale.Card = card;
            FraudCheckType authenticationvalue = new FraudCheckType();
            authenticationvalue.AuthenticationValue = "BwABBJQ1AgAAAAAgJDUCAAAAAAA=";
            sale.CardholderAuthentication = authenticationvalue;

            SaleResponse response = litle.Sale(sale);
            Assert.AreEqual("000", response.Response);
            Assert.AreEqual("Approved", response.Message);
            Assert.AreEqual("22222", response.AuthCode);
            Assert.AreEqual("10", response.FraudResult.AvsResult);
            Assert.AreEqual("M", response.FraudResult.CardValidationResult);

            Credit credit = new Credit();
            credit.LitleTxnId = response.LitleTxnId;
            CreditResponse creditResponse = litle.Credit(credit);
            Assert.AreEqual("000", creditResponse.Response);
            Assert.AreEqual("Approved", creditResponse.Message);

            VoidTxn newvoid = new VoidTxn();
            newvoid.LitleTxnId = creditResponse.LitleTxnId;
            LitleOnlineResponseTransactionResponseVoidResponse voidResponse = litle.DoVoid(newvoid);
            Assert.AreEqual("000", voidResponse.Response);
            Assert.AreEqual("Approved", voidResponse.Message);
        }
        public void test2AVS()
        {
            Authorization authorization = new Authorization();
            authorization.OrderId = "2";
            authorization.Amount = 0;
            authorization.OrderSource = OrderSourceType.Ecommerce;
            Contact contact = new Contact();
            contact.Name = "Mike J. Hammer";
            contact.AddressLine1 = "2 Main St.";
            contact.AddressLine2 = "Apt. 222";
            contact.City = "Riverside";
            contact.State = "RI";
            contact.Zip = "02915";
            contact.Country = CountryTypeEnum.US;
            authorization.BillToAddress = contact;
            CardType card = new CardType();
            card.Type = MethodOfPaymentTypeEnum.MC;
            card.Number = "5112010000000003";
            card.ExpDate = "0212";
            card.CardValidationNum = "261";
            authorization.Card = card;
            FraudCheckType authenticationvalue = new FraudCheckType();
            authenticationvalue.AuthenticationValue = "BwABBJQ1AgAAAAAgJDUCAAAAAAA=";
            authorization.CardholderAuthentication = authenticationvalue;

            AuthorizationResponse response = litle.Authorize(authorization);
            Assert.AreEqual("000", response.Response);
            Assert.AreEqual("Approved", response.Message);
            Assert.AreEqual("22222", response.AuthCode);
            Assert.AreEqual("10", response.FraudResult.AvsResult);
            Assert.AreEqual("M", response.FraudResult.CardValidationResult);
        }
        public void test33()
        {
            Authorization auth = new Authorization();
            auth.OrderId = "33";
            auth.Amount = 20020;
            auth.OrderSource = OrderSourceType.Ecommerce;
            Contact billToAddress = new Contact();
            billToAddress.Name = "Mike J. Hammer";
            billToAddress.AddressLine1 = "2 Main St.";
            billToAddress.AddressLine2 = "Apt. 222";
            billToAddress.City = "Riverside";
            billToAddress.State = "RI";
            billToAddress.Zip = "02915";
            billToAddress.Country = CountryTypeEnum.US;
            auth.BillToAddress = billToAddress;
            CardType card = new CardType();
            card.Number = "5112010000000003";
            card.ExpDate = "0212";
            card.CardValidationNum = "261";
            card.Type = MethodOfPaymentTypeEnum.MC;
            auth.Card = card;
            FraudCheckType fraud = new FraudCheckType();
            fraud.AuthenticationValue = "BwABBJQ1AgAAAAAgJDUCAAAAAAA=";
            auth.CardholderAuthentication = fraud;

            AuthorizationResponse authorizeResponse = litle.Authorize(auth);
            Assert.AreEqual("000", authorizeResponse.Response);
            Assert.AreEqual("Approved", authorizeResponse.Message);
            Assert.AreEqual("22222", authorizeResponse.AuthCode);
            Assert.AreEqual("10", authorizeResponse.FraudResult.AvsResult);
            Assert.AreEqual("M", authorizeResponse.FraudResult.CardValidationResult);

            AuthReversal reversal = new AuthReversal();
            reversal.LitleTxnId = authorizeResponse.LitleTxnId;
            AuthReversalResponse reversalResponse = litle.AuthReversal(reversal);
            Assert.AreEqual("000", reversalResponse.Response);
            Assert.AreEqual("Approved", reversalResponse.Message);
        }