{"_id":"5632a5ed49e16d0d001224d6","project":"55b933b3146ef121002158d3","user":"55b932ba8fd1a02b00f496c8","__v":0,"githubsync":"","category":{"_id":"5632a5e749e16d0d00122449","project":"55b933b3146ef121002158d3","__v":1,"version":"5632a5e549e16d0d00122443","pages":["5632a5ed49e16d0d001224cc","5632a5ed49e16d0d001224cd","5632a5ed49e16d0d001224ce","5632a5ed49e16d0d001224cf","5632a5ed49e16d0d001224d0","5632a5ed49e16d0d001224d1","5632a5ed49e16d0d001224d2","5632a5ed49e16d0d001224d3","5632a5ed49e16d0d001224d4","5632a5ed49e16d0d001224d5","5632a5ed49e16d0d001224d6","5632a5ed49e16d0d001224d7","5632a5ed49e16d0d001224d8","5632a5ed49e16d0d001224d9","5632a5ed49e16d0d001224da","5632a5ed49e16d0d001224db","5632a5ed49e16d0d001224dc","5632a5ed49e16d0d001224dd","5632a5ed49e16d0d001224de","5632a5ed49e16d0d001224df","5632a5ed49e16d0d001224e0"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-03T18:12:10.391Z","from_sync":false,"order":7,"slug":"customers-tokenization","title":"Customers (Tokenization)"},"version":{"_id":"5632a5e549e16d0d00122443","__v":6,"project":"55b933b3146ef121002158d3","createdAt":"2015-10-29T23:04:05.701Z","releaseDate":"2015-10-29T23:04:05.701Z","categories":["5632a5e749e16d0d00122444","5632a5e749e16d0d00122445","5632a5e749e16d0d00122446","5632a5e749e16d0d00122447","5632a5e749e16d0d00122448","5632a5e749e16d0d00122449","5632a5e749e16d0d0012244a","5632a5e749e16d0d0012244b","5632a5e749e16d0d0012244c","5632a5e749e16d0d0012244d","5632a5e749e16d0d0012244e","5632a5e749e16d0d0012244f","5632a5e749e16d0d00122450","5632b179df556c0d00cd095b","564e13053b2b4a19000cd69b","59caa9df65accc001a489c95","59cab50965accc001a489d28","59cadd464ab7b70024378e74"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.1.0","version":"1.1"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-08-03T18:16:00.875Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":10,"body":"This method adds a customer to your stored customer database so that their information can be recalled at a later date.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Description\"\n}\n[/block]\nThe customer will be assigned a unique customer number by the gateway (CustNum), which you can then use to establish recurring billing cycles, recall customer data, and manually charge the customer for later products or services without needing to reenter their information.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Syntax\"\n}\n[/block]\ninteger **addCustomer** ( [ueSecurityToken](/docs/uesecuritytoken) Token, CustomerObject CustomerData )\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Arguments\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Type\",\n    \"h-1\": \"Name\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"[ueSecurityToken](/docs/uesecuritytoken)\",\n    \"0-1\": \"Token\",\n    \"0-2\": \"Merchant security token: used to identify merchant and validate transaction.\",\n    \"1-0\": \"[CustomerObject](/docs/customerobject)\",\n    \"1-1\": \"CustomerData\",\n    \"1-2\": \"Includes customer information such as customer number, merchant assigned customer ID, billing address, receipt settings, recurring billing settings, and other pertinent information.\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Return Value\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"integer\",\n    \"0-1\": \"Returns result of add customer request.\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples\"\n}\n[/block]\n## PHP \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"try {\\n$CustomerData=array(\\n       'BillingAddress'=>array(\\n               'FirstName'=>'John',\\n               'LastName'=>'Doe',\\n               'Company'=>'Acme Corp',\\n               'Street'=>'1234 main st',\\n               'Street2'=>'Suite #123',\\n               'City'=>'Los Angeles',\\n               'State'=>'CA',\\n               'Zip'=>'12345',\\n               'Country'=>'US',\\n               'Email'=>'charlie:::at:::eBizCharge.com',\\n               'Phone'=>'333-333-3333',\\n               'Fax'=>'333-333-3334'),\\n       'PaymentMethods' => array(\\n               array(\\n                                       'CardNumber'=>'4444555566667779',\\n                                       'CardExpiration'=>'0213',\\n                                       'CardType'=>'', 'CardCode'=>'','AvsStreet'=>'',\\n                                       'AvsZip'=>'',\\n                               \\\"MethodName\\\"=>\\\"My Visa\\\",\\n                               \\\"SecondarySort\\\"=>1)\\n               ),\\n               'CustomData'=>base64_encode(serialize(array(\\\"mydata\\\"=>\\\"We could put anything in here!\\\"))),\\n               'CustomFields'=>array(\\n                       array('Field'=>'Foo', 'Value'=>'Testing'),\\n                       array('Field'=>'Bar', 'Value'=>'Tested')\\n               ),\\n       'CustomerID'=>123123 + rand(),\\n       'Description'=>'Weekly Bill',\\n       'Enabled'=>false,\\n       'Amount'=>'44.93',\\n       'Tax'=>'0',\\n       'Next'=>'2012-01-21',\\n       'Notes'=>'Testing the soap addCustomer Function',\\n       'NumLeft'=>'50',\\n       'OrderID'=>rand(),\\n       'ReceiptNote'=>'addCustomer test Created Charge',\\n       'Schedule'=>'weekly',\\n       'SendReceipt'=>true,\\n       'Source'=>'Recurring',\\n       'User'=>'',\\n       'CustNum'=>'C'.rand()\\n);\\n $Result=$client->addCustomer($token,$CustomerData);\\n}\\ncatch(SoapFault $e) {\\n echo \\\"SoapFault: \\\" .$e->getMessage(); print_r($e);\\n echo \\\"\\\\n\\\\nRequest: \\\" . $tran->__getLastRequest();\\n echo \\\"\\\\n\\\\nResponse: \\\" . $tran->__getLastResponse();\\n}\\n?>\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n## Java \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"try {\\nCustomerObject customer = new CustomerObject();\\n// Setup address information\\nAddress address = new Address();\\n       address.setFirstName(\\\"John\\\");\\n       address.setLastName(\\\"Doe\\\");\\n       address.setCompany(\\\"Acme INC\\\");\\n       address.setStreet(\\\"343 Main Street\\\");\\n       address.setStreet2(\\\"Suite 222\\\");\\n       address.setCity(\\\"Somewhere\\\");\\n       address.setState(\\\"CA\\\");\\n       address.setZip(\\\"91920\\\");\\n       address.setCountry(\\\"US\\\");\\n       address.setEmail(\\\"joe@example.com\\\");\\n       address.setFax(\\\"595-343-4454\\\");\\n       address.setPhone(\\\"333-444-5555\\\");\\ncustomer.setBillingAddress(address);\\n// Set recurring billing options\\ncustomer.setEnabled(true);\\ncustomer.setAmount(5.00);\\ncustomer.setTax(0.50);\\ncustomer.setNext(\\\"2009-09-01\\\");\\ncustomer.setNumLeft(new BigInteger(\\\"-1\\\"));\\ncustomer.setSchedule(\\\"Monthly\\\");\\ncustomer.setOrderID(\\\"100090\\\");\\ncustomer.setDescription(\\\"Monthly Member Fee\\\");\\n// setup Payment Methods\\nPaymentMethodArray paymethods = new PaymentMethodArray();\\n       PaymentMethod paymethod = new PaymentMethod();\\n       paymethod.setExpires(\\\"2012-09-01\\\");\\n       CreditCardData ccdata = new CreditCardData();\\n               ccdata.setCardNumber(\\\"4444555566667779\\\");\\n               ccdata.setCardExpiration(\\\"0912\\\");\\n               ccdata.setAvsStreet(\\\"343 Main\\\");\\n               ccdata.setAvsZip(\\\"90990\\\");\\n       paymethod.setCreditCardData(ccdata);\\n       paymethod.setMethodName(\\\"My Visa\\\");\\n       paymethods.add(paymethod);\\ncustomer.setPaymentMethods(paymethods);\\n// Setup custom fields\\nFieldValueArray customfields = new FieldValueArray();\\n       customfields.add(new FieldValue(\\\"Dorky\\\",\\\"Testing\\\"));\\n       customfields.add(new FieldValue(\\\"Donkey\\\",\\\"Tested\\\"));\\n       customfields.add(new FieldValue(\\\"Wonky\\\",\\\"Tested\\\"));\\ncustomer.setCustomFields(customfields);\\n// Create request object\\nAddCustomerRequest request = new AddCustomerRequest();\\nrequest.setToken(token);\\nrequest.setCustomerData(customer);\\n// Create response object\\nAddCustomerResponse response;\\n// Add Customer\\nresponse = client.addCustomer(request);\\nSystem.out.println(\\\"Added customer \\\" + response.getAddCustomerReturn() );\\n} catch (Exception e) {\\n       System.out.println(\\\"Soap Exception: \\\" + e.getMessage());\\n}\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n## Visual Basic (.Net) \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Dim customer As eBizCharge.CustomerObject = New eBizCharge.CustomerObject\\n       Dim address As eBizCharge.Address = New eBizCharge.Address\\n       address.FirstName = \\\"John\\\"\\n       address.LastName = \\\"Doe\\\"\\n       address.Company = \\\"Acme\\\"\\n       address.Street = \\\"123 main st.\\\"\\n       address.City = \\\"Hollywood\\\"\\n       address.State = \\\"ca\\\"\\n       address.Zip = \\\"91607\\\"\\n       address.Country = \\\"USA\\\"\\n       customer.BillingAddress = address\\n       customer.Enabled = True\\n       customer.Amount = 5.0\\n       customer.Next = \\\"2010-08-15\\\"\\n       customer.Schedule = \\\"monthly\\\"\\n       Dim payMethod(0) As eBizCharge.PaymentMethod\\n       payMethod(0) = New eBizCharge.PaymentMethod\\n       payMethod(0).CardExpiration = \\\"1212\\\"\\n       payMethod(0).CardNumber = \\\"4444555566667779\\\"\\n       payMethod(0).AvsStreet = \\\"123 Main st.\\\"\\n       payMethod(0).AvsZip = \\\"90046\\\"\\n       payMethod(0).MethodName = \\\"My Visa\\\"\\n       customer.PaymentMethods = payMethod\\n       Dim response As String\\n       response = client.addCustomer(token, customer)\\n       MsgBox(String.Concat(response))\",\n      \"language\": \"c\"\n    }\n  ]\n}\n[/block]\n## C Sharp (.Net)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"eBizCharge.CustomerObject customer = new eBizCharge.CustomerObject();\\n           eBizCharge.Address address = new eBizCharge.Address();\\n           address.FirstName = \\\"John\\\";\\n           address.LastName = \\\"Doe\\\";\\n           address.Company = \\\"Acme\\\";\\n           address.Street = \\\"123 main st.\\\";\\n           address.City = \\\"Hollywood\\\";\\n           address.State = \\\"ca\\\";\\n           address.Zip = \\\"91607\\\";\\n           address.Country = \\\"USA\\\";\\n           customer.BillingAddress = address;\\n           customer.Enabled = true;\\n           customer.Amount = 5.00;\\n           customer.Next = \\\"2010-08-15\\\";\\n           customer.Schedule = \\\"monthly\\\";\\n           eBizCharge.PaymentMethod[] payMethod = new eBizCharge.PaymentMethod[1];\\n           payMethod[0] = new eBizCharge.PaymentMethod();\\n           payMethod[0].CardExpiration = \\\"1212\\\";\\n           payMethod[0].CardNumber = \\\"4444555566667779\\\";\\n           payMethod[0].AvsStreet = \\\"123 Main st.\\\";\\n           payMethod[0].AvsZip = \\\"90046\\\";\\n           payMethod[0].MethodName = \\\"My Visa\\\";\\n           customer.PaymentMethods = payMethod;\\n           string response;\\n           try\\n           {\\n               response = client.addCustomer(token, customer);\\n               MessageBox.Show(string.Concat(response));\\n           }\\n           catch (Exception err)\\n           {\\n               MessageBox.Show(err.Message);\\n           }\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n## XML \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<SOAP-ENV:Envelope\\nxmlns:SOAP-ENV=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\"\\nxmlns:ns1=\\\"urn:eBizCharge\\\" xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\"\\nxmlns:SOAP-ENC=\\\"http://schemas.xmlsoap.org/soap/encoding/\\\"\\nSOAP-ENV:encodingStyle=\\\"http://schemas.xmlsoap.org/soap/encoding/\\\">\\n<SOAP-ENV:Body>\\n<ns1:addCustomer>\\n<Token xsi:type=\\\"ns1:ueSecurityToken\\\">\\n<ClientIP xsi:type=\\\"xsd:string\\\">192.168.0.1</ClientIP>\\n<PinHash xsi:type=\\\"ns1:ueHash\\\">\\n<HashValue xsi:type=\\\"xsd:string\\\">11ac55b0a0b59f8f028dbf85bc32266fa973dd0e</HashValue>\\n<Seed xsi:type=\\\"xsd:string\\\">12678150211876663375</Seed>\\n<Type xsi:type=\\\"xsd:string\\\">sha1</Type>\\n</PinHash>\\n<SourceKey xsi:type=\\\"xsd:string\\\">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>\\n</Token>\\n<CustomerData xsi:type=\\\"ns1:CustomerObject\\\">\\n<Amount xsi:type=\\\"xsd:double\\\">59.99</Amount>\\n<BillingAddress xsi:type=\\\"ns1:Address\\\">\\n<City xsi:type=\\\"xsd:string\\\">Los Angeles</City>\\n<Company xsi:type=\\\"xsd:string\\\">Vlads Corp</Company>\\n<Country xsi:type=\\\"xsd:string\\\">US</Country>\\n<Email xsi:type=\\\"xsd:string\\\">charlie@eBizCharge.com</Email>\\n<Fax xsi:type=\\\"xsd:string\\\">333-333-3334</Fax>\\n<FirstName xsi:type=\\\"xsd:string\\\">Vlad</FirstName>\\n<LastName xsi:type=\\\"xsd:string\\\">Doe</LastName>\\n<Phone xsi:type=\\\"xsd:string\\\">333-333-3333</Phone>\\n<State xsi:type=\\\"xsd:string\\\">CA</State>\\n<Street xsi:type=\\\"xsd:string\\\">1234 main st</Street>\\n<Street2 xsi:type=\\\"xsd:string\\\">Suite #123</Street2>\\n<Zip xsi:type=\\\"xsd:string\\\">12345</Zip>\\n</BillingAddress>\\n<CustNum xsi:type=\\\"xsd:string\\\">C1957486753</CustNum>\\n<CustomData xsi:type=\\\"xsd:string\\\">YToxOntzOjY6Im15ZGF0YSI7czozMDoiV2UgY291bGQgcHV0IGFueXRoaW5nIGluIGhlcmUhIjt9</CustomData>\\n<CustomFields SOAP-ENC:arrayType=\\\"ns1:FieldValue[2]\\\" xsi:type=\\\"ns1:FieldValueArray\\\">\\n<item xsi:type=\\\"ns1:FieldValue\\\">\\n<Field xsi:type=\\\"xsd:string\\\">Foo</Field>\\n<Value xsi:type=\\\"xsd:string\\\">Testing</Value>\\n</item>\\n<item xsi:type=\\\"ns1:FieldValue\\\">\\n<Field xsi:type=\\\"xsd:string\\\">Bar</Field>\\n<Value xsi:type=\\\"xsd:string\\\">Tested</Value>\\n</item>\\n</CustomFields>\\n<CustomerID xsi:type=\\\"xsd:string\\\">730163741</CustomerID>\\n<Description xsi:type=\\\"xsd:string\\\">Weekly Bill</Description>\\n<Enabled xsi:type=\\\"xsd:boolean\\\">false</Enabled>\\n<Next xsi:type=\\\"xsd:string\\\">2012-01-21</Next>\\n<Notes xsi:type=\\\"xsd:string\\\">Testing the soap addCustomer Function</Notes>\\n<NumLeft xsi:type=\\\"xsd:integer\\\">50</NumLeft>\\n<OrderID xsi:type=\\\"xsd:string\\\">1621046782</OrderID>\\n<PaymentMethods SOAP-ENC:arrayType=\\\"ns1:PaymentMethod[1]\\\" xsi:type=\\\"ns1:PaymentMethodArray\\\">\\n<item xsi:type=\\\"ns1:PaymentMethod\\\">\\n<MethodName xsi:type=\\\"xsd:string\\\">My Visa</MethodName>\\n<SecondarySort xsi:type=\\\"xsd:integer\\\">1</SecondarySort>\\n<CardExpiration xsi:type=\\\"xsd:string\\\">0213</CardExpiration>\\n<CardNumber xsi:type=\\\"xsd:string\\\">4444555566667779</CardNumber>\\n</item>\\n</PaymentMethods>\\n<ReceiptNote xsi:type=\\\"xsd:string\\\">addCustomer test Created Charge</ReceiptNote>\\n<Schedule xsi:type=\\\"xsd:string\\\">weekly</Schedule>\\n<SendReceipt xsi:type=\\\"xsd:boolean\\\">true</SendReceipt>\\n<Source xsi:type=\\\"xsd:string\\\">BlahBlah</Source>\\n<Tax xsi:type=\\\"xsd:double\\\">4.93</Tax>\\n<User xsi:type=\\\"xsd:string\\\">TestUser</User>\\n<URL xsi:type=\\\"xsd:string\\\">http://www.acme.com</URL>\\n</CustomerData>\\n</ns1:addCustomer>\\n</SOAP-ENV:Body>\\n</SOAP-ENV:Envelope>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"addcustomer","type":"basic","title":"addCustomer"}
This method adds a customer to your stored customer database so that their information can be recalled at a later date. [block:api-header] { "type": "basic", "title": "Description" } [/block] The customer will be assigned a unique customer number by the gateway (CustNum), which you can then use to establish recurring billing cycles, recall customer data, and manually charge the customer for later products or services without needing to reenter their information. [block:api-header] { "type": "basic", "title": "Syntax" } [/block] integer **addCustomer** ( [ueSecurityToken](/docs/uesecuritytoken) Token, CustomerObject CustomerData ) [block:api-header] { "type": "basic", "title": "Arguments" } [/block] [block:parameters] { "data": { "h-0": "Type", "h-1": "Name", "h-2": "Description", "0-0": "[ueSecurityToken](/docs/uesecuritytoken)", "0-1": "Token", "0-2": "Merchant security token: used to identify merchant and validate transaction.", "1-0": "[CustomerObject](/docs/customerobject)", "1-1": "CustomerData", "1-2": "Includes customer information such as customer number, merchant assigned customer ID, billing address, receipt settings, recurring billing settings, and other pertinent information." }, "cols": 3, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] [block:parameters] { "data": { "0-0": "integer", "0-1": "Returns result of add customer request." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Examples" } [/block] ## PHP [block:code] { "codes": [ { "code": "try {\n$CustomerData=array(\n 'BillingAddress'=>array(\n 'FirstName'=>'John',\n 'LastName'=>'Doe',\n 'Company'=>'Acme Corp',\n 'Street'=>'1234 main st',\n 'Street2'=>'Suite #123',\n 'City'=>'Los Angeles',\n 'State'=>'CA',\n 'Zip'=>'12345',\n 'Country'=>'US',\n 'Email'=>'charlie@eBizCharge.com',\n 'Phone'=>'333-333-3333',\n 'Fax'=>'333-333-3334'),\n 'PaymentMethods' => array(\n array(\n 'CardNumber'=>'4444555566667779',\n 'CardExpiration'=>'0213',\n 'CardType'=>'', 'CardCode'=>'','AvsStreet'=>'',\n 'AvsZip'=>'',\n \"MethodName\"=>\"My Visa\",\n \"SecondarySort\"=>1)\n ),\n 'CustomData'=>base64_encode(serialize(array(\"mydata\"=>\"We could put anything in here!\"))),\n 'CustomFields'=>array(\n array('Field'=>'Foo', 'Value'=>'Testing'),\n array('Field'=>'Bar', 'Value'=>'Tested')\n ),\n 'CustomerID'=>123123 + rand(),\n 'Description'=>'Weekly Bill',\n 'Enabled'=>false,\n 'Amount'=>'44.93',\n 'Tax'=>'0',\n 'Next'=>'2012-01-21',\n 'Notes'=>'Testing the soap addCustomer Function',\n 'NumLeft'=>'50',\n 'OrderID'=>rand(),\n 'ReceiptNote'=>'addCustomer test Created Charge',\n 'Schedule'=>'weekly',\n 'SendReceipt'=>true,\n 'Source'=>'Recurring',\n 'User'=>'',\n 'CustNum'=>'C'.rand()\n);\n $Result=$client->addCustomer($token,$CustomerData);\n}\ncatch(SoapFault $e) {\n echo \"SoapFault: \" .$e->getMessage(); print_r($e);\n echo \"\\n\\nRequest: \" . $tran->__getLastRequest();\n echo \"\\n\\nResponse: \" . $tran->__getLastResponse();\n}\n?>", "language": "php" } ] } [/block] ## Java [block:code] { "codes": [ { "code": "try {\nCustomerObject customer = new CustomerObject();\n// Setup address information\nAddress address = new Address();\n address.setFirstName(\"John\");\n address.setLastName(\"Doe\");\n address.setCompany(\"Acme INC\");\n address.setStreet(\"343 Main Street\");\n address.setStreet2(\"Suite 222\");\n address.setCity(\"Somewhere\");\n address.setState(\"CA\");\n address.setZip(\"91920\");\n address.setCountry(\"US\");\n address.setEmail(\"joe@example.com\");\n address.setFax(\"595-343-4454\");\n address.setPhone(\"333-444-5555\");\ncustomer.setBillingAddress(address);\n// Set recurring billing options\ncustomer.setEnabled(true);\ncustomer.setAmount(5.00);\ncustomer.setTax(0.50);\ncustomer.setNext(\"2009-09-01\");\ncustomer.setNumLeft(new BigInteger(\"-1\"));\ncustomer.setSchedule(\"Monthly\");\ncustomer.setOrderID(\"100090\");\ncustomer.setDescription(\"Monthly Member Fee\");\n// setup Payment Methods\nPaymentMethodArray paymethods = new PaymentMethodArray();\n PaymentMethod paymethod = new PaymentMethod();\n paymethod.setExpires(\"2012-09-01\");\n CreditCardData ccdata = new CreditCardData();\n ccdata.setCardNumber(\"4444555566667779\");\n ccdata.setCardExpiration(\"0912\");\n ccdata.setAvsStreet(\"343 Main\");\n ccdata.setAvsZip(\"90990\");\n paymethod.setCreditCardData(ccdata);\n paymethod.setMethodName(\"My Visa\");\n paymethods.add(paymethod);\ncustomer.setPaymentMethods(paymethods);\n// Setup custom fields\nFieldValueArray customfields = new FieldValueArray();\n customfields.add(new FieldValue(\"Dorky\",\"Testing\"));\n customfields.add(new FieldValue(\"Donkey\",\"Tested\"));\n customfields.add(new FieldValue(\"Wonky\",\"Tested\"));\ncustomer.setCustomFields(customfields);\n// Create request object\nAddCustomerRequest request = new AddCustomerRequest();\nrequest.setToken(token);\nrequest.setCustomerData(customer);\n// Create response object\nAddCustomerResponse response;\n// Add Customer\nresponse = client.addCustomer(request);\nSystem.out.println(\"Added customer \" + response.getAddCustomerReturn() );\n} catch (Exception e) {\n System.out.println(\"Soap Exception: \" + e.getMessage());\n}", "language": "java" } ] } [/block] ## Visual Basic (.Net) [block:code] { "codes": [ { "code": "Dim customer As eBizCharge.CustomerObject = New eBizCharge.CustomerObject\n Dim address As eBizCharge.Address = New eBizCharge.Address\n address.FirstName = \"John\"\n address.LastName = \"Doe\"\n address.Company = \"Acme\"\n address.Street = \"123 main st.\"\n address.City = \"Hollywood\"\n address.State = \"ca\"\n address.Zip = \"91607\"\n address.Country = \"USA\"\n customer.BillingAddress = address\n customer.Enabled = True\n customer.Amount = 5.0\n customer.Next = \"2010-08-15\"\n customer.Schedule = \"monthly\"\n Dim payMethod(0) As eBizCharge.PaymentMethod\n payMethod(0) = New eBizCharge.PaymentMethod\n payMethod(0).CardExpiration = \"1212\"\n payMethod(0).CardNumber = \"4444555566667779\"\n payMethod(0).AvsStreet = \"123 Main st.\"\n payMethod(0).AvsZip = \"90046\"\n payMethod(0).MethodName = \"My Visa\"\n customer.PaymentMethods = payMethod\n Dim response As String\n response = client.addCustomer(token, customer)\n MsgBox(String.Concat(response))", "language": "c" } ] } [/block] ## C Sharp (.Net) [block:code] { "codes": [ { "code": "eBizCharge.CustomerObject customer = new eBizCharge.CustomerObject();\n eBizCharge.Address address = new eBizCharge.Address();\n address.FirstName = \"John\";\n address.LastName = \"Doe\";\n address.Company = \"Acme\";\n address.Street = \"123 main st.\";\n address.City = \"Hollywood\";\n address.State = \"ca\";\n address.Zip = \"91607\";\n address.Country = \"USA\";\n customer.BillingAddress = address;\n customer.Enabled = true;\n customer.Amount = 5.00;\n customer.Next = \"2010-08-15\";\n customer.Schedule = \"monthly\";\n eBizCharge.PaymentMethod[] payMethod = new eBizCharge.PaymentMethod[1];\n payMethod[0] = new eBizCharge.PaymentMethod();\n payMethod[0].CardExpiration = \"1212\";\n payMethod[0].CardNumber = \"4444555566667779\";\n payMethod[0].AvsStreet = \"123 Main st.\";\n payMethod[0].AvsZip = \"90046\";\n payMethod[0].MethodName = \"My Visa\";\n customer.PaymentMethods = payMethod;\n string response;\n try\n {\n response = client.addCustomer(token, customer);\n MessageBox.Show(string.Concat(response));\n }\n catch (Exception err)\n {\n MessageBox.Show(err.Message);\n }", "language": "csharp" } ] } [/block] ## XML [block:code] { "codes": [ { "code": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope\nxmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\nxmlns:ns1=\"urn:eBizCharge\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\nxmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\nSOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n<SOAP-ENV:Body>\n<ns1:addCustomer>\n<Token xsi:type=\"ns1:ueSecurityToken\">\n<ClientIP xsi:type=\"xsd:string\">192.168.0.1</ClientIP>\n<PinHash xsi:type=\"ns1:ueHash\">\n<HashValue xsi:type=\"xsd:string\">11ac55b0a0b59f8f028dbf85bc32266fa973dd0e</HashValue>\n<Seed xsi:type=\"xsd:string\">12678150211876663375</Seed>\n<Type xsi:type=\"xsd:string\">sha1</Type>\n</PinHash>\n<SourceKey xsi:type=\"xsd:string\">HB4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>\n</Token>\n<CustomerData xsi:type=\"ns1:CustomerObject\">\n<Amount xsi:type=\"xsd:double\">59.99</Amount>\n<BillingAddress xsi:type=\"ns1:Address\">\n<City xsi:type=\"xsd:string\">Los Angeles</City>\n<Company xsi:type=\"xsd:string\">Vlads Corp</Company>\n<Country xsi:type=\"xsd:string\">US</Country>\n<Email xsi:type=\"xsd:string\">charlie@eBizCharge.com</Email>\n<Fax xsi:type=\"xsd:string\">333-333-3334</Fax>\n<FirstName xsi:type=\"xsd:string\">Vlad</FirstName>\n<LastName xsi:type=\"xsd:string\">Doe</LastName>\n<Phone xsi:type=\"xsd:string\">333-333-3333</Phone>\n<State xsi:type=\"xsd:string\">CA</State>\n<Street xsi:type=\"xsd:string\">1234 main st</Street>\n<Street2 xsi:type=\"xsd:string\">Suite #123</Street2>\n<Zip xsi:type=\"xsd:string\">12345</Zip>\n</BillingAddress>\n<CustNum xsi:type=\"xsd:string\">C1957486753</CustNum>\n<CustomData xsi:type=\"xsd:string\">YToxOntzOjY6Im15ZGF0YSI7czozMDoiV2UgY291bGQgcHV0IGFueXRoaW5nIGluIGhlcmUhIjt9</CustomData>\n<CustomFields SOAP-ENC:arrayType=\"ns1:FieldValue[2]\" xsi:type=\"ns1:FieldValueArray\">\n<item xsi:type=\"ns1:FieldValue\">\n<Field xsi:type=\"xsd:string\">Foo</Field>\n<Value xsi:type=\"xsd:string\">Testing</Value>\n</item>\n<item xsi:type=\"ns1:FieldValue\">\n<Field xsi:type=\"xsd:string\">Bar</Field>\n<Value xsi:type=\"xsd:string\">Tested</Value>\n</item>\n</CustomFields>\n<CustomerID xsi:type=\"xsd:string\">730163741</CustomerID>\n<Description xsi:type=\"xsd:string\">Weekly Bill</Description>\n<Enabled xsi:type=\"xsd:boolean\">false</Enabled>\n<Next xsi:type=\"xsd:string\">2012-01-21</Next>\n<Notes xsi:type=\"xsd:string\">Testing the soap addCustomer Function</Notes>\n<NumLeft xsi:type=\"xsd:integer\">50</NumLeft>\n<OrderID xsi:type=\"xsd:string\">1621046782</OrderID>\n<PaymentMethods SOAP-ENC:arrayType=\"ns1:PaymentMethod[1]\" xsi:type=\"ns1:PaymentMethodArray\">\n<item xsi:type=\"ns1:PaymentMethod\">\n<MethodName xsi:type=\"xsd:string\">My Visa</MethodName>\n<SecondarySort xsi:type=\"xsd:integer\">1</SecondarySort>\n<CardExpiration xsi:type=\"xsd:string\">0213</CardExpiration>\n<CardNumber xsi:type=\"xsd:string\">4444555566667779</CardNumber>\n</item>\n</PaymentMethods>\n<ReceiptNote xsi:type=\"xsd:string\">addCustomer test Created Charge</ReceiptNote>\n<Schedule xsi:type=\"xsd:string\">weekly</Schedule>\n<SendReceipt xsi:type=\"xsd:boolean\">true</SendReceipt>\n<Source xsi:type=\"xsd:string\">BlahBlah</Source>\n<Tax xsi:type=\"xsd:double\">4.93</Tax>\n<User xsi:type=\"xsd:string\">TestUser</User>\n<URL xsi:type=\"xsd:string\">http://www.acme.com</URL>\n</CustomerData>\n</ns1:addCustomer>\n</SOAP-ENV:Body>\n</SOAP-ENV:Envelope>", "language": "xml" } ] } [/block]