Sample code

Paystation has a PHP code example. The example contains support for both 2-party (merchant hosted) or 3-party (fully hosted) integration methods. 

Please note that merchant hosted processing requires PCI compliance and bank approval.

You can download the appropriate sample code below. If required, full API documentation is available from the Paystation APIs site. The code sample on this page shows how to initiate a payment with Paystation, and how to interpret our response. We assume that you have sufficient knowledge on how to store orders and customer details in a database before initiating the payment request, and are able to tie our response back to that request.

Be sure to generate a unique MS (Merchant Session) value for each payment attempt. The usual situation where this catches people out is when a payment attempt returns with an error and another attempt is made to pay for the same order. In our view this is a new and different payment and requires a new MS value.

Our code sample is downloadable from our Github, see the link below. Our Github contains a variety of other resources including resources for our old API format. We recommend checking out our Postman collections on Github during your development.

PHP sample code

Paystation API site

Paystation API site (pre 2024)

Paystation Github

Back to Top