SOAP vV5 payment exemple using PHP
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
- Place the files on the same directory
payzenBootstrap.php, replace the occurences of
[***CHANGE-ME***]by the actual values of your PayZen account
- 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.
- The documentation used to write this code was Guide technique d’implémentation des Web services V5, v1.4 (FRENCH)