public static TmsV2CustomersResponse Run() { string customerTokenId = "AB695DA801DD1BB6E05341588E0A3BDC"; string defaultShippingAddressId = "AB6A54B97C00FCB6E05341588E0A3935"; Tmsv2customersDefaultShippingAddress defaultShippingAddress = new Tmsv2customersDefaultShippingAddress( Id: defaultShippingAddressId ); var requestObj = new PatchCustomerRequest( DefaultShippingAddress: defaultShippingAddress ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new CustomerApi(clientConfig); TmsV2CustomersResponse result = apiInstance.PatchCustomer(customerTokenId, requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static TmsV2CustomersResponse Run() { string customerTokenId = "AB695DA801DD1BB6E05341588E0A3BDC"; string buyerInformationMerchantCustomerID = "Your customer identifier"; string buyerInformationEmail = "*****@*****.**"; Tmsv2customersBuyerInformation buyerInformation = new Tmsv2customersBuyerInformation( MerchantCustomerID: buyerInformationMerchantCustomerID, Email: buyerInformationEmail ); string clientReferenceInformationCode = "TC50171_3"; Tmsv2customersClientReferenceInformation clientReferenceInformation = new Tmsv2customersClientReferenceInformation( Code: clientReferenceInformationCode ); List <Tmsv2customersMerchantDefinedInformation> merchantDefinedInformation = new List <Tmsv2customersMerchantDefinedInformation>(); string merchantDefinedInformationName1 = "data1"; string merchantDefinedInformationValue1 = "Your customer data"; merchantDefinedInformation.Add(new Tmsv2customersMerchantDefinedInformation( Name: merchantDefinedInformationName1, Value: merchantDefinedInformationValue1 )); var requestObj = new PatchCustomerRequest( BuyerInformation: buyerInformation, ClientReferenceInformation: clientReferenceInformation, MerchantDefinedInformation: merchantDefinedInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new CustomerApi(clientConfig); TmsV2CustomersResponse result = apiInstance.PatchCustomer(customerTokenId, requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static TmsV2CustomersResponse Run() { string customerTokenId = "AB695DA801DD1BB6E05341588E0A3BDC"; try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new CustomerApi(clientConfig); TmsV2CustomersResponse result = apiInstance.GetCustomer(customerTokenId); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }