public void SetUp()
        {
            var config = new Configuration();

            config.Set("host", "https://services.vantivprelive.com");
            _retrievalRequest = new ChargebackRetrievalRequest {
                Config = config
            };
            _updateRequest = new ChargebackUpdateRequest {
                Config = config
            };
        }
Example #2
0
        public void TestAddNote(long caseId, string note, int expectedTxnId)
        {
            var expectedXmlResponse     = generateXmlResponse(expectedTxnId);
            var expectedXmlRequest      = generateXmlRequest(activityType.ADD_NOTE, null, note);
            var expectedSendingBytes    = ChargebackUtils.StringToBytes(expectedXmlRequest);
            var expectedResponseContent = new ResponseContent(
                "text/xml", ChargebackUtils.StringToBytes(expectedXmlResponse));
            var commMock = new Mock <Communication>();

            commMock.Setup(c => c.Put("/chargebacks/" + caseId, expectedSendingBytes))
            .Returns(expectedResponseContent);
            var request
                = new ChargebackUpdateRequest(commMock.Object);
            var response
                = request.AddNote(caseId, note);

            Assert.AreEqual(expectedTxnId, response.transactionId);
        }
Example #3
0
        public void TestRepresentWithRepresentedAmount(long caseId, long representedAmount, string note, int expectedTxnId)
        {
            var expectedXmlResponse = generateXmlResponse(expectedTxnId);
            var expectedXmlRequest
                = generateXmlRequest(activityType.MERCHANT_REPRESENT, null, note, true, representedAmount);
            var expectedSendingBytes    = ChargebackUtils.StringToBytes(expectedXmlRequest);
            var expectedResponseContent = new ResponseContent(
                "text/xml", ChargebackUtils.StringToBytes(expectedXmlResponse));
            var commMock = new Mock <Communication>();

            commMock.Setup(c => c.Put("/chargebacks/" + caseId, expectedSendingBytes))
            .Returns(expectedResponseContent);
            var request
                = new ChargebackUpdateRequest(commMock.Object);
            var response
                = request.Represent(caseId, representedAmount, note);

            Assert.AreEqual(expectedTxnId, response.transactionId);
        }
Example #4
0
 public void SetUp()
 {
     _updateRequest = new ChargebackUpdateRequest();
 }