Esempio n. 1
0
        public void DepositReversal()
        {
            var reversal = new depositReversal
            {
                id          = "1",
                reportGroup = "planets",
                cnpTxnId    = 123456000,
                card        = new giftCardCardType
                {
                    type    = methodOfPaymentTypeEnum.GC,
                    number  = "414100000000000000",
                    expDate = "1210",
                    pin     = "1234"
                },


                originalRefCode        = "123",
                originalAmount         = 123,
                originalTxnTime        = DateTime.Now,
                originalSystemTraceId  = 123,
                originalSequenceNumber = "123456"
            };

            var response = _cnp.DepositReversal(reversal);

            Assert.AreEqual("Approved", response.message);
        }
        public void DepositReversal()
        {
            depositReversal reversal = new depositReversal();

            reversal.id          = "1";
            reversal.reportGroup = "planets";
            reversal.litleTxnId  = 123456000;
            giftCardCardType card = new giftCardCardType();

            card.type                       = methodOfPaymentTypeEnum.GC;
            card.number                     = "414100000000000000";
            card.expDate                    = "1210";
            card.pin                        = "1234";
            reversal.card                   = card;
            reversal.originalRefCode        = "123";
            reversal.originalAmount         = 123;
            reversal.originalTxnTime        = new DateTime(2017, 01, 01);
            reversal.originalSystemTraceId  = 123;
            reversal.originalSequenceNumber = "123456";

            var mock = new Mock <Communications>();

            mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<litleTxnId>123456000</litleTxnId>\r\n<card>\r\n<type>GC</type>\r\n<number>414100000000000000</number>\r\n<expDate>1210</expDate>\r\n<pin>1234</pin>\r\n</card>\r\n<originalRefCode>123</originalRefCode>\r\n<originalAmount>123</originalAmount>\r\n<originalTxnTime>2017-01-01T00:00:00Z</originalTxnTime>\r\n<originalSystemTraceId>123</originalSystemTraceId>\r\n<originalSequenceNumber>123456</originalSequenceNumber>.*", 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>");

            Communications mockedCommunication = mock.Object;

            litle.setCommunication(mockedCommunication);
            litle.DepositReversal(reversal);
        }
Esempio n. 3
0
        public depositReversalResponse DepositReversal(depositReversal depositReversal)
        {
            litleOnlineRequest request = createLitleOnlineRequest();

            request.depositReversal = depositReversal;

            litleOnlineResponse     response = sendToLitle(request);
            depositReversalResponse depositReversalResponse = response.depositReversalResponse;

            return(depositReversalResponse);
        }
Esempio n. 4
0
        public void testDepositReversal_Full()
        {
            depositReversal depositReversal = new depositReversal();

            depositReversal.id          = "theId";
            depositReversal.reportGroup = "theReportGroup";
            depositReversal.customerId  = "theCustomerId";
            depositReversal.litleTxnId  = "123";

            String actual   = depositReversal.Serialize();
            String expected = @"
<depositReversal id=""theId"" customerId=""theCustomerId"" reportGroup=""theReportGroup"">
<litleTxnId>123</litleTxnId>
</depositReversal>";

            Assert.AreEqual(expected, actual);
        }
        public void TestSimple()
        {
            depositReversal depositReversal = new depositReversal();

            depositReversal.id          = "a";
            depositReversal.reportGroup = "b";
            depositReversal.litleTxnId  = "123";

            var mock = new Mock <Communications>();

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

            Communications mockedCommunication = mock.Object;

            litle.setCommunication(mockedCommunication);
            depositReversalResponse response = litle.DepositReversal(depositReversal);

            Assert.AreEqual("123", response.litleTxnId);
        }
        public void TestSimple()
        {
            var depositReversal = new depositReversal();
            depositReversal.id = "a";
            depositReversal.reportGroup = "b";
            depositReversal.litleTxnId = "123";

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

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

            var mockedCommunication = mock.Object;
            litle.setCommunication(mockedCommunication);
            var response = litle.DepositReversal(depositReversal);
            Assert.AreEqual("123", response.litleTxnId);
        }
Esempio n. 7
0
 public depositReversalResponse DepositReversal(depositReversal transaction)
 {
     return(this.SendTransaction <depositReversalResponse>(transaction));
 }
Esempio n. 8
0
 public depositReversalResponse DepositReversal(depositReversal depositReversal)
 {
     return(SendRequest(response => response.depositReversalResponse, depositReversal));
 }
        public void testDepositReversal_Full()
        {
            var depositReversal = new depositReversal();
            depositReversal.id = "theId";
            depositReversal.reportGroup = "theReportGroup";
            depositReversal.customerId = "theCustomerId";
            depositReversal.litleTxnId = "123";

            var actual = depositReversal.Serialize();
            var expected = @"
            <depositReversal id=""theId"" customerId=""theCustomerId"" reportGroup=""theReportGroup"">
            <litleTxnId>123</litleTxnId>
            </depositReversal>";
            Assert.AreEqual(expected, actual);
        }