public void SimpleEcheckCredit() { var echeckcredit = new echeckCredit { id = "1", reportGroup = "Planets", amount = 12L, cnpTxnId = 123456789101112L, }; var response = _cnp.EcheckCredit(echeckcredit); Assert.AreEqual("Approved", response.message); Assert.AreEqual("sandbox", response.location); }
public void Test45() { echeckCredit credit = new echeckCredit(); credit.id = "1"; credit.orderId = "45"; credit.amount = 1001; credit.orderSource = orderSourceType.telephone; contact billToAddress = new contact(); billToAddress.firstName = "John"; billToAddress.lastName = "Smith"; credit.billToAddress = billToAddress; echeckType echeck = new echeckType(); echeck.accNum = "10@BC99999"; echeck.accType = echeckAccountTypeEnum.Checking; echeck.routingNum = "053100300"; credit.echeck = echeck; echeckCreditResponse response = cnp.EcheckCredit(credit); Assert.AreEqual("301", response.response); }
public void TestEcheckCredit() { echeckCredit echeckcredit = new echeckCredit(); echeckcredit.amount = 12; echeckcredit.cnpTxnId = 123456789101112; var mock = new Mock <Communications>(); mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*?<cnpOnlineRequest.*?<echeckCredit.*?<cnpTxnId>123456789101112</cnpTxnId>.*?</echeckCredit>.*?", RegexOptions.Singleline), It.IsAny <Dictionary <String, String> >())) .Returns("<cnpOnlineResponse version='8.10' response='0' message='Valid Format' xmlns='http://www.vantivcnp.com/schema'><echeckCreditResponse><cnpTxnId>123</cnpTxnId></echeckCreditResponse></cnpOnlineResponse>"); Communications mockedCommunication = mock.Object; cnp.SetCommunication(mockedCommunication); echeckCreditResponse echeckcreditresponse = cnp.EcheckCredit(echeckcredit); Assert.AreEqual(123, echeckcreditresponse.cnpTxnId); }