public void Test_149_pre_authorization()
        {
            Transaction response = track.Authorize(1m)
                                   .WithCurrency("USD")
                                   .Execute();

            Assert.IsNotNull(response);

            // check message data
            PriorMessageInformation pmi = response.MessageInformation;

            Assert.IsNotNull(pmi);
            Assert.AreEqual("1100", pmi.MessageTransactionIndicator);
            Assert.AreEqual("000800", pmi.ProcessingCode);
            Assert.AreEqual("101", pmi.FunctionCode);

            // check response
            Assert.AreEqual("000", response.ResponseCode);
            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
        }
        public void DebitSaleSwipe_AuthorizeThenCapture()
        {
            var response = debitTrackData.Authorize(amount)
                           .WithCurrency(currency)
                           .Execute();

            AssertTransactionResponse(response, TransactionStatus.Preauthorized);

            var captureResponse = response.Capture(amount)
                                  .WithCurrency(currency)
                                  .Execute();

            AssertTransactionResponse(captureResponse, TransactionStatus.Captured);
        }
Beispiel #3
0
        public void WFRC_Response_Tests_Auth()
        {
            Transaction response = track.Authorize(10m, true)
                                   .WithCurrency("USD")
                                   .Execute();

            Assert.IsNotNull(response);
            System.Diagnostics.Debug.WriteLine(response.ResponseMessage);
            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
        }
Beispiel #4
0
        public void CloseBatch_Reverse_DebitTrackData()
        {
            var debitCard = new DebitTrackData {
                Value =
                    "%B4012002000060016^VI TEST CREDIT^251210118039000000000396?;4012002000060016=25121011803939600000?",
                PinBlock    = "32539F50C245A6A93D123412324000AA",
                EntryMethod = EntryMethod.Swipe,
            };

            var transaction = debitCard.Authorize(1.99m)
                              .WithCurrency(CURRENCY)
                              .Execute();

            AssertTransactionResponse(transaction, TransactionStatus.Preauthorized);

            var reverseTransaction = transaction.Reverse()
                                     .WithCurrency(CURRENCY)
                                     .Execute();

            AssertTransactionResponse(reverseTransaction, TransactionStatus.Reversed);

            //TODO - remove when api fix polling issue
            Thread.Sleep(1000);

            var exceptionCaught = false;

            try {
                BatchService.CloseBatch(transaction.BatchSummary.BatchReference);
            }
            catch (GatewayException ex) {
                exceptionCaught = true;
                Assert.AreEqual("MANDATORY_DATA_MISSING", ex.ResponseCode);
                Assert.AreEqual("40223", ex.ResponseMessage);
                Assert.AreEqual("Status Code: BadRequest - Request expects the batch_id", ex.Message);
            }
            finally {
                Assert.IsTrue(exceptionCaught);
            }
        }
Beispiel #5
0
        private Transaction DebitAuth(double amount)
        {
            DebitTrackData track = TestCards.AsDebit(TestCards.VisaSwipe(), "32539F50C245A6A93D123412324000AA");

            AuthorizationBuilder builder = track.Authorize(new decimal(amount))
                                           .WithCurrency("USD");

            if (configName.Equals("NoBatch"))
            {
                builder.WithBatchNumber(batchProvider.GetBatchNumber(), batchProvider.GetSequenceNumber());
            }

            Transaction response = builder.Execute(configName);

            Assert.IsNotNull(response);
            Assert.AreEqual("000", response.ResponseCode);

            Transaction capture = response.Capture().Execute();

            Assert.IsNotNull(capture);
            Assert.AreEqual("000", capture.ResponseCode);
            return(capture);
        }