示例#1
0
        public static Tmsv2customersEmbeddedDefaultShippingAddress Run()
        {
            string customerTokenId          = "AB695DA801DD1BB6E05341588E0A3BDC";
            bool   _default                 = false;
            string shipToFirstName          = "John";
            string shipToLastName           = "Doe";
            string shipToCompany            = "CyberSource";
            string shipToAddress1           = "1 Market St";
            string shipToLocality           = "San Francisco";
            string shipToAdministrativeArea = "CA";
            string shipToPostalCode         = "94105";
            string shipToCountry            = "US";
            string shipToEmail              = "*****@*****.**";
            string shipToPhoneNumber        = "4158880000";
            Tmsv2customersEmbeddedDefaultShippingAddressShipTo shipTo = new Tmsv2customersEmbeddedDefaultShippingAddressShipTo(
                FirstName: shipToFirstName,
                LastName: shipToLastName,
                Company: shipToCompany,
                Address1: shipToAddress1,
                Locality: shipToLocality,
                AdministrativeArea: shipToAdministrativeArea,
                PostalCode: shipToPostalCode,
                Country: shipToCountry,
                Email: shipToEmail,
                PhoneNumber: shipToPhoneNumber
                );

            var requestObj = new PostCustomerShippingAddressRequest(
                _Default: _default,
                ShipTo: shipTo
                );

            try
            {
                var configDictionary = new Configuration().GetConfiguration();
                var clientConfig     = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);

                var apiInstance = new CustomerShippingAddressApi(clientConfig);
                Tmsv2customersEmbeddedDefaultShippingAddress result = apiInstance.PostCustomerShippingAddress(customerTokenId, requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
        public static void Run()
        {
            string customerTokenId        = "AB695DA801DD1BB6E05341588E0A3BDC";
            string shippingAddressTokenId = CreateCustomerNonDefaultShippingAddress.Run().Id;

            try
            {
                var configDictionary = new Configuration().GetConfiguration();
                var clientConfig     = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);

                var apiInstance = new CustomerShippingAddressApi(clientConfig);
                apiInstance.DeleteCustomerShippingAddress(customerTokenId, shippingAddressTokenId);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
            }
        }
示例#3
0
        public static Tmsv2customersEmbeddedDefaultShippingAddress Run()
        {
            string customerTokenId        = "AB695DA801DD1BB6E05341588E0A3BDC";
            string shippingAddressTokenId = "AB6A54B97C00FCB6E05341588E0A3935";

            try
            {
                var configDictionary = new Configuration().GetConfiguration();
                var clientConfig     = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);

                var apiInstance = new CustomerShippingAddressApi(clientConfig);
                Tmsv2customersEmbeddedDefaultShippingAddress result = apiInstance.GetCustomerShippingAddress(customerTokenId, shippingAddressTokenId);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
示例#4
0
        public static ShippingAddressListForCustomer Run()
        {
            string customerTokenId = "AB695DA801DD1BB6E05341588E0A3BDC";
            string profileid       = null;
            long?  offset          = (long?)null;
            long?  limit           = (long?)null;

            try
            {
                var configDictionary = new Configuration().GetConfiguration();
                var clientConfig     = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);

                var apiInstance = new CustomerShippingAddressApi(clientConfig);
                ShippingAddressListForCustomer result = apiInstance.GetCustomerShippingAddressesList(customerTokenId, profileid, offset, limit);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
示例#5
0
 public void Init()
 {
     instance = new CustomerShippingAddressApi();
 }