Ejemplo n.º 1
0
        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"));
        }
Ejemplo n.º 2
0
        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"));
        }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
        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"));
        }
Ejemplo n.º 5
0
        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);
        }