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:
  1. Update the following service URL (
    WSDL_URL
    ) in your code:
    https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_N.NNN.wsdl
    N.NNN
    is the latest server API version.
  2. FInd these lines in your existing code:
    $soapClient = new ExtendedClient(WSDL_URL, array());
    Replace them with these lines:
    $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' ) ) );
  3. Update the necessary values for these fields in your code:
    • MERCHANT_ID
    • KEY_ALIAS
    • KEY_FILE
    • KEY_PASS
    • KEY_DIRECTORY
  4. Add your P12 certificate to the
    KEY_DIRECTORY
    .
    This
    KEY_DIRECTORY
    location must be accessible to your code. Ensure that your code has permission to read this location.
  5. Run the code:
    php <sample_PHP_file>
  6. (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 the
    ExtendedClientWithToken.php
    file:
    print_r($request);