{"_id":"5632a5ea49e16d0d001224a3","category":{"_id":"5632a5e749e16d0d0012244d","__v":1,"pages":["5632a5ea49e16d0d00122481","5632a5ea49e16d0d00122482","5632a5ea49e16d0d00122483","5632a5ea49e16d0d00122484","5632a5ea49e16d0d00122485","5632a5ea49e16d0d00122486","5632a5ea49e16d0d00122487","5632a5ea49e16d0d00122488","5632a5ea49e16d0d00122489","5632a5ea49e16d0d0012248a","5632a5ea49e16d0d0012248b","5632a5ea49e16d0d0012248c","5632a5ea49e16d0d0012248d","5632a5ea49e16d0d0012248e","5632a5ea49e16d0d0012248f","5632a5ea49e16d0d00122490","5632a5ea49e16d0d00122491","5632a5ea49e16d0d00122492","5632a5ea49e16d0d00122493","5632a5ea49e16d0d00122494","5632a5ea49e16d0d00122495","5632a5ea49e16d0d00122496","5632a5ea49e16d0d00122497","5632a5ea49e16d0d00122498","5632a5ea49e16d0d00122499","5632a5ea49e16d0d0012249a","5632a5ea49e16d0d0012249b","5632a5ea49e16d0d0012249c","5632a5ea49e16d0d0012249d","5632a5ea49e16d0d0012249e","5632a5ea49e16d0d0012249f","5632a5ea49e16d0d001224a0","5632a5ea49e16d0d001224a1","5632a5ea49e16d0d001224a2","5632a5ea49e16d0d001224a3","5632a5ea49e16d0d001224a4","5632a5ea49e16d0d001224a5","5632a5ea49e16d0d001224a6","5632a5ea49e16d0d001224a7"],"project":"55b933b3146ef121002158d3","version":"5632a5e549e16d0d00122443","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-04T17:34:02.800Z","from_sync":false,"order":12,"slug":"objects","title":"Objects"},"project":"55b933b3146ef121002158d3","user":"55b932ba8fd1a02b00f496c8","githubsync":"","__v":0,"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-04T17:59:25.892Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":33,"body":"Defines a source key used to identify a merchant or reseller.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Description\"\n}\n[/block]\nThis object defines a source key which is used to identify the merchant or reseller making the request. Source keys are obtained by logging into the merchant or reseller console.\nA source key that has a pin assigned must include the Hash object. It is highly recommended that a pin always be used in conjunction with the source key.\nAll SOAP methods require the use of a pin, except the following transaction methods:\n  * runTransactionApi\n  * runTransaction\n  * runSale\n  * runQuickSale\n  * runCredit\n  * authOnly\n  * postAuth\n  * captureTransaction \nThe ClientIP is used to reference the end client. While this field is not required (it can be left blank) it is used by several fraud modules and is recommended.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Properties\"\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\": \"string\",\n    \"0-1\": \"SourceKey\",\n    \"0-2\": \"SourceKey obtained in merchant console.\",\n    \"1-0\": \"[ueHash](/docs/uehash)\",\n    \"1-1\": \"PinHash\",\n    \"1-2\": \"Hash object for the PIN (only necessary if this source key has a pin assigned)\",\n    \"2-0\": \"string\",\n    \"2-1\": \"ClientIP\",\n    \"2-2\": \"The IP Address of the end client\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples\"\n}\n[/block]\n## PHP 5 \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\nclass TokenClientExample {\\n   public $client; // initialize client\\n   public $token;// initialize token\\n   function setUp{\\n       $client=self::getClient(); //Using this class\\n       $token=self::getToken();   //Using this class\\n   }\\n   static function getClient(){\\n       //for live server use 'www' for test server use 'sandbox'\\n       $wsdl='https://secure.eBizCharge.com/soap/gate/131C979E/eBizCharge.wsdl';\\n       return new SoapClient($wsdl,array(\\\"trace\\\"=>1,\\\"exceptions\\\"=>1));\\n       //Must have Php5 compiled with --enable-soap\\n       //Otherwise use pear soap. For more info please visit: http://pear.php.net/package/SOAP\\n   }\\n   static function getToken(){\\n       // Creating a ueSecurityToken\\n       $sourcekey = 'yQbOFkmykeygoeshere3Lc9PH1l14';\\n//Input your merchant console generated source key\\n       $pin = '1234'; //Input the PIN set in the source editor for your source key\\n       // generate random seed value\\n       $seed=mktime() . rand();\\n       // make hash value using sha1 function\\n       $clear= $sourcekey . $seed . $pin;\\n       $hash=sha1($clear);\\n       // assembly ueSecurityToken as an array\\n       // (php5 will correct the type for us)\\n       $tok=array(\\n        'SourceKey'=>$sourcekey,\\n        'PinHash'=>array(\\n           'Type'=>'sha1',\\n           'Seed'=>$seed,\\n           'HashValue'=>$hash\\n           ),\\n        'ClientIP'=>'192.168.0.1'\\n       );\\n       return $tok;\\n   }\\n}\\n?>\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n## PHP 4 \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n// Creating a ueSecurityToken\\n$sourcekey = 'yQbOFkjD8wwlkZ3AhY248k3Lc9PH1l14';\\n$pin = '1234';\\n// generate random seed value\\n$seed=mktime() . rand();\\n// make hash value using sha1 function\\n$clear= $sourcekey . $seed . $pin;\\n$hash=sha1($clear);\\n// assembly ueSecurityToken as an array\\n// (php4 will correct the type for us)\\n$token=array(\\n'SourceKey'=>$sourcekey,\\n'PinHash'=>array(\\n       'Type'=>'sha1',\\n       'Seed'=>$seed,\\n       'HashValue'=>$hash\\n       ),\\n'ClientIP'=>'192.168.0.1'\\n);\\n?>\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n## Visual Basic (.Net) \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Imports System\\nImports System.Web\\nImports System.IO\\nImports System.Security.Cryptography\\nImports System.Text\\nPrivate Sub mySoapCall()\\n Dim token As eBizCharge.ueSecurityToken\\n Dim hash As eBizCharge.ueHash = New eBizCharge.ueHash\\n Dim sourcekey As String\\n Dim pin As String\\n ' The source key and pin are created by the merchant\\n sourcekey = \\\"e42SYc86C4uvlvyP62ow54Kv93SZsJVm\\\"\\n pin = \\\"1234\\\"\\n token = New eBizCharge.ueSecurityToken\\n token.SourceKey = sourcekey\\n ' To create the hash we must concat the sourcekey, seed and pin\\n Dim rand As System.Random = New System.Random\\n hash.Seed = Date.Now.ToUniversalTime & rand.Next()\\n Dim prehashvalue As String\\n prehashvalue = sourcekey & hash.Seed & pin\\n ' Generate the md5 hash\\n hash.Type = \\\"md5\\\"\\n hash.HashValue = GenerateHash(prehashvalue)\\n token.PinHash = hash\\nEnd Sub\\nPrivate Function GenerateHash(ByVal SourceText As String) As String\\n 'Instantiate an MD5 Provider object\\n Dim md5 As New MD5CryptoServiceProvider\\n 'Compute the hash value from the source\\n Dim ByteHash() As Byte = md5.ComputeHash(Encoding.Default.GetBytes(SourceText))\\n 'Instantiate a StringBuilder object\\n Dim sb As New StringBuilder\\n 'Repack binary hash as hex\\n For c As Integer = 0 To ByteHash.Length - 1\\n   sb.AppendFormat(\\\"{0:x2}\\\", ByteHash(c))\\n Next c\\n 'Return the hex hash\\n Return sb.ToString\\nEnd Function\",\n      \"language\": \"asp\"\n    }\n  ]\n}\n[/block]\n## C Sharp (.Net)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"eBizCharge.ueSecurityToken token = new eBizCharge.ueSecurityToken();\\n           // SourceKey and Pin (created in merchant console)\\n           token.SourceKey = \\\"O79****************************c8\\\";\\n           string pin = \\\"1234\\\";\\n           // IP address of end user (if applicable)\\n           token.ClientIP = \\\"11.22.33.44\\\";  \\n           // Instantiate Hash\\n           eBizCharge.ueHash hash = new eBizCharge.ueHash();\\n           hash.Type = \\\"md5\\\";  // Type of encryption\\n           hash.Seed = Guid.NewGuid().ToString();  // unique encryption seed\\n           // Assemble string and hash\\n           string prehashvalue = string.Concat(token.SourceKey, hash.Seed, pin);\\n           hash.HashValue = GenerateHash(prehashvalue);\\n           // Add hash to token\\n           token.PinHash = hash;\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n## Coldfusion \n*NOTE*: this example has not been tested and is provided as is.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<cfscript>\\n seed = randrange(0, 1000000);\\n pin = 'yourpin';\\n Token = structnew ();\\n Token.SourceKey = 'yoursourcekey here';\\n Token.PinHash = structnew();\\n Token.PinHash.Type = 'md5';\\n Token.PinHash.Seed = #seed#;\\n Token.PinHash.HashValue = hash('#Token.SourceKey#'&'#Token.PinHash.Seed#'&'#pin#');\\n</cfscript>\",\n      \"language\": \"coffeescript\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"uesecuritytoken","type":"basic","title":"ueSecurityToken"}
Defines a source key used to identify a merchant or reseller. [block:api-header] { "type": "basic", "title": "Description" } [/block] This object defines a source key which is used to identify the merchant or reseller making the request. Source keys are obtained by logging into the merchant or reseller console. A source key that has a pin assigned must include the Hash object. It is highly recommended that a pin always be used in conjunction with the source key. All SOAP methods require the use of a pin, except the following transaction methods: * runTransactionApi * runTransaction * runSale * runQuickSale * runCredit * authOnly * postAuth * captureTransaction The ClientIP is used to reference the end client. While this field is not required (it can be left blank) it is used by several fraud modules and is recommended. [block:api-header] { "type": "basic", "title": "Properties" } [/block] [block:parameters] { "data": { "h-0": "Type", "h-1": "Name", "h-2": "Description", "0-0": "string", "0-1": "SourceKey", "0-2": "SourceKey obtained in merchant console.", "1-0": "[ueHash](/docs/uehash)", "1-1": "PinHash", "1-2": "Hash object for the PIN (only necessary if this source key has a pin assigned)", "2-0": "string", "2-1": "ClientIP", "2-2": "The IP Address of the end client" }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Examples" } [/block] ## PHP 5 [block:code] { "codes": [ { "code": "<?php\nclass TokenClientExample {\n public $client; // initialize client\n public $token;// initialize token\n function setUp{\n $client=self::getClient(); //Using this class\n $token=self::getToken(); //Using this class\n }\n static function getClient(){\n //for live server use 'www' for test server use 'sandbox'\n $wsdl='https://secure.eBizCharge.com/soap/gate/131C979E/eBizCharge.wsdl';\n return new SoapClient($wsdl,array(\"trace\"=>1,\"exceptions\"=>1));\n //Must have Php5 compiled with --enable-soap\n //Otherwise use pear soap. For more info please visit: http://pear.php.net/package/SOAP\n }\n static function getToken(){\n // Creating a ueSecurityToken\n $sourcekey = 'yQbOFkmykeygoeshere3Lc9PH1l14';\n//Input your merchant console generated source key\n $pin = '1234'; //Input the PIN set in the source editor for your source key\n // generate random seed value\n $seed=mktime() . rand();\n // make hash value using sha1 function\n $clear= $sourcekey . $seed . $pin;\n $hash=sha1($clear);\n // assembly ueSecurityToken as an array\n // (php5 will correct the type for us)\n $tok=array(\n 'SourceKey'=>$sourcekey,\n 'PinHash'=>array(\n 'Type'=>'sha1',\n 'Seed'=>$seed,\n 'HashValue'=>$hash\n ),\n 'ClientIP'=>'192.168.0.1'\n );\n return $tok;\n }\n}\n?>", "language": "php" } ] } [/block] ## PHP 4 [block:code] { "codes": [ { "code": "<?php\n// Creating a ueSecurityToken\n$sourcekey = 'yQbOFkjD8wwlkZ3AhY248k3Lc9PH1l14';\n$pin = '1234';\n// generate random seed value\n$seed=mktime() . rand();\n// make hash value using sha1 function\n$clear= $sourcekey . $seed . $pin;\n$hash=sha1($clear);\n// assembly ueSecurityToken as an array\n// (php4 will correct the type for us)\n$token=array(\n'SourceKey'=>$sourcekey,\n'PinHash'=>array(\n 'Type'=>'sha1',\n 'Seed'=>$seed,\n 'HashValue'=>$hash\n ),\n'ClientIP'=>'192.168.0.1'\n);\n?>", "language": "php" } ] } [/block] ## Visual Basic (.Net) [block:code] { "codes": [ { "code": "Imports System\nImports System.Web\nImports System.IO\nImports System.Security.Cryptography\nImports System.Text\nPrivate Sub mySoapCall()\n Dim token As eBizCharge.ueSecurityToken\n Dim hash As eBizCharge.ueHash = New eBizCharge.ueHash\n Dim sourcekey As String\n Dim pin As String\n ' The source key and pin are created by the merchant\n sourcekey = \"e42SYc86C4uvlvyP62ow54Kv93SZsJVm\"\n pin = \"1234\"\n token = New eBizCharge.ueSecurityToken\n token.SourceKey = sourcekey\n ' To create the hash we must concat the sourcekey, seed and pin\n Dim rand As System.Random = New System.Random\n hash.Seed = Date.Now.ToUniversalTime & rand.Next()\n Dim prehashvalue As String\n prehashvalue = sourcekey & hash.Seed & pin\n ' Generate the md5 hash\n hash.Type = \"md5\"\n hash.HashValue = GenerateHash(prehashvalue)\n token.PinHash = hash\nEnd Sub\nPrivate Function GenerateHash(ByVal SourceText As String) As String\n 'Instantiate an MD5 Provider object\n Dim md5 As New MD5CryptoServiceProvider\n 'Compute the hash value from the source\n Dim ByteHash() As Byte = md5.ComputeHash(Encoding.Default.GetBytes(SourceText))\n 'Instantiate a StringBuilder object\n Dim sb As New StringBuilder\n 'Repack binary hash as hex\n For c As Integer = 0 To ByteHash.Length - 1\n sb.AppendFormat(\"{0:x2}\", ByteHash(c))\n Next c\n 'Return the hex hash\n Return sb.ToString\nEnd Function", "language": "asp" } ] } [/block] ## C Sharp (.Net) [block:code] { "codes": [ { "code": "eBizCharge.ueSecurityToken token = new eBizCharge.ueSecurityToken();\n // SourceKey and Pin (created in merchant console)\n token.SourceKey = \"O79****************************c8\";\n string pin = \"1234\";\n // IP address of end user (if applicable)\n token.ClientIP = \"11.22.33.44\"; \n // Instantiate Hash\n eBizCharge.ueHash hash = new eBizCharge.ueHash();\n hash.Type = \"md5\"; // Type of encryption\n hash.Seed = Guid.NewGuid().ToString(); // unique encryption seed\n // Assemble string and hash\n string prehashvalue = string.Concat(token.SourceKey, hash.Seed, pin);\n hash.HashValue = GenerateHash(prehashvalue);\n // Add hash to token\n token.PinHash = hash;", "language": "csharp" } ] } [/block] ## Coldfusion *NOTE*: this example has not been tested and is provided as is. [block:code] { "codes": [ { "code": "<cfscript>\n seed = randrange(0, 1000000);\n pin = 'yourpin';\n Token = structnew ();\n Token.SourceKey = 'yoursourcekey here';\n Token.PinHash = structnew();\n Token.PinHash.Type = 'md5';\n Token.PinHash.Seed = #seed#;\n Token.PinHash.HashValue = hash('#Token.SourceKey#'&'#Token.PinHash.Seed#'&'#pin#');\n</cfscript>", "language": "coffeescript" } ] } [/block]