示例#1
0
        //Third party Merchant
        internal static Transaction CreateTransaction(bool capture, string tokenId = null, bool createToken = false)
        {
            var result = new Transaction {
                Capture = capture, SaveCustomer = createToken
            };
            var cardDetails = new CardDetails()
            {
                Name = "John Smith", Number = "4444333322221111", ExpiryMonth = "12", ExpiryYear = "25", CVN = "123"
            };
            var address = new Address()
            {
                Street1    = "Level 5",
                Street2    = "369 Queen Street",
                City       = "Sydney",
                State      = "NSW",
                Country    = "au",
                PostalCode = "2000",
            };

            result.Customer = new Customer()
            {
                Reference       = "A12345",
                Title           = "Mr.",
                FirstName       = "John",
                LastName        = "Smith",
                CompanyName     = "Demo Shop 123",
                JobDescription  = "Developer",
                Phone           = "09 889 0986",
                Mobile          = "09 889 6542",
                Email           = "*****@*****.**",
                Url             = "http://www.ewaypayments.com",
                CardDetails     = cardDetails,
                Address         = address,
                Comments        = "",
                Fax             = "",
                TokenCustomerID = tokenId
            };

            var shippingAddress = new Address()
            {
                Street1    = "Level 5",
                Street2    = "369 Queen Street",
                City       = "Sydney",
                State      = "NSW",
                Country    = "au",
                PostalCode = "2000"
            };

            result.ShippingDetails = new ShippingDetails()
            {
                ShippingAddress = shippingAddress,
                ShippingMethod  = ShippingMethod.NextDay,
                Email           = "*****@*****.**",
                Fax             = "",
                FirstName       = "John",
                LastName        = "Smith",
                Phone           = "09 889 0986"
            };

            result.LineItems = new[]
            {
                new LineItem()
                {
                    SKU         = "12345678901234567890",
                    Description = "Item Description 1",
                    Quantity    = 1,
                    UnitCost    = 400
                },
                new LineItem()
                {
                    SKU         = "123456789012",
                    Description = "Item Description 2",
                    Quantity    = 1,
                    UnitCost    = 400,
                }
            }.ToList();

            result.Options        = new[] { "Option1", "Option2" }.ToList();
            result.PaymentDetails = new PaymentDetails()
            {
                TotalAmount        = 1000,
                InvoiceNumber      = "Inv 21540",
                InvoiceDescription = "Individual Invoice Description",
                InvoiceReference   = "513456",
                CurrencyCode       = "AUD"
            };

            result.TransactionType = TransactionTypes.Purchase;
            result.RedirectURL     = "http://www.eway.com.au";
            result.DeviceID        = "D1234";
            result.PartnerID       = "ID";
            result.CustomerIP      = "127.0.0.1";
            return(result);
        }
示例#2
0
        //Third party Merchant
        internal static Transaction CreateTransaction(bool capture, string tokenId = null)
        {
            var result = new Transaction { Capture = capture };
            var cardDetails = new CardDetails() { Name = "John Smith", Number = "4444333322221111", ExpiryMonth = "12", ExpiryYear = "25", CVN = "123" };
            var address = new Address()
            {
                Street1 = "Level 5",
                Street2 = "369 Queen Street",
                City = "Sydney",
                State = "NSW",
                Country = "au",
                PostalCode = "2000",
            };
            result.Customer = new Customer()
            {
                Reference = "A12345",
                Title = "Mr.",
                FirstName = "John",
                LastName = "Smith",
                CompanyName = "Demo Shop 123",
                JobDescription = "Developer",
                Phone = "09 889 0986",
                Mobile = "09 889 6542",
                Email = "*****@*****.**",
                Url = "http://www.ewaypayments.com",
                CardDetails = cardDetails,
                Address = address,
                Comments = "",
                Fax = "",
                TokenCustomerID = tokenId
            };

            var shippingAddress = new Address()
            {
                Street1 = "Level 5",
                Street2 = "369 Queen Street",
                City = "Sydney",
                State = "NSW",
                Country = "au",
                PostalCode = "2000"
            };

            result.ShippingDetails = new ShippingDetails()
            {
                ShippingAddress = shippingAddress,
                ShippingMethod = ShippingMethod.NextDay,
                Email = "*****@*****.**",
                Fax = "",
                FirstName = "John",
                LastName = "Smith",
                Phone = "09 889 0986"
            };

            result.LineItems = new[]
            {
                new LineItem()
                {
                    SKU = "12345678901234567890",
                    Description = "Item Description 1",
                    Quantity = 1,
                    UnitCost = 400
                },
                new LineItem()
                {
                    SKU = "123456789012",
                    Description = "Item Description 2",
                    Quantity = 1,
                    UnitCost = 400,
                }
            }.ToList();

            result.Options = new[] { "Option1", "Option2" }.ToList();
            result.PaymentDetails = new PaymentDetails()
            {
                TotalAmount = 1000,
                InvoiceNumber = "Inv 21540",
                InvoiceDescription = "Individual Invoice Description",
                InvoiceReference = "513456",
                CurrencyCode = "AUD"
            };

            result.TransactionType = TransactionTypes.Purchase;
            result.RedirectURL = "http://www.eway.com.au";
            result.DeviceID = "D1234";
            result.PartnerID = "ID";
            result.CustomerIP = "127.0.0.1";
            return result;
        }