public void Discover_Verify_ShouldReturnOk() { var creditSvc = new HpsCreditService(TestServicesConfig.ValidSecretKeyConfig()); var response = creditSvc.Verify(TestCreditCard.ValidDiscover, TestCardHolder.ValidCardHolder); Assert.AreEqual("85", response.ResponseCode); }
public void Amex_Manual_ShouldVerify() { var creditSvc = new HpsCreditService(TestServicesConfig.ValidSecretKeyConfig()); var response = creditSvc.Verify(TestCreditCard.ValidAmex, TestCardHolder.CertCardHolderShortZip, true); Assert.AreEqual("00", response.ResponseCode); }
public void CreditVerifyWithTagData() { var card = new HpsCreditCard { Number = "4111111111111111", ExpMonth = 12, ExpYear = 2014, Cvv = "123" }; var tokenService = new HpsTokenService("pkapi_cert_m0e9bI2WbBHk0ALyQL"); var token_reponse = tokenService.GetToken(card); var creditService = new HpsCreditService(new HpsServicesConfig { SecretApiKey = "skapi_cert_MTeSAQAfG1UA9qQDrzl-kz4toXvARyieptFwSKP24w" }); var trackData = new HpsTrackData { Value = ";4761739001010036=15122011184404889?" }; var tagData = new HpsTagDataType { TagData = "9F4005F000F0A0019F02060000000025009F03060000000000009F2608D90A06501B48564E82027C005F3401019F360200029F0702FF009F0802008C9F0902008C9F34030403029F2701809F0D05F0400088009F0E0508000000009F0F05F0400098005F280208409F390105FFC605DC4000A800FFC7050010000000FFC805DC4004F8009F3303E0B8C89F1A0208409F350122950500000080005F2A0208409A031409109B02E8009F21030811539C01009F37045EED3A8E4F07A00000000310109F0607A00000000310108407A00000000310109F100706010A03A400029F410400000001", Source = TagDataTypeTagValuesSource.chip }; var response = creditService.Verify(trackData, null, false, null, tagData); Assert.IsNotNull(response); Assert.AreEqual("85", response.ResponseCode); }
public void Amex_Avs_ShouldBe_Ok() { var chargeSvc = new HpsCreditService(_certConfig); var response = chargeSvc.Verify(TestCreditCard.ValidAmex, TestCardHolder.CertCardHolderShortZipNoStreet); Assert.IsNotNull(response); StringAssert.Matches(response.ResponseCode, new Regex("^00$")); }
public void Discover_ShouldVerify_Ok() { var chargeSvc = new HpsCreditService(_certConfig); var response = chargeSvc.Verify(TestCreditCard.ValidDiscover); Assert.IsNotNull(response); StringAssert.Matches(response.ResponseCode, new Regex("^85$")); }
public void Discover_Swipe_ShouldVerify() { var service = new HpsCreditService(TestServicesConfig.ValidSecretKeyConfig()); var verify = service.Verify(new HpsTrackData { Value = "%B6011000990156527^DIS TEST CARD^25121011000062111401?;6011000990156527=25121011000062111401?", Method = HpsTrackDataMethod.Swipe }); Assert.IsNotNull(verify); StringAssert.Matches(verify.ResponseCode, new Regex("85")); }
public void Mastercard_Swipe_ShouldVerify() { var service = new HpsCreditService(TestServicesConfig.ValidSecretKeyConfig()); var verify = service.Verify(new HpsTrackData { Value = "%B5473500000000014^MC TEST CARD^251210199998888777766665555444433332?;5473500000000014=25121019999888877776?", Method = HpsTrackDataMethod.Swipe }); Assert.IsNotNull(verify); StringAssert.Matches(verify.ResponseCode, new Regex("85")); }
public void Visa_Swipe_ShouldVerify() { var service = new HpsCreditService(TestServicesConfig.ValidSecretKeyConfig()); var verify = service.Verify(new HpsTrackData { Value = "%B4012002000060016^VI TEST CREDIT^251210118039000000000396?;4012002000060016=25121011803939600000?", Method = HpsTrackDataMethod.Swipe }); Assert.IsNotNull(verify); StringAssert.Matches(verify.ResponseCode, new Regex("85")); }
public void CreditVerifyWithTokenExpiry() { var card = new HpsCreditCard { Number = "4111111111111111", ExpMonth = 12, ExpYear = 2014, Cvv = "123" }; var tokenService = new HpsTokenService("pkapi_cert_m0e9bI2WbBHk0ALyQL"); var token_reponse = tokenService.GetToken(card); var creditService = new HpsCreditService(new HpsServicesConfig { SecretApiKey = "skapi_cert_MTeSAQAfG1UA9qQDrzl-kz4toXvARyieptFwSKP24w" }); var response = creditService.Verify(token_reponse.token_value, null, false, null, 12, 2025); Assert.IsNotNull(response); Assert.AreEqual("85", response.ResponseCode); }
public void ManageTokens() { var service = new HpsCreditService(TestServicesConfig.ValidSecretKeyConfig()); var response = service.Verify(new HpsCreditCard { Number = "4111111111111111", ExpMonth = 12, ExpYear = 2015, Cvv = "123" }, null, true); Assert.IsNotNull(response); Assert.IsNotNull(response.TokenData); Assert.AreEqual("85", response.ResponseCode); Assert.AreEqual(0, response.TokenData.TokenRspCode); var token = response.TokenData.TokenValue; var updateRepsonse = service.UpdateTokenExpiration(token, 12, 2025); Assert.IsNotNull(updateRepsonse); Assert.AreEqual("0", updateRepsonse.ResponseCode); }
public void Mastercard_Verify_ShouldReturnOk() { var creditSvc = new HpsCreditService(TestServicesConfig.ValidSecretKeyConfig()); var response = creditSvc.Verify(TestCreditCard.ValidMasterCard, TestCardHolder.ValidCardHolder); Assert.AreEqual("85", response.ResponseCode); }
public void ManageTokens() { var service = new HpsCreditService(TestServicesConfig.ValidSecretKeyConfig()); var response = service.Verify(new HpsCreditCard { Number = "4111111111111111", ExpMonth = 12, ExpYear = 2015, Cvv = "123" }, null, true); Assert.IsNotNull(response); Assert.IsNotNull(response.TokenData); Assert.AreEqual("85", response.ResponseCode); Assert.AreEqual(0, response.TokenData.TokenRspCode); var token = response.TokenData.TokenValue; var updateRepsonse = service.UpdateTokenExpiration(token, 12, 2025); Assert.IsNotNull(updateRepsonse); Assert.AreEqual("0", updateRepsonse.ResponseCode); }
public void Amex_Avs_ShouldBe_Ok() { var chargeSvc = new HpsCreditService(_certConfig); var response = chargeSvc.Verify(TestCreditCard.ValidAmex, TestCardHolder.CertCardHolderShortZipNoStreet); Assert.IsNotNull(response); StringAssert.Matches(response.ResponseCode, new Regex("^00$")); }
public void Discover_ShouldVerify_Ok() { var chargeSvc = new HpsCreditService(_certConfig); var response = chargeSvc.Verify(TestCreditCard.ValidDiscover); Assert.IsNotNull(response); StringAssert.Matches(response.ResponseCode, new Regex("^85$")); }