What is IPN?
Instant Payment Notification (IPN) is a 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 will make a GET request to your IPN file when your customer completes a 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. For custom IPN files, you can use the following sample code as a starting point.
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']; $country = $_GET['country']; $custom = $_GET['custom']; $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
Parameter | Description |
transaction_id | The ID of the transaction. |
service_id | The Service ID of your account. |
country | The country code of your customer specified in ISO 3166 (e.g. EN, ES, FR, DE, etc.). |
custom | The custom field specified in your original form. |
key | The Secret Key of your account, used to validate payment notifications. |
price | The price of the product in the transaction. |
currency | The currency code of the transaction (e.g. EUR, USD, GBP, MXN, etc.). |
frmprice | The original price from your payment button code. You can use this for validation. |
frmcurrency | The original currency from your payment button code. You can use this for validation. |
method | The payment method used by the payer. |