On This Page
PHP
PHP Prerequisites
You must create a P12 certificate. See the .
With this change to use a P12 certificate in your PHP SOAP toolkit configuration, the new
requirements for your application will be:
- PHP 5.6x and higher
- PHP SOAP extension
- PHP OpenSSL extension
PHP Migration Steps
Follow these steps to upgrade your existing PHP code:
- Update the following service URL (WSDL_URL) in your code:https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_N.NNN.wsdlN.NNNis the latest server API version.
- Copy these files to your project directory:
- FInd these lines in your existing code:
Replace them with these lines:$soapClient = new ExtendedClient(WSDL_URL, array());$soapClient = new ExtendedClientWithToken( WSDL_URL, array( 'SSL' => array( 'KEY_ALIAS' => 'YOUR KEY ALIAS', 'KEY_FILE' => 'YOUR CERTIFICATE FILE', 'KEY_PASS' => 'YOUR KEY PASS', 'KEY_DIRECTORY' => 'PATH TO CERTIFICATES' ) ) ); - Update the necessary values for these fields in your code:
- MERCHANT_ID
- KEY_ALIAS
- KEY_FILE
- KEY_PASS
- KEY_DIRECTORY
- Add your P12 certificate to theKEY_DIRECTORY.ThisKEY_DIRECTORYlocation must be accessible to your code. Ensure that your code has permission to read this location.
- Run the code:php <sample_PHP_file>
- (Optional) You can confirm that your configuration is updated successfully by confirming that your request was authenticated using a Bearer token. To confirm, add this command after line 109 in theExtendedClientWithToken.phpfile:print_r($request);