public void SimpleCaptureGivenAuthWithCard() { var capturegivenauth = new captureGivenAuth { amount = 106, orderId = "12344", orderSource = orderSourceType.ecommerce, card = new cardType { type = methodOfPaymentTypeEnum.VI, number = "4100000000000000", expDate = "1210" }, authInformation = new authInformation { authDate = new DateTime(2002, 10, 9), authCode = "543216", authAmount = 12345 } }; var response = _litle.CaptureGivenAuth(capturegivenauth); Assert.AreEqual("Approved", response.message); }
public void testCaptureGivenAuth() { captureGivenAuth capturegivenauth = new captureGivenAuth(); capturegivenauth.orderId = "12344"; capturegivenauth.amount = 106; authInformation authinfo = new authInformation(); authinfo.authDate = new DateTime(2002, 10, 9); authinfo.authCode = "543216"; authinfo.authAmount = 12345; capturegivenauth.authInformation = authinfo; capturegivenauth.orderSource = orderSourceType.ecommerce; cardType card = new cardType(); card.type = methodOfPaymentTypeEnum.VI; card.number = "4100000000000001"; card.expDate = "1210"; capturegivenauth.card = card; var mock = new Mock <Communications>(); mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*?<litleOnlineRequest.*?<captureGivenAuth.*?<card>.*?<number>4100000000000001</number>.*?</card>.*?</captureGivenAuth>.*?", RegexOptions.Singleline), It.IsAny <Dictionary <String, String> >())) .Returns("<litleOnlineResponse version='8.10' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><captureGivenAuthResponse><litleTxnId>123</litleTxnId></captureGivenAuthResponse></litleOnlineResponse>"); Communications mockedCommunication = mock.Object; litle.setCommunication(mockedCommunication); captureGivenAuthResponse caputregivenauthresponse = litle.CaptureGivenAuth(capturegivenauth); Assert.AreEqual(123, caputregivenauthresponse.litleTxnId); }
public void simpleCaptureGivenAuthWithCard() { var capturegivenauth = new captureGivenAuth { id = "1", amount = 106, orderId = "12344", authInformation = new authInformation { authDate = new DateTime(2002, 10, 9), authCode = "543216", authAmount = 12345, }, orderSource = orderSourceType.ecommerce, card = new cardType { type = methodOfPaymentTypeEnum.VI, number = "4100000000000000", expDate = "1210", }, processingType = processingTypeEnum.accountFunding, originalNetworkTransactionId = "abc123", originalTransactionAmount = 123456789 }; var response = _litle.CaptureGivenAuth(capturegivenauth); Assert.AreEqual("Approved", response.message); }
public void TestSurchargeAmount() { captureGivenAuth capture = new captureGivenAuth(); capture.amount = 2; capture.surchargeAmount = 1; capture.orderSource = orderSourceType.ecommerce; capture.reportGroup = "Planets"; var mock = new Mock <Communications>(); mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<amount>2</amount>\r\n<surchargeAmount>1</surchargeAmount>\r\n<orderSource>ecommerce</orderSource>.*", RegexOptions.Singleline), It.IsAny <Dictionary <String, String> >())) .Returns("<litleOnlineResponse version='8.14' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><captureGivenAuthResponse><litleTxnId>123</litleTxnId></captureGivenAuthResponse></litleOnlineResponse>"); Communications mockedCommunication = mock.Object; litle.setCommunication(mockedCommunication); litle.CaptureGivenAuth(capture); }
public void TestSecondaryAmount() { var capture = new captureGivenAuth { amount = 2, secondaryAmount = 1, orderSource = orderSourceType.ecommerce, reportGroup = "Planets" }; var mock = new Mock <Communications>(); mock.Setup(communications => communications.HttpPost(It.IsRegex(".*<amount>2</amount>\r\n<secondaryAmount>1</secondaryAmount>\r\n<orderSource>ecommerce</orderSource>.*", RegexOptions.Singleline), It.IsAny <Dictionary <string, string> >())) .Returns("<litleOnlineResponse version='9.10' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><captureGivenAuthResponse><litleTxnId>123</litleTxnId></captureGivenAuthResponse></litleOnlineResponse>"); var mockedCommunication = mock.Object; _litle.setCommunication(mockedCommunication); _litle.CaptureGivenAuth(capture); }
public void simpleCaptureGivenAuthWithCard() { var capturegivenauth = new captureGivenAuth(); capturegivenauth.amount = 106; capturegivenauth.orderId = "12344"; var authInfo = new authInformation(); var authDate = new DateTime(2002, 10, 9); authInfo.authDate = authDate; authInfo.authCode = "543216"; authInfo.authAmount = 12345; capturegivenauth.authInformation = authInfo; capturegivenauth.orderSource = orderSourceType.ecommerce; var card = new cardType(); card.type = methodOfPaymentTypeEnum.VI; card.number = "4100000000000000"; card.expDate = "1210"; capturegivenauth.card = card; var response = litle.CaptureGivenAuth(capturegivenauth); Assert.AreEqual("Approved", response.message); }