{"_id":"59cadd61e13789001cd5cbf2","project":"55b933b3146ef121002158d3","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":"59cadd464ab7b70024378e74","project":"55b933b3146ef121002158d3","version":"5632a5e549e16d0d00122443","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-09-26T23:05:42.579Z","from_sync":false,"order":9999,"slug":"php-guide","title":"PHP Guide"},"user":"55b932ba8fd1a02b00f496c8","githubsync":"","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-26T23:06:09.774Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:api-header]\n{\n  \"title\": \"Choosing a SOAP Library\"\n}\n[/block]\nWhen using PHP there are several SOAP libraries available that can be used to make the integration with EBizCharge easier. While using a library is not required, it typically makes the development process much quicker. We've listed the two libraries that we recommend and actively support. There are several other libraries that should work well but we have not had the time to thoroughly test all \nof them.\n\n[block:api-header]\n{\n  \"title\": \"PHP SoapClient extension\"\n}\n[/block]\nPHP 5 and above comes with a Soap extension included. EBizCharge recommends that all developers use this class if possible. This guide includes examples for the PHP 5 SoapClient and assumes that you have it installed correctly. To verify that you have the soap client installed run a script with <?php phpinfo() ?>. The output should include “Soap Client: enabled” If you do not have it installed and are using a Linux server, you will need to install the php-soap package. For example, on Red Hat EL or CentOS:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"yum install php-soap\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nIf you compile your own PHP server, include –enable-soap in the ./configure command.\n\nIf you do not have the ability to install software or recompile php, use the PEAR Soap library instead (see below).\n[block:api-header]\n{\n  \"title\": \"PEAR::Soap\"\n}\n[/block]\nThe official Pear repository includes a fairly full-featured Soap library written in PHP. Since it is written in PHP, it does not require any special privileges on the server. See PEAR::Soap for more information.\n\nThe information in this guide is for the PHP SoapClient extension. For information on using the PEAR::Soap library with EBizCharge , please see the PEAR Soap Guide.\n[block:api-header]\n{\n  \"title\": \"Using SoapClient\"\n}\n[/block]\n**Step 1: Instantiating $client**\n\nThe first step is to instantiate the SoapClient object. In the soap example provided on this site, we use $client for this object.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\t\\t\\n  //for live server use 'www' for test server use 'sandbox'\\n  $wsdl='https://secure.ebizcharge.com/soap/gate/0AE595C1/ebizcharge.wsdl';\\n \\n  // instantiate SoapClient object as $client\\n  $client = new SoapClient($wsdl);\\n \\n?>\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\nIf this fails with the error:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Fatal error: Cannot instantiate non-existent class:  soapclient\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nthen you do not have the SoapClient extension installed. See the directions above for more info on installing the extension.\n\nIf this fails with the error:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Unable to retrieve WSDL https://secure.ebizcharge.com/soap/gate/xxxxxxxx/ebizcharge.wsdl\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nthen remove 'ebizcharge.wsdl' from the link leaving only 'https://secure.ebizcharge.com/soap/gate/xxxxxxxx/' and try again.\n\n**Step 2: Building Security $token**\n\nThe ueSecurityToken object is used to securely identify the merchant to the gateway. To build a token, you will need the merchant's Source Key and Pin. The source key is created by the merchant in the Merchant Console under the Settings - Sources screen. Many of the methods in the SOAP API require the use of a PIN, and it is recommended that you always use a PIN. The merchant assigns the PIN when creating the source key.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n  $sourcekey = 'yQbOFkmykeygoeshere3Lc9PH1l14';\\n  $pin = '1234'; \\n \\n  // generate random seed value\\n  $seed=time() . rand();\\n \\n  // make hash value using sha1 function\\n  $clear= $sourcekey . $seed . $pin;\\n  $hash=sha1($clear);\\n \\n  // assembly ueSecurityToken as an array\\n  $token=array(\\n    'SourceKey'=>$sourcekey,\\n    'PinHash'=>array(\\n       'Type'=>'sha1',\\n       'Seed'=>$seed,\\n       'HashValue'=>$hash\\n     ),\\n     'ClientIP'=>$_SERVER['REMOTE_ADDR'],\\n  );\\n?>\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]","excerpt":"This guide provides information on using PHP with the EBizCharge SOAP API. The SOAP API provides an advanced interface to EBizCharge that allows merchants and resellers to access a wide range of functionality. This API requires a little more expertise than our simpler PHP Library for the Transaction API. If you are only looking to process transactions it is recommended that you use the PHP Library instead.","slug":"php-guide","type":"basic","title":"PHP Guide"}

PHP Guide

This guide provides information on using PHP with the EBizCharge SOAP API. The SOAP API provides an advanced interface to EBizCharge that allows merchants and resellers to access a wide range of functionality. This API requires a little more expertise than our simpler PHP Library for the Transaction API. If you are only looking to process transactions it is recommended that you use the PHP Library instead.

[block:api-header] { "title": "Choosing a SOAP Library" } [/block] When using PHP there are several SOAP libraries available that can be used to make the integration with EBizCharge easier. While using a library is not required, it typically makes the development process much quicker. We've listed the two libraries that we recommend and actively support. There are several other libraries that should work well but we have not had the time to thoroughly test all of them. [block:api-header] { "title": "PHP SoapClient extension" } [/block] PHP 5 and above comes with a Soap extension included. EBizCharge recommends that all developers use this class if possible. This guide includes examples for the PHP 5 SoapClient and assumes that you have it installed correctly. To verify that you have the soap client installed run a script with <?php phpinfo() ?>. The output should include “Soap Client: enabled” If you do not have it installed and are using a Linux server, you will need to install the php-soap package. For example, on Red Hat EL or CentOS: [block:code] { "codes": [ { "code": "yum install php-soap", "language": "text" } ] } [/block] If you compile your own PHP server, include –enable-soap in the ./configure command. If you do not have the ability to install software or recompile php, use the PEAR Soap library instead (see below). [block:api-header] { "title": "PEAR::Soap" } [/block] The official Pear repository includes a fairly full-featured Soap library written in PHP. Since it is written in PHP, it does not require any special privileges on the server. See PEAR::Soap for more information. The information in this guide is for the PHP SoapClient extension. For information on using the PEAR::Soap library with EBizCharge , please see the PEAR Soap Guide. [block:api-header] { "title": "Using SoapClient" } [/block] **Step 1: Instantiating $client** The first step is to instantiate the SoapClient object. In the soap example provided on this site, we use $client for this object. [block:code] { "codes": [ { "code": "<?php\t\t\n //for live server use 'www' for test server use 'sandbox'\n $wsdl='https://secure.ebizcharge.com/soap/gate/0AE595C1/ebizcharge.wsdl';\n \n // instantiate SoapClient object as $client\n $client = new SoapClient($wsdl);\n \n?>", "language": "php" } ] } [/block] If this fails with the error: [block:code] { "codes": [ { "code": "Fatal error: Cannot instantiate non-existent class: soapclient", "language": "text" } ] } [/block] then you do not have the SoapClient extension installed. See the directions above for more info on installing the extension. If this fails with the error: [block:code] { "codes": [ { "code": "Unable to retrieve WSDL https://secure.ebizcharge.com/soap/gate/xxxxxxxx/ebizcharge.wsdl", "language": "text" } ] } [/block] then remove 'ebizcharge.wsdl' from the link leaving only 'https://secure.ebizcharge.com/soap/gate/xxxxxxxx/' and try again. **Step 2: Building Security $token** The ueSecurityToken object is used to securely identify the merchant to the gateway. To build a token, you will need the merchant's Source Key and Pin. The source key is created by the merchant in the Merchant Console under the Settings - Sources screen. Many of the methods in the SOAP API require the use of a PIN, and it is recommended that you always use a PIN. The merchant assigns the PIN when creating the source key. [block:code] { "codes": [ { "code": "<?php\n $sourcekey = 'yQbOFkmykeygoeshere3Lc9PH1l14';\n $pin = '1234'; \n \n // generate random seed value\n $seed=time() . rand();\n \n // make hash value using sha1 function\n $clear= $sourcekey . $seed . $pin;\n $hash=sha1($clear);\n \n // assembly ueSecurityToken as an array\n $token=array(\n 'SourceKey'=>$sourcekey,\n 'PinHash'=>array(\n 'Type'=>'sha1',\n 'Seed'=>$seed,\n 'HashValue'=>$hash\n ),\n 'ClientIP'=>$_SERVER['REMOTE_ADDR'],\n );\n?>", "language": "php" } ] } [/block]