public void test_wex_emv_4847_V412_ON_I_WX4_1200_2() { CreditTrackData card = new CreditTrackData(); card.Value = "6900460420006149231=27121004847120001"; FleetData fleetData = new FleetData() { VehicleNumber = "123450", OdometerReading = "123450" }; ProductData productData = new ProductData(ServiceLevel.Other_NonFuel, ProductCodeSet.Conexxus_3_Digit); productData.Add("001", UnitOfMeasure.Gallons, 10.720m, 4.664m, 50m); Transaction response = card.Charge(10m) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .WithTagData("4F07A0000007681010820239008407A00000076810108A025A33950500800080009A032106039B02E8009C01005F24032212315F280208405F2A0208405F3401029F02060000000001009F03060000000000009F0607A00000076810109F07023D009F080201539F090200019F0D05BC308088009F1A0208409F0E0500400000009F0F05BCB08098009F10200FA502A830B9000000000000000000000F0102000000000000000000000000009F2103E800259F2608DD53340458AD69B59F2701809F34031E03009F3501169F3303E0F8C89F360200019F37045876B0989F3901009F4005F000F0A0019F410400000000") .Execute(); Assert.IsNotNull(response); System.Diagnostics.Debug.WriteLine(response.HostResponseDate); System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber); Assert.AreEqual("000", response.ResponseCode); }
public void test_5135_V412_ON_I_WX4_1100() { CreditTrackData card = new CreditTrackData(); card.Value = ";6900460420006149231=18011005135120000?"; FleetData fleetData = new FleetData(); //fleetData.ServicePrompt = "0"; fleetData.OdometerReading = "9876"; fleetData.DriverId = "1234"; //fleetData.VehicleNumber = "22021"; ProductData productData = new ProductData(ServiceLevel.SelfServe, ProductCodeSet.Conexxus_3_Digit); productData.Add("074", UnitOfMeasure.Units, 1m, 10m, 10m); Transaction response = card.Authorize(1m, true) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .WithTagData("4F07A0000007681010820239008407A00000076810108A025A33950500800080009A032106039B02E8009C01005F280208405F2A0208405F3401029F02060000000001009F03060000000000009F0607A00000076810109F07023D009F080201539F090200019F0D05BC308088009F1A0208409F0E0500400000009F0F05BCB08098009F10200FA502A830B9000000000000000000000F0102000000000000000000000000009F2103E800259F2608DD53340458AD69B59F2701809F34031E03009F3501169F3303E0F8C89F360200019F37045876B0989F3901009F4005F000F0A0019F410400000000") .Execute(); Assert.IsNotNull(response); System.Diagnostics.Debug.WriteLine(response.HostResponseDate); System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber); Assert.AreEqual("000", response.ResponseCode); }
public void Test_003_swipe_refund() { ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.Heartland); productData.Add("01", UnitOfMeasure.Gallons, 2m, 5m, 10m); Transaction response = track.Refund(10m) .WithCurrency("USD") .WithFleetData(fleetData) .WithProductData(productData) .Execute(); Assert.IsNotNull(response); // check message data PriorMessageInformation pmi = response.MessageInformation; Assert.IsNotNull(pmi); Assert.AreEqual("1220", pmi.MessageTransactionIndicator); Assert.AreEqual("200009", pmi.ProcessingCode); Assert.AreEqual("200", pmi.FunctionCode); System.Diagnostics.Debug.WriteLine(response.HostResponseDate); System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber); // check response Assert.AreEqual("000", response.ResponseCode); }
private void AddIncrementEventByID(int eventType, int movieID) { var productDataFound = ProductData.Find(movieID); if (productDataFound == null) { if (eventType == 0) { ProductData.Add(new ProductEvent { LocatorID = movieID, TotalSearchCount = 1 }); } if (eventType == 1) { ProductData.Add(new ProductEvent { LocatorID = movieID, TotalRentalCount = 1 }); } } else { if (eventType == 0) { productDataFound.TotalSearchCount++; } if (eventType == 1) { productDataFound.TotalRentalCount++; } } }
public void Test_005_swipe_voice_capture() { Transaction transaction = Transaction.FromNetwork( 10m, "TYPE04", new NtsData(FallbackCode.None, AuthorizerCode.Voice_Authorized), track ); ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.Heartland); productData.Add("01", UnitOfMeasure.Gallons, 2m, 5m, 10m); 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); }
public void Test_014_swipe_sale_voyager_product_14() { ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.IssuerSpecific); productData.Add("14", UnitOfMeasure.Units, 1m, 100m, 100m); Transaction response = track.Charge(100m) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .Execute(); Assert.IsNotNull(response); // check message data PriorMessageInformation pmi = response.MessageInformation; Assert.IsNotNull(pmi); Assert.AreEqual("1200", pmi.MessageTransactionIndicator); Assert.AreEqual("000900", pmi.ProcessingCode); Assert.AreEqual("200", pmi.FunctionCode); // check response Assert.AreEqual("000", response.ResponseCode); }
private async Task <AddProductResponce> GetProduct(int receiptID) { JsonValue GetProductResponce = await HttpRequestHelper <String> .GetRequest(ServiceTypes.GetProducts, SessionHelper.AccessToken + "/" + receiptID); AddProductResponce getProductResponse = JsonConvert.DeserializeObject <AddProductResponce>(GetProductResponce.ToString()); if (getProductResponse.IsSuccess) { ListGetProduct = getProductResponse.Lstproducts.Select(dc => new QueuedOrderProductsModal() { AddedOn = dc.AddedOn, IsAvailable = dc.IsAvailable, Name = dc.Name, Price = dc.Price, ProductID = dc.ProductID, Quantity = dc.Quantity, RecieptID = dc.RecieptID, UpdatedOn = dc.UpdatedOn, Total = 0 }).ToList(); foreach (QueuedOrderProductsModal getProduct in lstGetProduct) { ProductData.Add(getProduct); } } else { } return(getProductResponse); }
public void Test_021_EMV_sale() { CreditCardData card = TestCards.MasterCardFleetManual(true, true); CreditTrackData track = TestCards.AmexSwipe(); track.Value = ";374245002741006=241222117101234500000?"; //track.Value = ";5567630000088409=49126010793608000024?"; //MTip40 Test 01 Scenario 01 track.PinBlock = "62968D2481D231E1A504010024A00014"; FleetData fleetData = new FleetData { //ServicePrompt = "0", //DriverId = "11411", VehicleNumber = "987654", OdometerReading = "123456" }; ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.Heartland); productData.Add("01", Api.Network.Entities.UnitOfMeasure.Gallons, 4m, 5m, 20m); Transaction response = track.Charge(31m) .WithCurrency("USD") //.WithFleetData(fleetData) //.WithProductData(productData) .WithTagData("4F07A0000001523010500A4D617374657243617264820238008407A00000015230108E0A00000000000000001F00950500008080009A031901099B02E8009C01405F24032212315F25030401015F2A0208405F300202015F3401009F01060000000000019F02060000000006009F03060000000000009F0607A00000015230109F0702FF009F090200029F0D05B8508000009F0E0500000000009F0F05B8708098009F10080105A000030000009F120A4D6173746572436172649F160F3132333435363738393031323334359F1A0208409F1C0831313232333334349F1E0831323334353637389F21030710109F26080631450565A30B759F2701809F330360F0C89F34033F00019F3501219F360200049F3704C6B1A04F9F3901059F4005F000A0B0019F4104000000869F4C0865C862608A23945A9F4E0D54657374204D65726368616E74") .Execute(); Assert.IsNotNull(response); System.Diagnostics.Debug.WriteLine(response.HostResponseDate); System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber); Assert.AreEqual("000", response.ResponseCode); }
public void SaveProduct(Product product) { product.CreateCheckPoint(); var keyToRemove = product.CheckPointHistory.Last().Key; // cloning the object to separate it from the original - thereby simulating a real-life data insertion var clone = (Product)product.CurrentCheckPoint; if (product.Id == null) { var values = ProductData.Values; clone.Id = values.Count == 0 ? 1 : values.Max(o => o.Id.GetValueOrDefault()) + 1; } try { ProductData.Add(clone.Id.GetValueOrDefault(), clone); } catch (ArgumentException) { throw new DuplicateEntityKeyException("duplicate key insertion not allowed", clone.Id); } product.Id = clone.Id; //get rid of checkpoint product.CheckPointHistory.Remove(keyToRemove); }
public void Test_025_swipe_sale_mc_product_99() { ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.IssuerSpecific); productData.Add("99", UnitOfMeasure.OtherOrUnknown, 1m, 10m, 10m); Transaction response = track.Charge(10m) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .Execute(); Assert.IsNotNull(response); // check message data PriorMessageInformation pmi = response.MessageInformation; Assert.IsNotNull(pmi); Assert.AreEqual("1200", pmi.MessageTransactionIndicator); Assert.AreEqual("000900", pmi.ProcessingCode); Assert.AreEqual("200", pmi.FunctionCode); System.Diagnostics.Debug.WriteLine(response.HostResponseDate); System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber); // check response Assert.AreEqual("000", response.ResponseCode); }
public void Test_026_swipe_sale_product_all() { track = TestCards.VisaFleetSwipe(); ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.IssuerSpecific); productData.Add("01", UnitOfMeasure.Gallons, 1m, 10m, 10m); productData.Add("03", UnitOfMeasure.Gallons, 2m, 10m, 20m); productData.Add("79", UnitOfMeasure.Quarts, 4m, 10m, 40m); productData.Add("45", UnitOfMeasure.Gallons, 1m, 10m, 10m); productData.Add("41", UnitOfMeasure.Gallons, 5m, 10m, 50m); productData.Add("99", UnitOfMeasure.Gallons, 2m, 15m, 30m); Transaction response = track.Charge(160m) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .Execute(); Assert.IsNotNull(response); // check message data PriorMessageInformation pmi = response.MessageInformation; Assert.IsNotNull(pmi); Assert.AreEqual("1200", pmi.MessageTransactionIndicator); Assert.AreEqual("000900", pmi.ProcessingCode); Assert.AreEqual("200", pmi.FunctionCode); System.Diagnostics.Debug.WriteLine(response.HostResponseDate); System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber); // check response Assert.AreEqual("000", response.ResponseCode); }
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); }
public void test_5136_V412_ON_I_WX4_1220_5() { CreditTrackData card = new CreditTrackData(); card.Value = "7071380420006149231=27121005136120009"; FleetData fleetData = new FleetData() { OdometerReading = "123450", DriverId = "123450", JobNumber = "1234" }; ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.Conexxus_3_Digit); productData.Add("001", UnitOfMeasure.Units, 1m, 10.00m, 10m); Transaction response = card.Authorize(10m) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .WithTagData("4F07A0000007681010820239008407A00000076810108A025A33950500800080009A032106039B02E8009C01005F280208405F2A0208405F3401029F02060000000001009F03060000000000009F0607A00000076810109F07023D009F080201539F090200019F0D05BC308088009F1A0208409F0E0500400000009F0F05BCB08098009F10200FA502A830B9000000000000000000000F0102000000000000000000000000009F2103E800259F2608DD53340458AD69B59F2701809F34031E03009F3501169F3303E0F8C89F360200019F37045876B0989F3901009F4005F000F0A0019F410400000000") .Execute(); Assert.IsNotNull(response); System.Diagnostics.Debug.WriteLine(response.HostResponseDate); System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber); //Assert.AreEqual("000", response.ResponseCode); Transaction captureResponse = response.Capture(45m) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .WithTagData("4F07A0000007681010820239008407A00000076810108A025A33950500800080009A032106039B02E8009C01005F280208405F2A0208405F3401029F02060000000001009F03060000000000009F0607A00000076810109F07023D009F080201539F090200019F0D05BC308088009F1A0208409F0E0500400000009F0F05BCB08098009F10200FA502A830B9000000000000000000000F0102000000000000000000000000009F2103E800259F2608DD53340458AD69B59F2701809F34031E03009F3501169F3303E0F8C89F360200019F37045876B0989F3901009F4005F000F0A0019F410400000000") .Execute(); Assert.IsNotNull(captureResponse); System.Diagnostics.Debug.WriteLine(captureResponse.HostResponseDate); System.Diagnostics.Debug.WriteLine(captureResponse.SystemTraceAuditNumber); // check response //Assert.AreEqual("400", captureResponse.ResponseCode); }
public void Test_001_amex_x416() { CreditTrackData track = TestCards.AmexSwipe(); // Product Data ProductData productData = new ProductData(ServiceLevel.SelfServe); productData.Add( ProductCode.Unleaded_Premium_Gas, Api.Network.Entities.UnitOfMeasure.Gallons, 2.64m, 1.429m, 3.77m ); Transaction response = track.Charge(10m) .WithCurrency("USD") .WithProductData(productData) .Execute(); Assert.IsNotNull(response); Assert.AreEqual("000", response.ResponseCode); }
public void Test_015_visa_fleet_match() { CreditCardData card = TestCards.VisaManual(false, false); card.Cvn = "110"; ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.Heartland); productData.Add(ProductCode.Unleaded_Gas, UnitOfMeasure.Gallons, 1, 10); FleetData fleetData = new FleetData(); fleetData.ServicePrompt = "00"; Transaction response = card.Charge(10m) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .Execute(); Assert.IsNotNull(response); Assert.AreEqual("000", response.ResponseCode); }
public void Test_012_swipe_sale_voyager_product_04() { ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.IssuerSpecific); productData.Add("01", UnitOfMeasure.Gallons, 1m, 24m, 24m); productData.Add("59", UnitOfMeasure.Pounds, 1m, 10m, 10m); productData.Add("09", UnitOfMeasure.Quarts, 1m, 5m, 5m); productData.Add("27", UnitOfMeasure.Units, 1m, 6m, 6m); productData.Add("23", UnitOfMeasure.Units, 1m, 50m, 50m); productData.Add("14", UnitOfMeasure.Pounds, 1m, 3m, 3m); productData.Add("33", UnitOfMeasure.OtherOrUnknown, 1m, 2m, 2m); fleetData = new FleetData() { VehicleNumber = "22031", DriverId = "11411", OdometerReading = "1256" }; Transaction response = track.Charge(100m) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .Execute(); Assert.IsNotNull(response); // check message data PriorMessageInformation pmi = response.MessageInformation; Assert.IsNotNull(pmi); Assert.AreEqual("1200", pmi.MessageTransactionIndicator); Assert.AreEqual("000900", pmi.ProcessingCode); Assert.AreEqual("200", pmi.FunctionCode); System.Diagnostics.Debug.WriteLine(response.HostResponseDate); System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber); // check response Assert.AreEqual("000", response.ResponseCode); }
public void Test_006_swipe_void() { ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.Heartland); productData.Add("01", UnitOfMeasure.Gallons, 2m, 5m, 10m); Transaction sale = track.Charge(10m) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .Execute(); Assert.IsNotNull(sale); Assert.AreEqual("000", sale.ResponseCode); //Assert.IsNotNull(sale.ReferenceNumber); Transaction response = sale.Void(amount: sale.AuthorizedAmount) .WithReferenceNumber("12345") .WithAuthenticatioNMethod(CardHolderAuthenticationMethod.ManualSignatureVerification) .Execute(); Assert.IsNotNull(response); // check message data PriorMessageInformation pmi = response.MessageInformation; Assert.IsNotNull(pmi); Assert.AreEqual("1420", pmi.MessageTransactionIndicator); Assert.AreEqual("000900", pmi.ProcessingCode); Assert.AreEqual("441", pmi.FunctionCode); Assert.AreEqual("4351", pmi.MessageReasonCode); System.Diagnostics.Debug.WriteLine(response.HostResponseDate); System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber); // check response Assert.AreEqual("400", response.ResponseCode); }
public void Add(Product product) { manager.Add(product); }
public NWSFleetTests() { AcceptorConfig acceptorConfig = new AcceptorConfig { // data code values CardDataInputCapability = CardDataInputCapability.ContactlessEmv_ContactEmv_MagStripe_KeyEntry, TerminalOutputCapability = TerminalOutputCapability.Printing_Display, CardHolderAuthenticationEntity = CardHolderAuthenticationEntity.ByMerchant, //OperatingEnvironment = OperatingEnvironment.OnPremises_CardAcceptor_Unattended, // hardware software config values HardwareLevel = "34", SoftwareLevel = "21205710", // pos configuration values SupportsPartialApproval = true, SupportsShutOffAmount = true, SupportsReturnBalance = true, SupportsDiscoverNetworkReferenceId = true, SupportsAvsCnvVoidReferrals = true, SupportedEncryptionType = EncryptionType.TEP2 }; // gateway config NetworkGatewayConfig config = new NetworkGatewayConfig(NetworkGatewayType.NWS) { ServiceUrl = "test.txns-c.secureexchange.net", PrimaryPort = 15031, SecondaryEndpoint = "test.txns-e.secureexchange.net", SecondaryPort = 15031, CompanyId = "SPSA", TerminalId = "NWSDOTNET02", UniqueDeviceId = "0001", AcceptorConfig = acceptorConfig, EnableLogging = true, StanProvider = StanGenerator.GetInstance(), BatchProvider = BatchProvider.GetInstance() }; ServicesContainer.ConfigureService(config); config.MerchantType = "5542"; ServicesContainer.ConfigureService(config, "ICR"); // MASTERCARD FLEET card = TestCards.MasterCardFleetManual(true, true); track = TestCards.MasterCardFleetSwipe(); productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.Heartland); productData.Add("03", UnitOfMeasure.Gallons, 1, 10); // VOYAGER FLEET //card = TestCards.VoyagerManual(true, true); //track = TestCards.VoyagerSwipe(); fleetData = new FleetData { ServicePrompt = "0", //fleetData.DriverId = "5500"; //fleetData.VehicleNumber = "1111"; OdometerReading = "1256" }; // VISA //card = TestCards.VisaFleetManual(true, true); //track = TestCards.VisaFleetSwipe(); //productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.Heartland); //productData.Add("01", UnitOfMeasure.Gallons, 1, 10); //FleetOne //card = TestCards.FleetOneManual(true, true); //track = TestCards.FleetOneSwipe(); }
public Product Add(Product obj) { return(db.Add(obj)); }
public void Test_008_ICR_authorization() { ProductData productData = new ProductData(ServiceLevel.FullServe, ProductCodeSet.IssuerSpecific); productData.Add("01", UnitOfMeasure.Gallons, 1, 2.999); Transaction response = track.Authorize(2.999m, true) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .Execute(); Assert.IsNotNull(response); // check message data PriorMessageInformation pmi = response.MessageInformation; Assert.IsNotNull(pmi); Assert.AreEqual("1100", pmi.MessageTransactionIndicator); Assert.AreEqual("000900", pmi.ProcessingCode); Assert.AreEqual("101", pmi.FunctionCode); System.Diagnostics.Debug.WriteLine(response.HostResponseDate); System.Diagnostics.Debug.WriteLine(response.SystemTraceAuditNumber); // check response Assert.AreEqual("000", response.ResponseCode); // partial approval cancellation //Transaction reversal = response.Cancel() // .WithReferenceNumber(response.ReferenceNumber) // .Execute(); //Assert.IsNotNull(reversal); //pmi = reversal.MessageInformation; //Assert.AreEqual("1420", pmi.MessageTransactionIndicator); //Assert.AreEqual("000900", pmi.ProcessingCode); //Assert.AreEqual("441", pmi.FunctionCode); //Assert.AreEqual("4352", pmi.MessageReasonCode); //Assert.AreEqual("400", reversal.ResponseCode); //System.Diagnostics.Debug.WriteLine(reversal.HostResponseDate); //System.Diagnostics.Debug.WriteLine(reversal.SystemTraceAuditNumber); // Test_009 Transaction captureResponse = response.Capture(response.AuthorizedAmount) .WithCurrency("USD") .WithProductData(productData) .WithFleetData(fleetData) .Execute(); Assert.IsNotNull(captureResponse); // check message data pmi = captureResponse.MessageInformation; Assert.IsNotNull(pmi); Assert.AreEqual("1220", pmi.MessageTransactionIndicator); Assert.AreEqual("000900", pmi.ProcessingCode); Assert.AreEqual("202", pmi.FunctionCode); // check response Assert.AreEqual("000", captureResponse.ResponseCode); }