Inheritance: transactionTypeWithReportGroup
コード例 #1
0
        public void UnloadReversal()
        {
            var reversal = new unloadReversal
            {
                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.UnloadReversal(reversal);

            Assert.AreEqual("Approved", response.message);
        }
コード例 #2
0
        public void UnloadReversal()
        {
            unloadReversal reversal = new unloadReversal();

            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.UnloadReversal(reversal);
        }
コード例 #3
0
        public void UnloadReversal()
        {
            unloadReversal reversal = new unloadReversal();

            reversal.id          = "1";
            reversal.reportGroup = "planets";
            reversal.cnpTxnId    = 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(".*<cnpTxnId>123456000</cnpTxnId>\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)))
            .Returns("<cnpOnlineResponse version='8.14' response='0' message='Valid Format' xmlns='http://www.vantivcnp.com/schema'><unloadReversalResponse><cnpTxnId>123</cnpTxnId><location>sandbox</location></unloadReversalResponse></cnpOnlineResponse>");

            Communications mockedCommunication = mock.Object;

            cnp.SetCommunication(mockedCommunication);
            var response = cnp.UnloadReversal(reversal);

            Assert.NotNull(response);
            Assert.AreEqual("sandbox", response.location);
        }
コード例 #4
0
        public unloadReversalResponse UnloadReversal(unloadReversal unloadReversal)
        {
            litleOnlineRequest request = createLitleOnlineRequest();

            request.unloadReversal = unloadReversal;

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

            return(unloadReversalResponse);
        }
コード例 #5
0
        public void testUnloadReversal_Full()
        {
            unloadReversal unloadReversal = new unloadReversal();

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

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

            Assert.AreEqual(expected, actual);
        }
コード例 #6
0
        public void TestSimple()
        {
            unloadReversal unloadReversal = new unloadReversal();
            unloadReversal.id = "a";
            unloadReversal.reportGroup = "b";
            unloadReversal.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'><unloadReversalResponse><litleTxnId>123</litleTxnId></unloadReversalResponse></litleOnlineResponse>");

            Communications mockedCommunication = mock.Object;
            litle.setCommunication(mockedCommunication);
            unloadReversalResponse response = litle.UnloadReversal(unloadReversal);
            Assert.AreEqual("123", response.litleTxnId);
        }
コード例 #7
0
        public void TestSimple()
        {
            unloadReversal unloadReversal = new unloadReversal();

            unloadReversal.id          = "a";
            unloadReversal.reportGroup = "b";
            unloadReversal.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'><unloadReversalResponse><litleTxnId>123</litleTxnId></unloadReversalResponse></litleOnlineResponse>");

            Communications mockedCommunication = mock.Object;

            litle.setCommunication(mockedCommunication);
            unloadReversalResponse response = litle.UnloadReversal(unloadReversal);

            Assert.AreEqual("123", response.litleTxnId);
        }
コード例 #8
0
 public unloadReversalResponse UnloadReversal(unloadReversal transaction)
 {
     return(this.SendTransaction <unloadReversalResponse>(transaction));
 }
コード例 #9
0
        public void testUnloadReversal_Full()
        {
            unloadReversal unloadReversal = new unloadReversal();
            unloadReversal.id = "theId";
            unloadReversal.reportGroup = "theReportGroup";
            unloadReversal.customerId = "theCustomerId";
            unloadReversal.litleTxnId = "123";

            String actual = unloadReversal.Serialize();
            String expected = @"
            <unloadReversal id=""theId"" customerId=""theCustomerId"" reportGroup=""theReportGroup"">
            <litleTxnId>123</litleTxnId>
            </unloadReversal>";
            Assert.AreEqual(expected, actual);
        }
コード例 #10
0
        public unloadReversalResponse UnloadReversal(unloadReversal unloadReversal)
        {
            litleOnlineRequest request = createLitleOnlineRequest();
            request.unloadReversal = unloadReversal;

            litleOnlineResponse response = sendToLitle(request);
            unloadReversalResponse unloadReversalResponse = response.unloadReversalResponse;
            return unloadReversalResponse;
        }
コード例 #11
0
 public unloadReversalResponse UnloadReversal(unloadReversal unloadReversal)
 {
     return(SendRequest(response => response.unloadReversalResponse, unloadReversal));
 }