Exemplo n.º 1
0
        public void SimpleEcheckVerification()
        {
            echeckVerification echeckVerificationObject = new echeckVerification();

            echeckVerificationObject.amount      = 123456;
            echeckVerificationObject.orderId     = "12345";
            echeckVerificationObject.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";

            echeckVerificationObject.echeck        = echeckTypeObj;
            echeckVerificationObject.billToAddress = contactObj;

            echeckVerificationResponse response = litle.EcheckVerification(echeckVerificationObject);

            StringAssert.AreEqualIgnoringCase("Approved", response.message);
        }
Exemplo n.º 2
0
        public void test37()
        {
            echeckVerification verification = new echeckVerification();

            verification.id          = "1";
            verification.orderId     = "37";
            verification.amount      = 3001;
            verification.orderSource = orderSourceType.telephone;
            contact billToAddress = new contact();

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

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

            echeckVerificationResponse response = litle.EcheckVerification(verification);

            Assert.AreEqual("301", response.response);
            Assert.AreEqual("Invalid Account Number", response.message);
        }
        public void SimpleEcheckVerification()
        {
            var echeckVerificationObject = new echeckVerification
            {
                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.EcheckVerification(echeckVerificationObject);

            StringAssert.AreEqualIgnoringCase("Approved", response.message);
        }
Exemplo n.º 4
0
        public void TestMerchantData()
        {
            echeckVerification echeckVerification = new echeckVerification();

            echeckVerification.orderId       = "1";
            echeckVerification.amount        = 2;
            echeckVerification.orderSource   = orderSourceType.ecommerce;
            echeckVerification.billToAddress = new contact();
            echeckVerification.billToAddress.addressLine1 = "900";
            echeckVerification.billToAddress.city         = "ABC";
            echeckVerification.billToAddress.state        = "MA";
            echeckVerification.merchantData                    = new merchantDataType();
            echeckVerification.merchantData.campaign           = "camp";
            echeckVerification.merchantData.affiliate          = "affil";
            echeckVerification.merchantData.merchantGroupingId = "mgi";

            var mock = new Mock <Communications>();

            mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<echeckVerification.*<orderId>1</orderId>.*<amount>2</amount.*<merchantData>.*<campaign>camp</campaign>.*<affiliate>affil</affiliate>.*<merchantGroupingId>mgi</merchantGroupingId>.*</merchantData>.*", RegexOptions.Singleline), It.IsAny <Dictionary <String, String> >()))
            .Returns("<litleOnlineResponse version='8.13' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><echeckVerificationResponse><litleTxnId>123</litleTxnId></echeckVerificationResponse></litleOnlineResponse>");

            Communications mockedCommunication = mock.Object;

            litle.setCommunication(mockedCommunication);
            litle.EcheckVerification(echeckVerification);
        }
Exemplo n.º 5
0
        public void testEcheckVerification()
        {
            echeckVerification echeckverification = new echeckVerification();

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

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

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


            var mock = new Mock <Communications>();

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

            Communications mockedCommunication = mock.Object;

            litle.setCommunication(mockedCommunication);
            echeckVerificationResponse echeckverificaitonresponse = litle.EcheckVerification(echeckverification);

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