Home > Constructing SOAP with PHP 5.2.1


Constructing SOAP with PHP 5.2.1

This section describes how to construct SOAP messages to process transactions with CyberSource.

Before starting this process, download and install the third-party software. CyberSource tested these versions:

Software Tested Description
  • Linux Kernel 2.4
  • Windows XP Pro with SP2
  • Solaris
Operating system versions tested.
PHP 5.2.1 PHP software. The SOAP extension is provided only in versions 5.2.1 and later.
libxml2 2.6.23 2.6.11 is the minimum version required by the SOAP extension.

openssl 0.9.8d

SSL library; 0.9.6 is the minimum required version by the SOAP extension.

Although the SOAP extension does not have built-in support for Web Services Security, you can add the required header elements for the UsernameToken information to the outgoing request. The code in the sample file shows how to extend the SoapClient class and how to override its __doRequest() method (lines 17 to 49) to insert the UsernameToken information.

Test the client application with the following Cybersource sample code: https://github.com/CyberSource/cybersource-soap-toolkit/tree/master/sample_php.

The sample PHP files contain many comments and a sample card authorization. Choose the file appropriate for you:

Be sure that you understand the content of the file and that you replace the generic values of the variables, such as your merchant ID and password, with your own values.