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); }
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'."); } } }