Basic Implementation

 

How to use the Basic Implementation
Parameters description
How to test your service
IPN
IPN Parameters description

 


 

How to use the basic implementation

First you must create a new service, you can do this here.
The code below is ready to use. Just copy the piece of code into your web page and you will be ready to charge.
You can always edit your service from your control panel, you will be able to control on which countries you want to charge and which payment methods you want to accept.

<form name="pg_frm" method="post" action="https://www.paygol.com/pay" >
   <input type="hidden" name="pg_serviceid" value="123">
   <input type="hidden" name="pg_currency" value="EUR">
   <input type="hidden" name="pg_name" value="DEMO">
   <input type="hidden" name="pg_custom" value="">
   <input type="hidden" name="pg_price" value="1">
   <input type="hidden" name="pg_return_url" value="http://www.paygol.com/webapps/implementation">
   <input type="hidden" name="pg_cancel_url" value="">
   <input type="image" name="pg_button" src="https://www.paygol.com/webapps/img/buttons/150/black_en_pbm.png" border="0" alt="Make payments with Paygol: the easiest way!" title="Make payments with Paygol: the easiest way!" >     
</form>
 

Parameters description

The following POST/GET parameters are required:

 

How to test your service

Go to your control panel, click on My Services, then change your service’s settings from Enabled to Testing. This will enable your service’s test mode, so you can test it directly with no need to spend real money (just click OK on your payment screen and a successful payment will be simulated).

Please note that you don’t need to send messages, make calls or any other similar action in order to test your service.

 

IPN

What is IPN?
Instant Payment Notification (IPN) is a message service that notifies you of events related to Paygol transactions. You can use it to automate back-office and administrative functions, such as fulfilling orders, inserting points or coins, upgrading membership, tracking customers, and providing status and other information related to a transaction.

Information about the payment
Paygol makes a GET request to your IPN file when your customer completes the transaction. You can use this notification to kick-off order fulfillment, enable digital media downloads, store information in a customer relationship management (CRM) or accounting system, and so on.

How to receive the IPN information in my web page?
Paygol provides samples of Instant Payment Notification (IPN) code for popular development environments. Use working sample code to speed up your Paygol integrations.

Example:

<?php 

$secret_key = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee";  // Enter secret key for your service. 

// Secret key validation 
if ($secret_key != $_GET['key']) {
    echo "Validation error"; 
    exit;
}

// get the variables from Paygol system
$transaction_id	  = $_GET['transaction_id'];
$service_id	      = $_GET['service_id'];
$shortcode	       = $_GET['shortcode'];
$keyword	         = $_GET['keyword'];
$message	         = $_GET['message'];
$sender	          = $_GET['sender'];
$operator	        = $_GET['operator'];
$country	         = $_GET['country'];
$custom	          = $_GET['custom'];
$points	          = $_GET['points'];
$price	           = $_GET['price'];
$currency	        = $_GET['currency'];

// Here you can do whatever you want with the variables, for instance inserting or updating data into your Database 

?>
 

IPN Parameters description