public void GiftCard_ManualCard_ShouldReverseUsingGiftCard()
        {
            var giftCardSvc  = new HpsGiftCardService(TestServicesConfig.ValidSecretKeyConfig());
            var saleResponse = giftCardSvc.Sale(TestGiftCard.Manual.validGiftCardNotEncrypted, 10.00m);

            StringAssert.Matches(saleResponse.ResponseCode, new Regex("^0$"));
            var reverseResponse = giftCardSvc.Reverse(TestGiftCard.Manual.validGiftCardNotEncrypted, 10.00m);

            StringAssert.Matches(reverseResponse.ResponseCode, new Regex("^0$"));
        }
        public void GiftCard_ManualCard_ShouldVoid()
        {
            var giftCardSvc  = new HpsGiftCardService(TestServicesConfig.ValidSecretKeyConfig());
            var saleResponse = giftCardSvc.Sale(TestGiftCard.Manual.validGiftCardNotEncrypted, 10.00m);

            StringAssert.Matches(saleResponse.ResponseCode, new Regex("^0$"));
            var voidResponse = giftCardSvc.Void(saleResponse.TransactionId).Execute();

            StringAssert.Matches(voidResponse.ResponseCode, new Regex("^0$"));
        }
        public void GiftCard_ManualCard_ShouldBalance()
        {
            var giftCardSvc = new HpsGiftCardService(TestServicesConfig.ValidSecretKeyConfig());
            var response = giftCardSvc.Balance(TestGiftCard.Manual.validGiftCardNotEncrypted).Execute();
            if (response == null)
            {
                Assert.Fail("Response is null.");
            }

            StringAssert.Matches(response.ResponseCode, new Regex("^0$"));
        }
Esempio n. 4
0
        public void GiftCard_ManualCard_ShouldActivate()
        {
            var giftCardSvc = new HpsGiftCardService(TestServicesConfig.ValidSecretKeyConfig());
            var response    = giftCardSvc.Activate(100.00M, "usd", TestGiftCard.Manual.validGiftCardNotEncrypted);

            if (response == null)
            {
                Assert.Fail("Response is null.");
            }

            StringAssert.Matches(response.ResponseCode, new Regex("^0$"));
        }
        public void GiftCard_ManualCard_ShouldAlias()
        {
            var giftCardSvc = new HpsGiftCardService(TestServicesConfig.ValidSecretKeyConfig());
            try
            {
                var response = giftCardSvc.Alias(HpsGiftCardAliasAction.Add,
                    TestGiftCard.Manual.validGiftCardNotEncrypted, "1234567890");
                if (response == null)
                {
                    Assert.Fail("Response is null.");
                }

                StringAssert.Matches(response.ResponseCode, new Regex("^0$"));
            }
            catch (HpsCreditException ex)
            {
                if (ex.Details.IssuerResponseCode != "6")
                {
                    throw;
                }
            }
        }
        public void GiftCard_ManualCard_ShouldAlias()
        {
            var giftCardSvc = new HpsGiftCardService(TestServicesConfig.ValidSecretKeyConfig());

            try
            {
                var response = giftCardSvc.Alias(HpsGiftCardAliasAction.Add,
                                                 TestGiftCard.Manual.validGiftCardNotEncrypted, "1234567890");
                if (response == null)
                {
                    Assert.Fail("Response is null.");
                }

                StringAssert.Matches(response.ResponseCode, new Regex("^0$"));
            }
            catch (HpsCreditException ex)
            {
                if (ex.Details.IssuerResponseCode != "6")
                {
                    throw;
                }
            }
        }
 public void GiftCard_ManualCard_ShouldReverseUsingGiftCard()
 {
     var giftCardSvc = new HpsGiftCardService(TestServicesConfig.ValidSecretKeyConfig());
     var saleResponse = giftCardSvc.Sale(TestGiftCard.Manual.validGiftCardNotEncrypted, 10.00m);
     StringAssert.Matches(saleResponse.ResponseCode, new Regex("^0$"));
     var reverseResponse = giftCardSvc.Reverse(TestGiftCard.Manual.validGiftCardNotEncrypted, 10.00m);
     StringAssert.Matches(reverseResponse.ResponseCode, new Regex("^0$"));
 }
 public void GiftCard_ManualCard_ShouldVoid()
 {
     var giftCardSvc = new HpsGiftCardService(TestServicesConfig.ValidSecretKeyConfig());
     var saleResponse = giftCardSvc.Sale(TestGiftCard.Manual.validGiftCardNotEncrypted, 10.00m);
     StringAssert.Matches(saleResponse.ResponseCode, new Regex("^0$"));
     var voidResponse = giftCardSvc.Void(saleResponse.TransactionId).Execute();
     StringAssert.Matches(voidResponse.ResponseCode, new Regex("^0$"));
 }