public void TestSurchargeAmount()
        {
            var reversal = new authReversal();

            reversal.litleTxnId      = 3;
            reversal.amount          = 2;
            reversal.surchargeAmount = 1;
            reversal.payPalNotes     = "note";
            reversal.reportGroup     = "Planets";

            var mock = new Mock <Communications>(new Dictionary <string, StringBuilder>());

            mock.Setup(
                Communications =>
                Communications.HttpPost(
                    It.IsRegex(
                        ".*<amount>2</amount>\r\n<surchargeAmount>1</surchargeAmount>\r\n<payPalNotes>note</payPalNotes>.*",
                        RegexOptions.Singleline), It.IsAny <Dictionary <string, string> >()))
            .Returns(
                "<litleOnlineResponse version='8.14' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><authReversalResponse><litleTxnId>123</litleTxnId></authReversalResponse></litleOnlineResponse>");

            var mockedCommunication = mock.Object;

            litle.setCommunication(mockedCommunication);
            litle.AuthReversal(reversal);
        }
        public void SimpleAuthReversal()
        {
            authReversal reversal = new authReversal();

            reversal.litleTxnId  = 12345678000L;
            reversal.amount      = 106;
            reversal.payPalNotes = "Notes";

            authReversalResponse response = litle.AuthReversal(reversal);

            Assert.AreEqual("Approved", response.message);
        }
        public void SimpleAuthReversal()
        {
            var reversal = new authReversal
            {
                litleTxnId = 12345678000L,
                amount = 106,
                payPalNotes = "Notes"
            };

            var response = _litle.AuthReversal(reversal);
            Assert.AreEqual("Approved", response.message);
        }
        public void test32()
        {
            authorization auth = new authorization();

            auth.id          = "1";
            auth.orderId     = "32";
            auth.amount      = 10010;
            auth.orderSource = orderSourceType.ecommerce;
            contact billToAddress = new contact();

            billToAddress.name         = "John Smith";
            billToAddress.addressLine1 = "1 Main St.";
            billToAddress.city         = "Burlington";
            billToAddress.state        = "MA";
            billToAddress.zip          = "01803-3747";
            billToAddress.country      = countryTypeEnum.US;
            auth.billToAddress         = billToAddress;
            cardType card = new cardType();

            card.number            = "4457010000000009";
            card.expDate           = "0112";
            card.cardValidationNum = "349";
            card.type = methodOfPaymentTypeEnum.VI;
            auth.card = card;

            authorizationResponse authorizeResponse = litle.Authorize(auth);

            Assert.AreEqual("000", authorizeResponse.response);
            Assert.AreEqual("Approved", authorizeResponse.message);
            Assert.AreEqual("11111 ", authorizeResponse.authCode);
            Assert.AreEqual("01", authorizeResponse.fraudResult.avsResult);
            Assert.AreEqual("M", authorizeResponse.fraudResult.cardValidationResult);

            capture capture = new capture();

            capture.id         = authorizeResponse.id;
            capture.litleTxnId = authorizeResponse.litleTxnId;
            capture.amount     = 5005;
            captureResponse captureResponse = litle.Capture(capture);

            Assert.AreEqual("000", captureResponse.response);
            Assert.AreEqual("Approved", captureResponse.message);

            authReversal reversal = new authReversal();

            reversal.id         = authorizeResponse.id;
            reversal.litleTxnId = 320000000000000000;
            authReversalResponse reversalResponse = litle.AuthReversal(reversal);

            Assert.AreEqual("000", reversalResponse.response);
            Assert.AreEqual("Approved", reversalResponse.message);
        }
        public void testAuthReversal()
        {
            var authreversal = new authReversal();

            authreversal.litleTxnId  = 12345678000;
            authreversal.amount      = 106;
            authreversal.payPalNotes = "Notes";


            var mock = new Mock <Communications>(_memoryStreams);

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

            var mockedCommunication = mock.Object;

            litle.setCommunication(mockedCommunication);
            var authreversalresponse = litle.AuthReversal(authreversal);

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