Example #1
0
        public void Test_002_mastercard_authorization()
        {
            CreditTrackData track = TestCards.MasterCardSwipe();

            Transaction response = track.Authorize(1m, true)
                                   .WithCurrency("USD")
                                   .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("000", response.ResponseCode);
        }
Example #2
0
        public void Retail_018b_ChargeMastercardSwipe()
        {
            var card = TestCards.MasterCard25Swipe();

            var response = card.Charge(11.50m)
                           .WithCurrency("USD")
                           .WithAllowDuplicates(true)
                           .Execute("retail");

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Example #3
0
        public void Ecomm_010b_Charge_Master_Card_2Manual()
        {
            var card = TestCards.MasterCardSeries2Manual();

            var response = card.Charge(28m)
                           .WithCurrency("USD")
                           .WithAllowDuplicates(true)
                           .Execute("ecomm");

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Example #4
0
        public void Test_010_visa_sale()
        {
            CreditCardData card = TestCards.VisaManual(true, true);

            Transaction response = card.Charge(0m)
                                   .WithCurrency("USD")
                                   .WithAddress(new Address("90001"))
                                   .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("000", response.ResponseCode);
        }
Example #5
0
        public void Test_009_mastercard_sale()
        {
            CreditCardData card = TestCards.MasterCardManual(true, true);

            Transaction response = card.Authorize(0m)
                                   .WithCurrency("USD")
                                   .WithAddress(new Address("90031"))
                                   .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("000", response.ResponseCode);
        }
Example #6
0
        public void Test_Visa_Account_Verification()
        {
            CreditTrackData track = TestCards.VisaSwipe(EntryMethod.Swipe);

            Transaction response = track.Authorize(0m, false)
                                   .WithCurrency("USD")
                                   .Execute();

            Assert.IsNotNull(response);
            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
            Assert.AreEqual("000", response.ResponseCode);
        }
Example #7
0
        public void Test_013_visa_cid_on_card()
        {
            CreditCardData card = TestCards.VisaManual(false, false);

            card.Cvn = "113";

            Transaction response = card.Authorize(10m)
                                   .WithCurrency("USD")
                                   .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("107", response.ResponseCode);
        }
Example #8
0
        public void Test_009_mastercard_not_processed()
        {
            CreditCardData card = TestCards.MasterCardManual(false, false);

            card.Cvn = "109";

            Transaction response = card.Authorize(10m)
                                   .WithCurrency("USD")
                                   .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("107", response.ResponseCode);
        }
Example #9
0
        public void Test_001_amex_match()
        {
            CreditCardData card = TestCards.AmexManual(false, false);

            card.Cvn = "0101";

            Transaction response = card.Charge(10m)
                                   .WithCurrency("USD")
                                   .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("000", response.ResponseCode);
        }
Example #10
0
        public NWSGiftTests()
        {
            AcceptorConfig acceptorConfig = new AcceptorConfig();

            // data code values
            acceptorConfig.CardDataInputCapability            = CardDataInputCapability.ContactlessEmv_ContactEmv_ContactlessMsd_MagStripe_KeyEntry;
            acceptorConfig.CardHolderAuthenticationCapability = CardHolderAuthenticationCapability.PIN;
            acceptorConfig.TerminalOutputCapability           = TerminalOutputCapability.Printing_Display;
            acceptorConfig.CardDataOutputCapability           = CardDataOutputCapability.Unknown;
            acceptorConfig.PinCaptureCapability = PinCaptureCapability.Unknown;

            // hardware software config values
            acceptorConfig.HardwareLevel = "34";
            acceptorConfig.SoftwareLevel = "21205710";

            // pos configuration values
            acceptorConfig.SupportsPartialApproval            = true;
            acceptorConfig.SupportsShutOffAmount              = true;
            acceptorConfig.SupportsReturnBalance              = true;
            acceptorConfig.SupportsDiscoverNetworkReferenceId = true;
            acceptorConfig.SupportsAvsCnvVoidReferrals        = true;

            // gateway config
            NetworkGatewayConfig config = new NetworkGatewayConfig(NetworkGatewayType.NWS);

            config.ServiceUrl        = "test.txns-c.secureexchange.net";
            config.PrimaryPort       = 15031;
            config.SecondaryEndpoint = "test.txns-e.secureexchange.net";
            config.SecondaryPort     = 15031;
            config.CompanyId         = "SPSA";
            config.TerminalId        = "NWSBATCH122";
            config.AcceptorConfig    = acceptorConfig;
            config.EnableLogging     = true;
            config.StanProvider      = StanGenerator.GetInstance();
            config.BatchProvider     = BatchProvider.GetInstance();

            ServicesContainer.ConfigureService(config);

            config.MerchantType = "5542";
            ServicesContainer.ConfigureService(config, "ICR");

            config.NodeIdentification = "VLK2";
            ServicesContainer.ConfigureService(config, "ValueLink");

            // VALUE LINK
            giftCard = TestCards.ValueLinkManual();
            //giftCard = TestCards.ValueLinkSwipe();

            // SVS
            //giftCard = TestCards.SvsManual();
        }
Example #11
0
        public void Test_WFRC_010_discover_balance_return()
        {
            track = TestCards.DiscoverSwipe(EntryMethod.Swipe);

            Transaction response = track.Charge(100m)
                                   .WithCurrency("USD")
                                   .Execute();

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

            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
        }
Example #12
0
        public void Test_027_mastercard_auth()
        {
            CreditTrackData card = TestCards.MasterCardSwipe();

            Transaction response = card.Authorize(0m)
                                   .WithCurrency("USD")
                                   .WithAddress(new Address("90034"))
                                   .Execute("ICR");

            Assert.IsNotNull(response);
            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
            //Assert.AreEqual("000", response.ResponseCode);
        }
Example #13
0
        public void Test_019_amex_sale()
        {
            CreditTrackData card = TestCards.AmexSwipe();

            Transaction response = card.Authorize(0m)
                                   .WithCurrency("USD")
                                   .WithAddress(new Address("90085"))
                                   .Execute();

            Assert.IsNotNull(response);
            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
            Assert.AreEqual("000", response.ResponseCode);
        }
Example #14
0
        public void Test_002_discover_auth()
        {
            CreditCardData card = TestCards.DiscoverManual(true, true);

            Transaction response = card.Authorize(0m)
                                   .WithCurrency("USD")
                                   .WithAddress(new Address("90057"))
                                   .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("000", response.ResponseCode);
            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
        }
Example #15
0
        public void UnboardCard()
        {
            string token = TestCards.MasterCardManual().Tokenize();

            Assert.IsNotNull(token);

            var deleteCard = new CreditCardData {
                Token = token
            };

            bool success = deleteCard.DeleteToken();

            Assert.IsTrue(success);
        }
Example #16
0
        public void Test_003_discover_match()
        {
            CreditCardData card = TestCards.DiscoverManual(false, false);

            card.Cvn = "103";

            Transaction response = card.Charge(10m)
                                   .WithCurrency("USD")
                                   .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("000", response.ResponseCode);
            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
        }
Example #17
0
        public void Retail_003_CardVerifyAmex()
        {
            var address = new Address {
                PostalCode = "75024"
            };
            var manual_amex = TestCards.AmexManual(true, false);

            var response = manual_amex.Verify()
                           .WithAddress(address)
                           .WithRequestMultiUseToken(true)
                           .Execute("retail");

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Example #18
0
        public void Ecomm_003_Verify_Amex()
        {
            var address = new Address {
                PostalCode = "75024"
            };
            var card = TestCards.AmexManual();

            var response = card.Verify()
                           .WithAddress(address)
                           .WithRequestMultiUseToken(true)
                           .Execute("ecomm");

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Example #19
0
        public void Retail_016_ChargeMastercardSwipe()
        {
            var card    = TestCards.MasterCardSwipe();
            var autoSub = new AutoSubstantiation {
                VisionSubTotal = 24
            };

            var response = card.Charge(24m)
                           .WithCurrency("USD")
                           .WithAllowDuplicates(true)
                           .WithAutoSubstantiation(autoSub)
                           .Execute("retail");

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Example #20
0
        public void Test_002_amex_mismatch()
        {
            CreditCardData card = TestCards.AmexManual(false, false);

            card.Cvn = "8102";

            Transaction response = card.Authorize(10m)
                                   .WithCurrency("USD")
                                   .Execute();

            Assert.IsNotNull(response);
            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
            Assert.AreEqual("000", response.ResponseCode);
            Assert.AreEqual("N", response.CvnResponseCode);
        }
Example #21
0
        public void Ecomm_010_Charge_Master_Card()
        {
            var address = new Address {
                StreetAddress1 = "6860", PostalCode = "75024"
            };
            var card = TestCards.MasterCardManual();

            var response = card.Charge(28m)
                           .WithCurrency("USD")
                           .WithAddress(address)
                           .WithAllowDuplicates(true)
                           .Execute("ecomm");

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Example #22
0
        public void Retail_010_ChargeMasterCardManualCardPresent()
        {
            var address = new Address {
                PostalCode     = "75024",
                StreetAddress1 = "6860 Dallas Pkwy"
            };
            var manual_card = TestCards.MasterCardManual(true, true);

            var response = manual_card.Charge(28m)
                           .WithCurrency("USD")
                           .WithAddress(address)
                           .Execute("retail");

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Example #23
0
        public void Ecomm_023_Partial_Approval_Master_Card()
        {
            var address = new Address {
                StreetAddress1 = "6860", PostalCode = "75024"
            };
            var card = TestCards.MasterCardManual();

            var chargeResponse = card.Charge(145m)
                                 .WithCurrency("USD")
                                 .WithAddress(address)
                                 .WithAllowPartialAuth(true)
                                 .Execute("ecomm");

            Assert.IsNotNull(chargeResponse);
            Assert.AreEqual("10", chargeResponse.ResponseCode);
            Assert.AreEqual(65.00m, chargeResponse.AuthorizedAmount);
        }
Example #24
0
        public void Retail_014_ChargeVisaSwipe()
        {
            var card    = TestCards.VisaSwipe();
            var autoSub = new AutoSubstantiation {
                PrescriptionSubTotal = 22,
                VisionSubTotal       = 10
            };

            var response = card.Charge(32m)
                           .WithCurrency("USD")
                           .WithAllowDuplicates(true)
                           .WithAutoSubstantiation(autoSub)
                           .Execute("retail");

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Example #25
0
        public void Retail_023_ChargeMasterManualPartialApproval()
        {
            var address = new Address {
                PostalCode = "75024"
            };
            var card = TestCards.MasterCardManual(true, true);

            var response = card.Charge(155.00m)
                           .WithCurrency("USD")
                           .WithAllowPartialAuth(true)
                           .WithAddress(address)
                           .Execute("retail");

            Assert.IsNotNull(response);
            Assert.AreEqual("10", response.ResponseCode);
            Assert.AreEqual(100.00m, response.AuthorizedAmount);
        }
Example #26
0
        private Transaction DebitSale(double amount)
        {
            DebitTrackData track = TestCards.AsDebit(TestCards.VisaSwipe(), "32539F50C245A6A93D123412324000AA");

            AuthorizationBuilder builder = track.Charge(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);
            return(response);
        }
Example #27
0
        public void Test_WFRC_002_fleet_card_swipe_inside_voice_capture_1220()
        {
            CreditTrackData fleetTrack = TestCards.VoyagerFleetSwipe(EntryMethod.Swipe);

            Transaction transaction = Transaction.FromNetwork(
                10m,
                "TYPE04",
                new NtsData(FallbackCode.None, AuthorizerCode.Voice_Authorized),
                fleetTrack
                );

            ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.Heartland);

            productData.Add("01", Api.Network.Entities.UnitOfMeasure.Gallons, 1m, 10m, 10m);

            FleetData fleetData = new FleetData
            {
                //ServicePrompt = "0",
                DriverId = "11411",
                //VehicleNumber = "22031",
                OdometerReading = "1256"
            };

            Transaction response = transaction.Capture(10m)
                                   .WithCurrency("USD")
                                   .WithProductData(productData)
                                   .WithFleetData(fleetData)
                                   .WithAuthenticatioNMethod(CardHolderAuthenticationMethod.ManualSignatureVerification)
                                   .Execute();

            Assert.IsNotNull(response);

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

            Assert.IsNotNull(pmi);
            Assert.AreEqual("1220", pmi.MessageTransactionIndicator);
            Assert.AreEqual("000900", pmi.ProcessingCode);
            Assert.AreEqual("201", pmi.FunctionCode);
            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
            // check response
            Assert.AreEqual("000", response.ResponseCode);
        }
Example #28
0
        public void Retail_022_ChargeDiscoverSwipePartialApproval()
        {
            var card = TestCards.DiscoverSwipe();

            var response = card.Charge(130.00m)
                           .WithCurrency("USD")
                           .WithAllowPartialAuth(true)
                           .Execute("retail");

            Assert.IsNotNull(response);
            Assert.AreEqual("10", response.ResponseCode);
            Assert.AreEqual(110.00m, response.AuthorizedAmount);

            // test case 28
            var reversal = response.Reverse(110.00m).Execute("retail");

            Assert.IsNotNull(reversal);
            Assert.AreEqual("00", reversal.ResponseCode);
        }
Example #29
0
        private Transaction CreditReturn(decimal amount, bool useExpiredCard = false)
        {
            CreditTrackData track = useExpiredCard ? TestCards.VisaSwipeExpired() : TestCards.VisaSwipe();

            AuthorizationBuilder builder = track.Refund(amount)
                                           .WithCurrency("USD");

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

            Transaction response = builder.Execute(configName);

            Assert.IsNotNull(response);
            System.Diagnostics.Debug.WriteLine("Return:");
            System.Diagnostics.Debug.WriteLine(response.HostResponseDate);
            System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber);
            return(response);
        }
Example #30
0
        public void Ecomm_012_Charge_Visa()
        {
            var address = new Address {
                StreetAddress1 = "6860", PostalCode = "75024"
            };
            var autoSub = new AutoSubstantiation {
                VisionSubTotal = 21
            };
            var card = TestCards.VisaManual();

            var response = card.Charge(21m)
                           .WithCurrency("USD")
                           .WithAddress(address)
                           .WithAllowDuplicates(true)
                           .WithAutoSubstantiation(autoSub)
                           .Execute("ecomm");

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }