A gestpay starter example in php5+
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.
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 |
README.md |
this file |
open the file index.php
and change
$shopLogin = 'GESPAYXXXXX';
with your shopLogin
.
start this webapp on a server with a public IP.
<<your_server_address>>/response.php
<<your_server_address>>/response.php
<<your_server_address>>/response.php
response.php
to see the outcome of the transaction.If you want to see the request you send to Gestpay:
Declare the SoapClient with the trace
option set to true:
$client = new SoapClient($wsdl, array('trace' => 1));
write this line after the request:
echo "REQUEST:\n<pre>" . htmlentities($client->__getLastRequest()) . "</pre>\n";
For any questions, open an issue on Github. We will gladly put off our mojito and answer.