Skip to content
A gestpay starter example in php5+
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

Example payment via Gestpay Payment Page in PHP 5(+)

This repository is an example project to show how to implement a payment via Gestpay payment page.

The payment process is explained in Gestpay Docs - Getting Started - see in particular Using Banca Sella Payment Page.

This repo uses the native SOAP extensions, present in PHP5+. If you are in a lower version of php, check php4 repository.

What's in this repository

File Description
index.php is the main entry point for the application. tweaking this page you will be able to change the amount, or the currency, and so on.
response.php when the payment is completed, Gestpay will redirect to this file to show to the user the payment status. response.php will decrypt the encrypted string and then it will show the SOAP message received - in the form of an array.
phpinfo.php A simple page to check your php version and your server software.
functions.php a file containing utility functions this file

How to start the example

  1. open the file index.php and change
$shopLogin = 'GESPAYXXXXX';

with your shopLogin.

  1. start this webapp on a server with a public IP.
  2. Connect to your test merchant back-office and login
  3. In Configuration > IP address, insert the public IP of your server
  4. In the same page click on Response Address and insert:
    • URL for positive response: <<your_server_address>>/response.php
    • URL for negative response: <<your_server_address>>/response.php
    • URL Server to Server: <<your_server_address>>/response.php
  5. Pay with one of the cards present in the Notification page.
  6. Once you have payed, you'll be redirected by Gestpay on response.php to see the outcome of the transaction.


If you want to see the request you send to Gestpay:

  1. Declare the SoapClient with the trace option set to true:
$client = new SoapClient($wsdl, array('trace' => 1));
  1. write this line after the request:
echo "REQUEST:\n<pre>" . htmlentities($client->__getLastRequest()) . "</pre>\n";

Questions, Issues, etc.

For any questions, open an issue on Github. We will gladly put off our mojito and answer.

You can’t perform that action at this time.