{"_id":"5632a5e849e16d0d00122476","githubsync":"","user":"55b932ba8fd1a02b00f496c8","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"},"category":{"_id":"5632a5e749e16d0d00122445","project":"55b933b3146ef121002158d3","version":"5632a5e549e16d0d00122443","__v":1,"pages":["5632a5e849e16d0d00122460","5632a5e849e16d0d00122461","5632a5e849e16d0d00122462","5632a5e849e16d0d00122463","5632a5e849e16d0d00122464","5632a5e849e16d0d00122465","5632a5e849e16d0d00122466","5632a5e849e16d0d00122467","5632a5e849e16d0d00122468","5632a5e849e16d0d00122469","5632a5e849e16d0d0012246a","5632a5e849e16d0d0012246b","5632a5e849e16d0d0012246c","5632a5e849e16d0d0012246d","5632a5e849e16d0d0012246e","5632a5e849e16d0d0012246f","5632a5e849e16d0d00122470","5632a5e849e16d0d00122471","5632a5e849e16d0d00122472","5632a5e849e16d0d00122473","5632a5e849e16d0d00122474","5632a5e849e16d0d00122475","5632a5e849e16d0d00122476","5632a5e849e16d0d00122477"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-31T23:43:21.882Z","from_sync":false,"order":3,"slug":"transactions","title":"Transactions"},"__v":0,"project":"55b933b3146ef121002158d3","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-08-03T17:56:50.935Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":22,"body":"Convert existing transaction to stored customer.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Description\"\n}\n[/block]\nThis method copies the credit card/check data, card holder name and address information from an existing transaction and uses it to create a new customer record to be stored in the Customer Database. By default, the customer will be created with recurring billing disabled.\nThe method returns the new CustNum (customer number). Optional customer fields can be created using the UpdateData parameter. See the [quickUpdateCustomer](/docs/quickupdatecustomer) method for details on what fields may be set.\nOnly information entered in the original transaction will be saved. To input additional data, use the [updateCustomer](/docs/updatecustomer) or [quickUpdateCustomer](/docs/quickupdatecustomer) methods. [updateCustomer](/docs/updatecustomer) will replace all existing customer data, while [quickUpdateCustomer](/docs/quickupdatecustomer) allows you to update selected fields only.\n  * FirstName\n  * LastName\n  * CustomerID\n  * Company\n  * Address\n  * Address2\n  * City\n  * State\n  * Zip\n  * Country\n  * Phone\n  * Fax\n  * Email\n  * URL\n  * ReceiptNote\n  * SendReceipt\n  * Notes\n  * Description\n  * OrderID\n  * Enabled\n  * Schedule\n  * Next\n  * NumLeft\n  * Amount\n  * CustomData\n  * Source\n  * User\n  * Card Number\n  * Card Expiration\n  * Account Number\n  * Routing Number \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Syntax\"\n}\n[/block]\nstring **convertTranToCust** ( [ueSecurityToken](/docs/uesecuritytoken) Token, integer RefNum, [FieldValue](/docs/fieldvalue) UpdateData )\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\": \"integer\",\n    \"1-1\": \"RefNum\",\n    \"1-2\": \"Transaction Reference number assigned by the gateway.\",\n    \"2-0\": \"[FieldValue](/docs/fieldvalue)\",\n    \"2-1\": \"UpdateData\",\n    \"2-2\": \"Recurring\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\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\": \"string\",\n    \"0-1\": \"Returns the CustNum of the new customer.\"\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\": \"<?php\\ntry {\\n // Set RefNum to the Reffernce Num of the\\n //transaction you want to convert to a customer\\n $RefNum=\\\"123456789\\\";\\n // Creating customer, saving exact time and verifying customer was created.\\n $RecurringBillData = array(\\n   array('Field'=>'NumLeft', 'Value'=>'10'),\\n       array('Field'=>'Amount', 'Value'=>'7.40'),\\n       array('Field'=>'Description', 'Value'=>'Monthly Bill'),\\n       array('Field'=>'Schedule', 'Value'=>'Monthly'),\\n       array('Field'=>'Enabled', 'Value'=>'Yes'),\\n );\\n $custnum = $client->convertTranToCust($token, $RefNum, $RecurringBillData);\\n}  catch(Exception $e) {\\n echo 'Error: ' . $e->getMessage();\\n}\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n## Java \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"try {\\n//Transaction Reffernce Number to convert to a customer\\nBigInteger RefNum = new BigInteger('123456');\\n//Setting up the Field Value array for updated data specific to the customer\\nFieldValueArray UpdateData = new FieldValueArray();\\nUpdateData.add(new FieldValue(\\\"Schedule\\\", \\\"weekly\\\"));\\nUpdateData.add(new FieldValue(\\\"NumLeft\\\", \\\"7\\\"));\\n//Converting to a customer\\nBigInteger CustNum = client.convertTranToCust(token, RefNum,UpdateData);\\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 refnum As String\\n       refnum = \\\"46978031\\\"\\n       Dim update(0 To 1) As eBizCharge.FieldValue\\n       For i As Integer = 0 To 1\\n           update(i) = New eBizCharge.FieldValue\\n       Next\\n       update(0).Field = \\\"Schedule\\\"\\n       update(0).Value = \\\"weekly\\\"\\n       update(1).Field = \\\"NumLeft\\\"\\n       update(1).Value = \\\"7\\\"\\n       Dim response As String\\n       response = client.convertTranToCust(token, refnum, update)\\n       MsgBox(response)\",\n      \"language\": \"c\"\n    }\n  ]\n}\n[/block]\n## C Sharp (.Net)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"string refnum = \\\"46978031\\\";\\n           eBizCharge.FieldValue[] update = new eBizCharge.FieldValue[2];\\n           for (int i = 0; i < 2; i++) {\\n               update[i] = new eBizCharge.FieldValue();\\n           }\\n           update[0].Field = \\\"Schedule\\\"; update[0].Value = \\\"weekly\\\";\\n           update[1].Field = \\\"NumLeft\\\"; update[1].Value = \\\"7\\\";\\n           string response;\\n           try\\n           {\\n               response = client.convertTranToCust(token, refnum, update);\\n               MessageBox.Show(string.Concat(\\\"Customer Number: \\\",\\n                           response));\\n           }\\n           catch (Exception err)\\n           {\\n               MessageBox.Show(err.Message);\\n           }\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"convertrantocust","type":"basic","title":"convertTranToCust"}
Convert existing transaction to stored customer. [block:api-header] { "type": "basic", "title": "Description" } [/block] This method copies the credit card/check data, card holder name and address information from an existing transaction and uses it to create a new customer record to be stored in the Customer Database. By default, the customer will be created with recurring billing disabled. The method returns the new CustNum (customer number). Optional customer fields can be created using the UpdateData parameter. See the [quickUpdateCustomer](/docs/quickupdatecustomer) method for details on what fields may be set. Only information entered in the original transaction will be saved. To input additional data, use the [updateCustomer](/docs/updatecustomer) or [quickUpdateCustomer](/docs/quickupdatecustomer) methods. [updateCustomer](/docs/updatecustomer) will replace all existing customer data, while [quickUpdateCustomer](/docs/quickupdatecustomer) allows you to update selected fields only. * FirstName * LastName * CustomerID * Company * Address * Address2 * City * State * Zip * Country * Phone * Fax * Email * URL * ReceiptNote * SendReceipt * Notes * Description * OrderID * Enabled * Schedule * Next * NumLeft * Amount * CustomData * Source * User * Card Number * Card Expiration * Account Number * Routing Number [block:api-header] { "type": "basic", "title": "Syntax" } [/block] string **convertTranToCust** ( [ueSecurityToken](/docs/uesecuritytoken) Token, integer RefNum, [FieldValue](/docs/fieldvalue) UpdateData ) [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": "integer", "1-1": "RefNum", "1-2": "Transaction Reference number assigned by the gateway.", "2-0": "[FieldValue](/docs/fieldvalue)", "2-1": "UpdateData", "2-2": "Recurring" }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Return Value" } [/block] [block:parameters] { "data": { "0-0": "string", "0-1": "Returns the CustNum of the new customer." }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Examples" } [/block] ## PHP [block:code] { "codes": [ { "code": "<?php\ntry {\n // Set RefNum to the Reffernce Num of the\n //transaction you want to convert to a customer\n $RefNum=\"123456789\";\n // Creating customer, saving exact time and verifying customer was created.\n $RecurringBillData = array(\n array('Field'=>'NumLeft', 'Value'=>'10'),\n array('Field'=>'Amount', 'Value'=>'7.40'),\n array('Field'=>'Description', 'Value'=>'Monthly Bill'),\n array('Field'=>'Schedule', 'Value'=>'Monthly'),\n array('Field'=>'Enabled', 'Value'=>'Yes'),\n );\n $custnum = $client->convertTranToCust($token, $RefNum, $RecurringBillData);\n} catch(Exception $e) {\n echo 'Error: ' . $e->getMessage();\n}", "language": "php" } ] } [/block] ## Java [block:code] { "codes": [ { "code": "try {\n//Transaction Reffernce Number to convert to a customer\nBigInteger RefNum = new BigInteger('123456');\n//Setting up the Field Value array for updated data specific to the customer\nFieldValueArray UpdateData = new FieldValueArray();\nUpdateData.add(new FieldValue(\"Schedule\", \"weekly\"));\nUpdateData.add(new FieldValue(\"NumLeft\", \"7\"));\n//Converting to a customer\nBigInteger CustNum = client.convertTranToCust(token, RefNum,UpdateData);\n} catch (Exception e) {\n System.out.println(\"Soap Exception: \" + e.getMessage());\n}", "language": "java" } ] } [/block] ## Visual Basic (.Net) [block:code] { "codes": [ { "code": "Dim refnum As String\n refnum = \"46978031\"\n Dim update(0 To 1) As eBizCharge.FieldValue\n For i As Integer = 0 To 1\n update(i) = New eBizCharge.FieldValue\n Next\n update(0).Field = \"Schedule\"\n update(0).Value = \"weekly\"\n update(1).Field = \"NumLeft\"\n update(1).Value = \"7\"\n Dim response As String\n response = client.convertTranToCust(token, refnum, update)\n MsgBox(response)", "language": "c" } ] } [/block] ## C Sharp (.Net) [block:code] { "codes": [ { "code": "string refnum = \"46978031\";\n eBizCharge.FieldValue[] update = new eBizCharge.FieldValue[2];\n for (int i = 0; i < 2; i++) {\n update[i] = new eBizCharge.FieldValue();\n }\n update[0].Field = \"Schedule\"; update[0].Value = \"weekly\";\n update[1].Field = \"NumLeft\"; update[1].Value = \"7\";\n string response;\n try\n {\n response = client.convertTranToCust(token, refnum, update);\n MessageBox.Show(string.Concat(\"Customer Number: \",\n response));\n }\n catch (Exception err)\n {\n MessageBox.Show(err.Message);\n }", "language": "csharp" } ] } [/block]