public void test41()
        {
            echeckSale sale = new echeckSale();

            sale.orderId     = "41";
            sale.amount      = 2008;
            sale.orderSource = orderSourceType.telephone;
            contact billToAddress = new contact();

            billToAddress.firstName     = "Mike";
            billToAddress.middleInitial = "J";
            billToAddress.lastName      = "Hammer";
            sale.billToAddress          = billToAddress;
            echeckType echeck = new echeckType();

            echeck.accNum     = "10@BC99999";
            echeck.accType    = echeckAccountTypeEnum.Checking;
            echeck.routingNum = "053100300";
            sale.echeck       = echeck;

            echeckSalesResponse response = litle.EcheckSale(sale);

            Assert.AreEqual("301", response.response);
            Assert.AreEqual("Invalid Account Number", response.message);
        }
        public void test61()
        {
            echeckSale sale = new echeckSale();

            sale.orderId     = "61";
            sale.amount      = 15000;
            sale.orderSource = orderSourceType.ecommerce;
            contact billToAddress = new contact();

            billToAddress.firstName = "Tom";
            billToAddress.lastName  = "Black";
            sale.billToAddress      = billToAddress;
            echeckType echeck = new echeckType();

            echeck.accType    = echeckAccountTypeEnum.Checking;;
            echeck.accNum     = "1099999003";
            echeck.routingNum = "114567895";
            sale.echeck       = echeck;

            echeckSalesResponse response = litle.EcheckSale(sale);

            Assert.AreEqual("801", response.tokenResponse.tokenResponseCode);
            Assert.AreEqual("Account number was successfully registered", response.tokenResponse.tokenMessage);
            Assert.AreEqual(methodOfPaymentTypeEnum.EC, response.tokenResponse.type);
            Assert.AreEqual("111922223333444003", response.tokenResponse.litleToken);
        }
        public void SimpleEcheckSaleWithEcheck()
        {
            var echeckSaleObj = new echeckSale
            {
                id          = "1",
                reportGroup = "Planets",
                amount      = 123456,
                orderId     = "12345",
                orderSource = orderSourceType.ecommerce,
                echeck      = new echeckType
                {
                    accType    = echeckAccountTypeEnum.Checking,
                    accNum     = "12345657890",
                    routingNum = "123456789",
                    checkNum   = "123455"
                },
                billToAddress = new contact
                {
                    name  = "Bob",
                    city  = "lowell",
                    state = "MA",
                    email = "litle.com"
                }
            };


            var response = _litle.EcheckSale(echeckSaleObj);

            StringAssert.AreEqualIgnoringCase("Approved", response.message);
        }
예제 #4
0
        public void SimpleEcheckSaleWithEcheck()
        {
            echeckSale echeckSaleObj = new echeckSale();

            echeckSaleObj.amount      = 123456;
            echeckSaleObj.orderId     = "12345";
            echeckSaleObj.orderSource = orderSourceType.ecommerce;

            echeckType echeckTypeObj = new echeckType();

            echeckTypeObj.accType    = echeckAccountTypeEnum.Checking;
            echeckTypeObj.accNum     = "12345657890";
            echeckTypeObj.routingNum = "123456789";
            echeckTypeObj.checkNum   = "123455";

            contact contactObj = new contact();

            contactObj.name  = "Bob";
            contactObj.city  = "lowell";
            contactObj.state = "MA";
            contactObj.email = "litle.com";

            echeckSaleObj.echeck        = echeckTypeObj;
            echeckSaleObj.billToAddress = contactObj;

            echeckSalesResponse response = litle.EcheckSale(echeckSaleObj);

            StringAssert.AreEqualIgnoringCase("Approved", response.message);
        }
예제 #5
0
        public void testEcheckSale()
        {
            echeckSale echecksale = new echeckSale();

            echecksale.orderId     = "12345";
            echecksale.amount      = 123456;
            echecksale.orderSource = orderSourceType.ecommerce;
            echeckType echeck = new echeckType();

            echeck.accType    = echeckAccountTypeEnum.Checking;
            echeck.accNum     = "12345657890";
            echeck.routingNum = "123456789";
            echeck.checkNum   = "123455";
            echecksale.echeck = echeck;
            contact contact = new contact();

            contact.name             = "Bob";
            contact.city             = "lowell";
            contact.state            = "MA";
            contact.email            = "litle.com";
            echecksale.billToAddress = contact;


            var mock = new Mock <Communications>();

            mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*?<litleOnlineRequest.*?<echeckSale.*?<echeck>.*?<accNum>12345657890</accNum>.*?</echeck>.*?</echeckSale>.*?", RegexOptions.Singleline), It.IsAny <Dictionary <String, String> >()))
            .Returns("<litleOnlineResponse version='8.10' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><echeckSalesResponse><litleTxnId>123</litleTxnId></echeckSalesResponse></litleOnlineResponse>");

            Communications mockedCommunication = mock.Object;

            litle.setCommunication(mockedCommunication);
            echeckSalesResponse echecksaleresponse = litle.EcheckSale(echecksale);

            Assert.AreEqual(123, echecksaleresponse.litleTxnId);
        }