Пример #1
0
 public void Batch_WhenOpen_ShouldClose()
 {
     var creditSvc = new HpsCreditService(TestServicesConfig.ValidSecretKeyConfig());
     creditSvc.Charge(50).WithCard(TestCreditCard.ValidAmex).AllowDuplicates().Execute();
     
     var batchSvc = new HpsBatchService(TestServicesConfig.ValidSecretKeyConfig());
     var response = batchSvc.Close().WithClientTransactionId(12345).Execute();
     Assert.IsNotNull(response);
 }
Пример #2
0
        public void Batch_WhenOpen_ShouldClose()
        {
            var creditSvc = new HpsCreditService(TestServicesConfig.ValidSecretKeyConfig());

            creditSvc.Charge(50).WithCard(TestCreditCard.ValidAmex).AllowDuplicates().Execute();

            var batchSvc = new HpsBatchService(TestServicesConfig.ValidSecretKeyConfig());
            var response = batchSvc.Close().WithClientTransactionId(12345).Execute();

            Assert.IsNotNull(response);
        }
Пример #3
0
 public void Batch_ShouldClose_Ok()
 {
     try
     {
         var batchSvc = new HpsBatchService(_certConfig);
         var response = batchSvc.CloseBatch();
         Assert.IsNotNull(response);
     }
     catch (HpsGatewayException e)
     {
         if (e.Code != HpsExceptionCodes.NoOpenBatch && e.Code != HpsExceptionCodes.UnknownCreditError)
         {
             Assert.Fail("Something failed other than 'no open batch'.");
         }
     }
 }
Пример #4
0
 public void Batch_ShouldClose_Ok()
 {
     try
     {
         var batchSvc = new HpsBatchService(_certConfig);
         var response = batchSvc.CloseBatch();
         Assert.IsNotNull(response);
     }
     catch (HpsGatewayException e)
     {
         if (e.Code != HpsExceptionCodes.NoOpenBatch && e.Code != HpsExceptionCodes.UnknownCreditError)
         {
             Assert.Fail("Something failed other than 'no open batch'.");
         }
     }
 }