コード例 #1
0
        public void Test_019_MasterCard_Level3_Sale()
        {
            var commercialData = new CommercialData(TaxType.NOTUSED)
            {
                PoNumber = "9876543210"
            };

            commercialData.AddLineItems(
                new CommercialLineItem {
                CommodityCode = "030",
                Description   = "Misc Good",
                UPC           = "012345678901",
                Quantity      = 5.1m,
                UnitOfMeasure = "lbs",
                UnitCost      = 0.6m,
                //DiscountAmount = 0.61m,
                TotalAmount          = 0.62m,
                TaxAmount            = 0.63m,
                ExtendedAmount       = 0.64m,
                CreditDebitIndicator = CreditDebitIndicator.Credit,
                NetGrossIndicator    = NetGrossIndicator.Gross
            }
                );

            Transaction response = MasterCardManual.Charge(0.52m)
                                   .WithCurrency("USD")
                                   .WithCommercialData(commercialData)
                                   .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
コード例 #2
0
        public void Sale_Level3()
        {
            var commercialData = new CommercialData(TaxType.SALESTAX, CommercialIndicator.Level_III)
            {
                Description            = "Misc Goods",
                DiscountAmount         = 1.01m,
                FreightAmount          = 1.02m,
                DutyAmount             = 1.03m,
                DestinationPostalCode  = "06033",
                DestinationCountryCode = "840",
                OriginPostalCode       = "01887",
                PoNumber  = "17801",
                TaxAmount = 0m
            };

            commercialData.AddLineItems(
                new CommercialLineItem {
                CommodityCode        = "030",
                Description          = "Misc Good",
                UPC                  = "012345678901",
                Quantity             = 5.1m,
                UnitOfMeasure        = "lbs",
                UnitCost             = 0.6m,
                DiscountAmount       = 0.61m,
                TotalAmount          = 0.62m,
                TaxAmount            = 0.63m,
                ExtendedAmount       = 0.64m,
                CreditDebitIndicator = CreditDebitIndicator.Credit,
                NetGrossIndicator    = NetGrossIndicator.Gross
            },
                new CommercialLineItem {
                CommodityCode        = "031",
                Description          = "Misc Good2",
                UPC                  = "012345678901",
                Quantity             = 5.1m,
                UnitOfMeasure        = "lbs",
                UnitCost             = 0.6m,
                DiscountAmount       = 0.61m,
                TotalAmount          = 0.62m,
                TaxAmount            = 0.63m,
                ExtendedAmount       = 0.64m,
                CreditDebitIndicator = CreditDebitIndicator.Credit,
                NetGrossIndicator    = NetGrossIndicator.Gross
            }
                );

            var response = card.Charge(1.05m)
                           .WithCurrency("USD")
                           .WithAddress(address)
                           .WithInvoiceNumber("1556")
                           .WithCommercialData(commercialData)
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
コード例 #3
0
        public void Test_019_MasterCard_Level3_Sale()
        {
            Logger.AppendText("\r\nTest_019_MasterCard_Level3_Sale");

            var commercialData = new CommercialData(TaxType.NOTUSED, CommercialIndicator.Level_III)
            {
                PoNumber               = "9876543210",
                TaxAmount              = 0.01m,
                DestinationPostalCode  = "85212",
                DestinationCountryCode = "USA",
                OriginPostalCode       = "22193",
                SummaryCommodityCode   = "SCC",
                CustomerVAT_Number     = "123456789",
                VAT_InvoiceNumber      = "UVATREF162",
                OrderDate              = DateTime.Now,
                FreightAmount          = 0.01m,
                DutyAmount             = 0.01m,
                AdditionalTaxDetails   = new AdditionalTaxDetails {
                    TaxType     = "VAT",
                    TaxAmount   = 0.01m,
                    TaxRate     = 0.04m,
                    TaxCategory = TaxCategory.VAT
                }
            };

            commercialData.AddLineItems(
                new CommercialLineItem {
                ProductCode          = "PRDCD1",
                Name                 = "PRDCD1NAME",
                UnitCost             = 0.01m,
                Quantity             = 1m,
                UnitOfMeasure        = "METER",
                Description          = "PRODUCT 1 NOTES",
                CommodityCode        = "12DIGIT ACCO",
                AlternateTaxId       = "1234567890",
                CreditDebitIndicator = CreditDebitIndicator.Credit,
                DiscountDetails      = new DiscountDetails {
                    DiscountName       = "Indep Sale 1",
                    DiscountAmount     = 0.50m,
                    DiscountPercentage = 0.10m,
                    DiscountType       = "SALE"
                }
            }
                );

            Response = MasterCardManual.Charge(0.53m)
                       .WithCurrency("USD")
                       .WithCommercialData(commercialData)
                       .WithClientTransactionId(ClientTransactionId)
                       .WithAddress(Address)
                       .Execute();
        }
コード例 #4
0
        public void MasterCard_Level3_Sale()
        {
            var commercialData = new CommercialData(TaxType.SALESTAX, CommercialIndicator.Level_III)
            {
                PoNumber               = "9876543210",
                TaxAmount              = 0.01m,
                DestinationPostalCode  = "85212",
                DestinationCountryCode = "USA",
                OriginPostalCode       = "22193",
                SummaryCommodityCode   = "SCC",
                VAT_InvoiceNumber      = "UVATREF162",
                OrderDate              = DateTime.Now,
                FreightAmount          = 0.01m,
                DutyAmount             = 0.01m,
                AdditionalTaxDetails   = new AdditionalTaxDetails {
                    TaxAmount = 0.01m,
                    TaxRate   = 0.04m,
                }
            };

            commercialData.AddLineItems(
                new CommercialLineItem {
                ProductCode   = "PRDCD1",
                UnitCost      = 0.01m,
                Quantity      = 1m,
                UnitOfMeasure = "METER",
                Description   = "PRODUCT 1 NOTES",
                // CommodityCode = "12DIGIT ACCO",
                DiscountDetails = new DiscountDetails {
                    DiscountAmount = 0.50m
                }
            }
                );

            var response = MasterCardManual.Charge(0.53m)
                           .WithCurrency("USD")
                           .WithCommercialRequest(true)
                           .WithClientTransactionId(ClientTransactionId)
                           .WithAddress(Address)
                           .Execute();

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

            var edit = response.Edit()
                       .WithCommercialData(commercialData)
                       .Execute();

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