public void RFRBatch() { BatchRequest litleBatchRequest = new BatchRequest(); litleBatchRequest.ID = "1234567A"; AccountUpdate accountUpdate1 = new AccountUpdate(); accountUpdate1.OrderId = "1111"; CardType card = new CardType(); card.Type = MethodOfPaymentTypeEnum.VI; card.Number = "4242424242424242"; card.ExpDate = "1210"; accountUpdate1.Card = card; litleBatchRequest.AddAccountUpdate(accountUpdate1); AccountUpdate accountUpdate2 = new AccountUpdate(); accountUpdate2.OrderId = "1112"; accountUpdate2.Card = card; litleBatchRequest.AddAccountUpdate(accountUpdate2); litle.AddBatch(litleBatchRequest); LitleResponse litleResponse = litle.SendToLitleWithStream(); Assert.NotNull(litleResponse); BatchResponse litleBatchResponse = litleResponse.NextBatchResponse(); Assert.NotNull(litleBatchResponse); while (litleBatchResponse != null) { AccountUpdateResponse accountUpdateResponse = litleBatchResponse.NextAccountUpdateResponse(); Assert.NotNull(accountUpdateResponse); while (accountUpdateResponse != null) { Assert.AreEqual("000", accountUpdateResponse.Response); accountUpdateResponse = litleBatchResponse.NextAccountUpdateResponse(); } litleBatchResponse = litleResponse.NextBatchResponse(); } LitleRequest litleRfr = new LitleRequest(); RfrRequest rfrRequest = new RfrRequest(); AccountUpdateFileRequestData accountUpdateFileRequestData = new AccountUpdateFileRequestData(); accountUpdateFileRequestData.MerchantId = Properties.Settings.Default.merchantId; accountUpdateFileRequestData.PostDay = DateTime.Now; rfrRequest.AccountUpdateFileRequestData = accountUpdateFileRequestData; litleRfr.AddRfrRequest(rfrRequest); try { LitleResponse litleRfrResponse = litleRfr.SendToLitleWithStream(); Assert.NotNull(litleRfrResponse); RFRResponse rfrResponse = litleRfrResponse.NextRFRResponse(); Assert.NotNull(rfrResponse); while (rfrResponse != null) { Assert.AreEqual("1", rfrResponse.Response); Assert.AreEqual("The account update file is not ready yet. Please try again later.", rfrResponse.Message); rfrResponse = litleResponse.NextRFRResponse(); } } catch (Exception) { } }
public void PFIFInstructionTxnTest() { Dictionary<string, string> configOverride = new Dictionary<string, string>(); configOverride["url"] = Properties.Settings.Default.url; configOverride["reportGroup"] = Properties.Settings.Default.reportGroup; configOverride["username"] = "******"; configOverride["printxml"] = Properties.Settings.Default.printxml; configOverride["timeout"] = Properties.Settings.Default.timeout; configOverride["proxyHost"] = Properties.Settings.Default.proxyHost; configOverride["merchantId"] = "0180"; configOverride["password"] = "******"; configOverride["proxyPort"] = Properties.Settings.Default.proxyPort; configOverride["sftpUrl"] = Properties.Settings.Default.sftpUrl; configOverride["sftpUsername"] = Properties.Settings.Default.sftpUsername; configOverride["sftpPassword"] = Properties.Settings.Default.sftpPassword; configOverride["knownHostsFile"] = Properties.Settings.Default.knownHostsFile; configOverride["onlineBatchUrl"] = Properties.Settings.Default.onlineBatchUrl; configOverride["onlineBatchPort"] = Properties.Settings.Default.onlineBatchPort; configOverride["requestDirectory"] = Properties.Settings.Default.requestDirectory; configOverride["responseDirectory"] = Properties.Settings.Default.responseDirectory; LitleRequest litleOverride = new LitleRequest(configOverride); BatchRequest litleBatchRequest = new BatchRequest(configOverride); EcheckType echeck = new EcheckType(); echeck.AccType = EcheckAccountTypeEnum.Corporate; echeck.AccNum = "1092969901"; echeck.RoutingNum = "011075150"; echeck.CheckNum = "123455"; SubmerchantCredit submerchantCredit = new SubmerchantCredit(); submerchantCredit.FundingSubmerchantId = "123456"; submerchantCredit.SubmerchantName = "merchant"; submerchantCredit.FundsTransferId = "123467"; submerchantCredit.Amount = 106L; submerchantCredit.AccountInfo = echeck; litleBatchRequest.AddSubmerchantCredit(submerchantCredit); PayFacCredit payFacCredit = new PayFacCredit(); payFacCredit.FundingSubmerchantId = "123456"; payFacCredit.FundsTransferId = "123467"; payFacCredit.Amount = 107L; litleBatchRequest.AddPayFacCredit(payFacCredit); ReserveCredit reserveCredit = new ReserveCredit(); reserveCredit.FundingSubmerchantId = "123456"; reserveCredit.FundsTransferId = "123467"; reserveCredit.Amount = 107L; litleBatchRequest.AddReserveCredit(reserveCredit); VendorCredit vendorCredit = new VendorCredit(); vendorCredit.FundingSubmerchantId = "123456"; vendorCredit.VendorName = "merchant"; vendorCredit.FundsTransferId = "123467"; vendorCredit.Amount = 106L; vendorCredit.AccountInfo = echeck; litleBatchRequest.AddVendorCredit(vendorCredit); PhysicalCheckCredit physicalCheckCredit = new PhysicalCheckCredit(); physicalCheckCredit.FundingSubmerchantId = "123456"; physicalCheckCredit.FundsTransferId = "123467"; physicalCheckCredit.Amount = 107L; litleBatchRequest.AddPhysicalCheckCredit(physicalCheckCredit); SubmerchantDebit submerchantDebit = new SubmerchantDebit(); submerchantDebit.FundingSubmerchantId = "123456"; submerchantDebit.SubmerchantName = "merchant"; submerchantDebit.FundsTransferId = "123467"; submerchantDebit.Amount = 106L; submerchantDebit.AccountInfo = echeck; litleBatchRequest.AddSubmerchantDebit(submerchantDebit); PayFacDebit payFacDebit = new PayFacDebit(); payFacDebit.FundingSubmerchantId = "123456"; payFacDebit.FundsTransferId = "123467"; payFacDebit.Amount = 107L; litleBatchRequest.AddPayFacDebit(payFacDebit); ReserveDebit reserveDebit = new ReserveDebit(); reserveDebit.FundingSubmerchantId = "123456"; reserveDebit.FundsTransferId = "123467"; reserveDebit.Amount = 107L; litleBatchRequest.AddReserveDebit(reserveDebit); VendorDebit vendorDebit = new VendorDebit(); vendorDebit.FundingSubmerchantId = "123456"; vendorDebit.VendorName = "merchant"; vendorDebit.FundsTransferId = "123467"; vendorDebit.Amount = 106L; vendorDebit.AccountInfo = echeck; litleBatchRequest.AddVendorDebit(vendorDebit); PhysicalCheckDebit physicalCheckDebit = new PhysicalCheckDebit(); physicalCheckDebit.FundingSubmerchantId = "123456"; physicalCheckDebit.FundsTransferId = "123467"; physicalCheckDebit.Amount = 107L; litleBatchRequest.AddPhysicalCheckDebit(physicalCheckDebit); litleOverride.AddBatch(litleBatchRequest); LitleResponse litleResponse = litleOverride.SendToLitleWithStream(); Assert.NotNull(litleResponse); Assert.AreEqual("0", litleResponse.Response); Assert.AreEqual("Valid Format", litleResponse.Message); BatchResponse litleBatchResponse = litleResponse.NextBatchResponse(); while (litleBatchResponse != null) { SubmerchantCreditResponse submerchantCreditResponse = litleBatchResponse.NextSubmerchantCreditResponse(); while (submerchantCreditResponse != null) { Assert.AreEqual("000", submerchantCreditResponse.Response); submerchantCreditResponse = litleBatchResponse.NextSubmerchantCreditResponse(); } PayFacCreditResponse payFacCreditResponse = litleBatchResponse.NextPayFacCreditResponse(); while (payFacCreditResponse != null) { Assert.AreEqual("000", payFacCreditResponse.Response); payFacCreditResponse = litleBatchResponse.NextPayFacCreditResponse(); } VendorCreditResponse vendorCreditResponse = litleBatchResponse.NextVendorCreditResponse(); while (vendorCreditResponse != null) { Assert.AreEqual("000", vendorCreditResponse.Response); vendorCreditResponse = litleBatchResponse.NextVendorCreditResponse(); } ReserveCreditResponse reserveCreditResponse = litleBatchResponse.NextReserveCreditResponse(); while (reserveCreditResponse != null) { Assert.AreEqual("000", reserveCreditResponse.Response); reserveCreditResponse = litleBatchResponse.NextReserveCreditResponse(); } PhysicalCheckCreditResponse physicalCheckCreditResponse = litleBatchResponse.NextPhysicalCheckCreditResponse(); while (physicalCheckCreditResponse != null) { Assert.AreEqual("000", physicalCheckCreditResponse.Response); physicalCheckCreditResponse = litleBatchResponse.NextPhysicalCheckCreditResponse(); } SubmerchantDebitResponse submerchantDebitResponse = litleBatchResponse.NextSubmerchantDebitResponse(); while (submerchantDebitResponse != null) { Assert.AreEqual("000", submerchantDebitResponse.Response); submerchantDebitResponse = litleBatchResponse.NextSubmerchantDebitResponse(); } PayFacDebitResponse payFacDebitResponse = litleBatchResponse.NextPayFacDebitResponse(); while (payFacDebitResponse != null) { Assert.AreEqual("000", payFacDebitResponse.Response); payFacDebitResponse = litleBatchResponse.NextPayFacDebitResponse(); } VendorDebitResponse vendorDebitResponse = litleBatchResponse.NextVendorDebitResponse(); while (vendorDebitResponse != null) { Assert.AreEqual("000", vendorDebitResponse.Response); vendorDebitResponse = litleBatchResponse.NextVendorDebitResponse(); } ReserveDebitResponse reserveDebitResponse = litleBatchResponse.NextReserveDebitResponse(); while (reserveDebitResponse != null) { Assert.AreEqual("000", reserveDebitResponse.Response); reserveDebitResponse = litleBatchResponse.NextReserveDebitResponse(); } PhysicalCheckDebitResponse physicalCheckDebitResponse = litleBatchResponse.NextPhysicalCheckDebitResponse(); while (physicalCheckDebitResponse != null) { Assert.AreEqual("000", physicalCheckDebitResponse.Response); physicalCheckDebitResponse = litleBatchResponse.NextPhysicalCheckDebitResponse(); } litleBatchResponse = litleResponse.NextBatchResponse(); } }