Example of PHP code using PayZen SOAP V5 webservices - createPayment request
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
example refactoring Aug 23, 2016
lib refactoring Aug 23, 2016
index.html refactoring Aug 23, 2016


SOAP vV5 payment exemple using PHP

Example of PHP code using PayZen SOAP V5 webservices - createPayment request Please refer to the documentation website payzen.io


The code presented here is a demonstration of the implementation of the SOAP v5 PayZen webservices, aimed to ease its use and learning.

This code only supports the createPayment request, but shows how a PayZen request and its answer can be handled.


This code is divided in three parts:

  • create-payment.php, the main file, entry point of the process
  • payzenSoapV5ToolBox.php, the core file, defining an utility class encapsulating all the PayZen logics
  • UUID.php, an utility tool handling the generation of valid UUID, took from https://gist.github.com/dahnielson/508447.

The first use

  1. Place the files on the same directory
  2. In payzenBootstrap.php, replace the occurences of [***CHANGE-ME***] by the actual values of your PayZen account
  3. Execute: > php example/create-payment.php to perform the createPayment request, in "TEST" mode.

The next steps

You can follow the on-file documentation in create-payment.php to change the properties of the payment you want to initiate, like the amount or the informations of the customer payment card.

You will also find here the instructions on how to plug the toolbox logging process to your own, and finally, you can change the TEST parameter to PRODUCTION to switch to real payment mode, with all the caution this decision expects.