Payouts

Introduction

This api allows you to deposit money in the bank account of a customer. The deposit will always be in local currency. Once the wire is confirmed by the bank, Paygol will send a notification to your merchant notification url informing you of the wire result code. The notification URL is defined by default by the merchant. These parameter can be over-ridden at any time using the notification parameter (however, this new url is only active for that particular cashout, following which we will revert to the default URL previously provided).
    https://payouts.paygol.com/api/v1

Signature of message

All requests to the payment API must be signed using the merchant’s secret key with the HMAC SHA256 algorithm. The signature must be calculated using the payload of the request, sorted in ascending order and adding this result in a request header with the name X-PG-SIG.
<?php 

/**
 * Merchant shared secret
 *
 * @var string
 */
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

$payload = [...];

ksort($payload, SORT_NATURAL | SORT_FLAG_CASE);

$signature = hash_hmac('sha256', json_encode($payload), $shared_secret);

Get an authentication access token

    GET /auth/token
<?php 

/**
 * Merchant service ID
 *
 * @var int
 */
$service_id = "123";
/**
 * Merchant shared secret
 *
 * @var string
 */
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

$payload = json_encode(['pg_serviceid' => $service_id]);

$signature = hash_hmac("sha256", $payload, $shared_secret);

// API URL
$url = 'https://payouts.paygol.com/api/v1/auth/token';

$opts = [
    'http' => [
        'method' => 'GET',
        'header' => [
            'Content-type: application/json',
            'X-PG-SIG: ' . $signature,
        ],
        'content' => $payload,
    ],
];

$context = @stream_context_create($opts);

$json_response = @file_get_contents($url, false, $context);

$result = json_decode($json_response, true);

$token = $result['token'];

Request Payouts

Parameters description
Field Type Description Requirement
pg_serviceid Integer Merchant service ID required
pg_token String A valid authentication access token required
pg_mode String Payout required
payouts Array Array of Payout objects (max. 1500) required
payout Payout object Payout object required
beneficiary Beneficiary object Beneficiary object required
account Account object Account object required
Payout object
Field Type Description Requirement
id String (Max. 64 chars) Unique merchant payout ID required
country String (2 chars) The user’s country. ISO 3166-1 alpha-2 code required
amount Decimal (max. 2 decimal numbers) Payout amount (in the currency entered in the field “currency”) required
currency String (3 chars) ISO 4217 curency code required
beneficiary Beneficiary object Beneficiary object required
account Account object Account object required
details String (max. 255 chars) Optional information optional
Beneficiary object
Field Type Description Requirement
type String person | company required
full_name String (Max. 128 chars) Person or Company name required
first_name String (Max. 32 chars) Beneficiary first name required for beneficiary type person
last_name String (Max. 32 chars) Beneficiary last name required for beneficiary type person
surname String (Max. 32 chars) Beneficiary surnaame optional
document_type String Beneficiary’s personal identification type. See document validation information required
document_number String (Max. 32 chars) Beneficiary’s personal identification number required
document_dv String (Max. 2 chars) Verification digit required
email String (Max. 128 chars) Email of the beneficiary optional
Account object
Field Type Description Requirement
bank_code String (5 chars) Beneficiary’s bank code. See bank codes required
bank_name String (max. 32 chars) Beneficiary’s bank name. See bank names optional
number String (max. 64 chars) Beneficiary’s bank account number required
type String (5 chars) The type of account. See account types required
    POST /payouts
<?php 

/**
 * Merchant service ID
 *
 * @var int
 */
$service_id = "123";
/**
 * Merchant shared secret
 *
 * @var string
 */
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

// Get an authentication access token
$token = '302ec9c75bf9390db75959e2eded9ae3f5cdb7c1';

// Unique merchant payout ID
$uniqueid = $service_id . '-' . rand(10000, 99999);

$payload = [
    'pg_mode' => 'strict',
    'pg_serviceid' => $service_id,
    'pg_token' => $token,
    'payouts' => [
        [
            'id' => $uniqueid,
            'country' => 'CL',
            'amount' => 1000000.00,
            'currency' => 'CLP',
            'beneficiary' => [
                'type' => 'person',
                'full_name' => 'Robert Pani Hernandez',
                'first_name' => 'Robert',
                'last_name' => 'Pani',
                'surname' => 'Hernandez',
                'document_type' => 'cl_rut',
                'document_number' => '14555555',
                'document_dv' => '4',
                'email' => '[email protected]',
            ],
            'account' => [
                'bank_code' => 'CL001',
                'number' => '002555-343456',
                'type' => 'FP001',
            ],
            'details' => 'Debt payment',
        ],
    ],
];

// sort payload
ksort($payload, SORT_NATURAL | SORT_FLAG_CASE);

$payload = json_encode($payload);

$signature = hash_hmac("sha256", $payload, $shared_secret);

// API URL
$url = 'https://payouts.paygol.com/api/payouts';

$opts = [
    'http' => [
        'method' => 'POST',
        'header' => [
            'Content-type: application/json',
            'X-PG-SIG: ' . $signature,
        ],
        'content' => $payload,
    ],
];

$context = @stream_context_create($opts);

$json_response = @file_get_contents($url, false, $context);

Response
{
  "data": {
    "mode": "strict",
    "inserted_rows": 1,
    "error_rows": 0,
    "mode": "strict",
    "payouts": [{
      "payout_id": "pay_5d711e7f6b9598-37174324",
      "country": "CL",
      "amount": 1000000.00,
      "currency": "CLP",
      "external_id": "merchant-id-5d711e7ec9525666850",
      "full_name": "Robert Pani Hernandez",
      "first_name": "Robert",
      "last_name": "Pani",
      "surname": "Hernandez",
      "document_type": "cl_rut",
      "document_number": "14555555",
      "document_dv": "4",
      "email": "[email protected]",
      "bank_code": "CL001",
      "account_type": "FP001",
      "account_number": "002555-343456",
      "details": "Pago remuneracion USD",
      "status": "created"
    }]
  },
  "result": 0
}

Check status

Check the status of a payout
Field Type Description Requirement
pg_serviceid Integer Merchant service ID required
pg_token String A valid authentication access token required
external_id String (max. 64 chars) Payout ID (at the merchant site) required
    POST /payouts/status
<?php 

/**
 * Merchant service ID
 *
 * @var int
 */
$service_id = "123";
/**
 * Merchant shared secret
 *
 * @var string
 */
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

// Get an authentication access token
$token = '302ec9c75bf9390db75959e2eded9ae3f5cdb7c1';

$payload = [
    'pg_serviceid' => $service_id,
    'pg_token' => $token,
    'external_id' => 'merchant-id-859649'
];

// sort payload
ksort($payload, SORT_NATURAL | SORT_FLAG_CASE);

$payload = json_encode($payload);

$signature = hash_hmac("sha256", $payload, $shared_secret);

// API URL
$url = 'https://payouts.paygol.com/api/payouts/status';

$opts = [
    'http' => [
        'method' => 'POST',
        'header' => [
            'Content-type: application/json',
            'X-PG-SIG: ' . $signature,
        ],
        'content' => $payload,
    ],
];

$context = @stream_context_create($opts);

$json_response = @file_get_contents($url, false, $context);

Response
{
  "data": {
    "country": "CL",
    "amount": 1000000,
    "currency": "CLP",
    "merchant_payout_id": "merchant-id-859649",
    "pay_at": null,
    "full_name": "Robert Pani Hernandez",
    "first_name": "Robert",
    "last_name": "Pani",
    "surname": "Hernandez",
    "document_type": "cl_rut",
    "document_number": "14555555",
    "document_dv": "4",
    "email": "[email protected]",
    "bank_code": "CL001",
    "account_number": "002555-343456",
    "account_type": "FP001",
    "details": "Debt payment",
    "status": "created",
    "events": []
  },
  "result": 0
}

Get payouts

Get a list of payouts
Field Type Description Requirement
pg_serviceid Integer Merchant service ID required
pg_token String A valid authentication access token required
status String A valid Paygol payout status. See status table optional
group_id String A valid group_id returned by paygol optional
limit Integer > 0 Maximum number of results (default 50) optional
page Integer > 0 Page number(default 1) optional
    POST /payouts/list
<?php 

/**
 * Merchant service ID
 *
 * @var int
 */
$service_id = "123";
/**
 * Merchant shared secret
 *
 * @var string
 */
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

// Get an authentication access token
$token = '302ec9c75bf9390db75959e2eded9ae3f5cdb7c1';

$payload = [
    'pg_serviceid' => $service_id,
    'pg_token' => $token,
    'status' => 'created',
    'limit' => 5,
    'page' => 2
];

// sort payload
ksort($payload, SORT_NATURAL | SORT_FLAG_CASE);

$payload = json_encode($payload);

$signature = hash_hmac("sha256", $payload, $shared_secret);

// API URL
$url = 'https://payouts.paygol.com/api/payouts/list';

$opts = [
    'http' => [
        'method' => 'POST',
        'header' => [
            'Content-type: application/json',
            'X-PG-SIG: ' . $signature,
        ],
        'content' => $payload,
    ],
];

$context = @stream_context_create($opts);

$json_response = @file_get_contents($url, false, $context);

Response
{
  "data": {
    "items": [
      {
        "country": "CL",
        "amount": 58509,
        "currency": "CLP",
        "merchant_payout_id": "77722",
        "pay_at": null,
        "full_name": "Roberto Pani 5o",
        "first_name": "Roberto",
        "last_name": "Pani",
        "surname": null,
        "document_type": 1,
        "document_number": "23708467",
        "document_dv": "4",
        "email": null,
        "bank_code": "CL001",
        "account_number": "0002555-1232137",
        "account_type": "FP001",
        "details": null,
        "status": "created"
      },
      {...},
      {...},
      {...},
      {...}
    ],
    "total": 118,
    "current_page": 2,
    "last_page": 24,
    "per_page": 5
  },
  "result": 0
}

Cancel payout

This action cancels a payout. The status of the payout should be ‘created’.
Field Type Description Requirement
pg_serviceid Integer Merchant service ID required
pg_token String A valid authentication access token required
external_id String (max. 64 chars) Payout ID (at the merchant site) required
    POST /payouts/cancel
<?php 

/**
 * Merchant service ID
 *
 * @var int
 */
$service_id = "123";
/**
 * Merchant shared secret
 *
 * @var string
 */
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

// Get an authentication access token
$token = '302ec9c75bf9390db75959e2eded9ae3f5cdb7c1';

$payload = [
    'pg_serviceid' => $service_id,
    'pg_token' => $token,
    'external_id' => 'merchant-id-859649'
];

// sort payload
ksort($payload, SORT_NATURAL | SORT_FLAG_CASE);

$payload = json_encode($payload);

$signature = hash_hmac("sha256", $payload, $shared_secret);

// API URL
$url = 'https://payouts.paygol.com/api/payouts/cancel';

$opts = [
    'http' => [
        'method' => 'POST',
        'header' => [
            'Content-type: application/json',
            'X-PG-SIG: ' . $signature,
        ],
        'content' => $payload,
    ],
];

$context = @stream_context_create($opts);

$json_response = @file_get_contents($url, false, $context);

Response
{
  "data": {
    "id": "merchant-id-859649",
    "old_status": "created",
    "new_status": "canceled"
  },
  "result": 0
}

Webhook notifications

With webhooks, we give you the possibility to react automatically to certain events which happen within our system. A webhook is basically a URL where we send an HTTP POST request to, every time one of the events attached to that webhook is triggered.
Event code Description
payout.created The payout transaction has been created in the system and is awaiting an action.
payout.delivered The payout transaction has been sent to the bank for processing.
payout.paid The payout transaction has been paid.
payout.canceled The payout transaction has been canceled by the merchant.
payout.failed The payout has not been completed by mistake of the bank or beneficiary information
<?php 

/**
 * Merchant shared secret
 *
 * @var string
 */
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

try {
    $headers = getallheaders();

    $content_json  = file_get_contents('php://input');

    $payload = json_decode($content_json, true);

    $signature = hash_hmac("sha256", json_encode($payload), $shared_secret);

    if (empty($headers['X-Pg-Sig']) || $headers['X-Pg-Sig'] !== $signature) {
        throw new \Exception('Invalid signature');
    }

    http_response_code(200);
    echo json_encode(['OK']);
} catch (\Exception $e) {
    http_response_code(401);
    echo json_encode(['error' => $e->getMessage()]);
}

Document validation information.

Country Code Document Type Verification digit
Argentina ar_cuit CUIT Numeric (11) Last digit
Argentina ar_cuil CUIL Numeric (11) Last digit
Brazil br_cpf CPF Numeric (11) Last two digits
Brazil br_cnpj CNPJ Numeric (14) Last two digits
Chile cl_rut RUT Alphanumeric (8/9) Last digit

Bank codes

Codes for bank_code parameter.
Chile
Bank Code
Banco Del Estado De Chile CL001
Banco Bbva ( Bilbao Vizcaya Argentaria Chile) / Banco Bhif CL002
Banco Bice CL003
Banco Consorcio CL004
Banco Corpbanca CL005
Banco De Chile / Banco A. Edwards / Credichile / Citybank CL006
Banco De Crédito E Inversiones / Tbanc CL007
Banco Del Desarrollo CL008
Banco Falabella CL009
Banco Internacional CL010
Banco Itau Chile / Bank Boston CL011
Banco Ripley CL012
Banco Santander – Santiago / Banco Santander / Banefe CL012
Banco Security CL014
Coopeuch CL015
Hsbc Bank (Chile) CL016
Scotiabank / Sud – Americano CL017

Account types codes

Codes for account types.
Chile
Method Bank Code
Cuenta Corriente / Cueta Vista All banks FP001
Cuenta de ahorro All banks FP002
Chequera electrónica Banco Estado FP003
Cuenta RUT Banco Estado FP004

Payout status

Available status codes.
Status Code Description
Created created Payout has been received
Delivered delivered Payout has been sent to the bank for payment
Paid paid Payout has been successfully completed
Canceled canceled Payout has been canceled by the merchant
Failed failed Payout has not been completed by mistake of the bank or beneficiary information
Instant Payment Notification V2 (IPN)

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/POST 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 of implementation

<?php 

use Paygol\Notification;

/**
 * Merchant service ID
 *
 * @var int
 */
$service_id = "123";
/**
 * Merchant shared secret
 *
 * @var string
 */
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

$ipn = new Notification($service_id, $shared_secret);

try {
    $ipn->validate();

    $params = $ipn->getParams();

    var_dump($params);
    
    // do something

    // Confirm reception
    $ipn->sendResponse(['OK'], 200);
} catch (\Exception $e) {
    $ipn->sendResponse(['error' => 'Validation error'], 400);
}

The above command returns JSON structured like this:

{
  "country": "ES",
  "currency": "USD",
  "custom": "Producto 1 - Producto 2 - Producto 3",
  "method": "teleingreso",
  "price": "10.00",
  "service_id": "123",
  "status": "completed",
  "transaction_id": "ZISS-A7Q8-RE2Z-S73W"
}

Notification handling

Handling notifications correctly is crucial to making sure your integration’s business logic works as expected.

 

Acknowledge notifications immediately

If your notification script performs complex logic, or makes network calls, it’s possible that the script would time out before Paygol sees its complete execution. Ideally, your notification handler code (acknowledging receipt of an event by returning a 2xx status code) is separate of any other logic you do for that event.

 

Handle duplicate notifications

IPN endpoints might occasionally receive the same notification more than once. We advise you to guard against duplicated notifications receipts by making your event processing idempotent. One way of doing this is logging the events you’ve processed, and then not processing already-logged events.

API Implementation

Overview
How to use the API Implementation
Parameter description
Payment methods
Search Payment Methods
Creating a Transaction
Transaction status
Status Definitions

 

Documentation for the implementation API v1.1.

Overview

Our API implementation offers a high level of customization, allowing you to implement an advanced white label payments solution directly on your platform in a fast and easy way.

This implementation is based in POST/GET requests to web-services which will return an JSON response. The response will contain a URL you can redirect your customer to in order to start the payment process.

How to use the API implementation

https://www.paygol.com/api/v2/

Parameters description

Payment methods

Name Coverage Code Description

Search Payment Methods

This function returns a list of valid payment methods for the requested country.

<?php

use \Paygol\API;
use \Paygol\Exceptions\InvalidParameterException;

/**
 * Merchant service ID
 *
 * @var int
 */
$service_id = "123";

/**
 * Merchant shared secret
 *
 * @var string
 */
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

try {
  $pg = new API($service_id, $shared_secret);

  $payment_methods = $pg->getPaymentMethods("de");

  var_dump($payment_methods);
} catch (\Exception $e) {
  die($e->getMessage());
}

Response

{
  "methods": {
    "creditcard": {
      "code": "creditcard",
      "name": "Credit Card",
      "image": "https://www.paygol.com/pay-now/images/method_button_creditcard.png"
    },
    "paysafecard": {
      "code": "paysafecard",
      "name": "Paysafecard",
      "image": "https://www.paygol.com/pay-now/images/method_button_paysafecard.png"
    },
    "bitcoin": {
      "code": "bitcoin",
      "name": "Bitcoin",
      "image": "https://www.paygol.com/pay-now/images/method_button_bitcoin.png"
    },
    "giropay": {
      "code": "giropay",
      "name": "Giropay",
      "image": "https://www.paygol.com/pay-now/images/method_button_giropay.png"
    }
  }
}


Creating a Transaction

Every single payment request in the API will generate a Transaction. Each Transaction is uniquely identified by Transaction ID. To obtain details about a Transaction you need to make a separate GET request.

<?php

use \Paygol\API;
use \Paygol\Models\Payer;
use \Paygol\Models\RedirectUrls;


/**
 * Merchant service ID
 *
 * @var int
 */
$service_id = "123";

/**
 * Merchant shared secret
 *
 * @var string
 */
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

try {
    $pg = new API($service_id, $shared_secret);

    $redirectUrls = new RedirectUrls();
    $redirectUrls->setRedirects(
        "https://www.my-site.com/success", 
        "https://www.my-site.com/failure"
    ); // optional

    $pg->setRedirects($redirectUrls);

    $pg->setCountry('DE');
    $pg->setPrice(11.00, 'EUR');
    $pg->setPaymentMethod('bitcoin');

    $payer = new Payer();
    $payer->setFirstName('John');
    $payer->setLastName('Doe');
    $payer->setEmail('[email protected]');
    $payer->setBIC('123423432');

    $pg->setPayer($payer);

    $payment = $pg->createPayment();

    var_dump( $payment );

    if (!empty($payment['data']['payment_method_url'])) {
        // do something
    }
} catch (\Exception $e) {
    die($e->getMessage());
}

The above command returns JSON structured like this:

{
  "data": {
    "service_id": "123",
    "transaction_id": "ABCD-ZZZZ-BIKE-R000",
    "status": "created",
    "payment_method": "bitcoin",
    "amount": "11.00",
    "currency": "EUR",
    "payment_method_url": "https://www.paygol.com/api/pay-direct/ABCD-ZZZZ-BIKE-R000",
    "custom":"internalID=918273645",
    "customer": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "[email protected]",
      "phone": "5699334453",
      "personal_id": "111111111",
      "country": "CL"
    },
    "redirect_urls": {
        "success_url": "https://www.my-site.com/success",
        "cancel_url": "https://www.my-site.com/failure"
      }
  },
}

Transaction status

<?php

use \Paygol\API;

/**
 * Merchant service ID
 *
 * @var int
 */
$service_id = "123";

/**
 * Merchant shared secret
 *
 * @var string
 */
$shared_secret = "7c1a6a24-7943-102d-92f8-29573711ad31";

try {
    $pg = new API($service_id, $shared_secret);

    $status = $pg->getPaymentStatus('1234-5678-ABCD-EFGH');

    var_dump( $status );
} catch (\Exception $e) {
    die($e->getMessage());
}

The above command returns JSON structured like this:

{
  "payment": {
    "service_id": "123",
    "transaction_id": "1234-5678-ABCD-EFGH",
    "status": "created",
    "payment_method": "bitcoin",
    "amount": "11.00",
    "currency": "EUR",
    "created_at": "2019-05-30 22:01:46",
    "completed_at": null,
    "custom":"internalID=918273645",
    "customer": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "[email protected]",
      "phone": "5699334453",
      "personal_id": "111111111",
      "country": "CL"
    }
  }
}

Status Definitions

Status Code Definition
Webcheckout

Web checkout implementation
Parameters description
Available Payment methods.

Web checkout Implementation

Below you will find a sample code for your payment button. Simply replace the example values as required and you’ll be ready to start receiving payments.

Parameters description

Parameter Type Description Requirement
pg_serviceid integer Service ID of your account. Mandatory
pg_price numeric The price of the product/service. Mandatory
pg_currency string Type of currency specified in alphabetic code ISO 4217 you want to use (eg: EUR, USD, GBP, MXN, etc.). See the full list of the currency codes. Mandatory
pg_country string Country of the payer, in ISO 3166-2 format (e.g. GB, DE, ES).
See the list of the country codes.
Mandatory
pg_language string Language, in ISO 639-1 format (e.g. en, es). If the provided language is not available, defaults to english. optional
pg_method string Payment method. Please check the table below for a list of available payment methods and their codes. For more information regarding each payment method, please check our Pricing page. Mandatory only for whitelabel checkout
pg_name string Description of your product/service, which will be shown on the payment screen. optional
pg_custom string Custom field, can be used to identify customer, inventory, etc. optional
pg_email string Email address of the payer. Mandatory only for whitelabel checkout
pg_phone string Phone number of the payer. Mandatory only for whitelabel checkout for some payment methods.
pg_first_name string First name of the payer. Mandatory only for whitelabel checkout
pg_last_name string Last name of the payer. Mandatory only for whitelabel checkout
pg_personalid string Local personal ID number of the payer. Mandatory only for whitelabel checkout for some payment methods
pg_sub_merchant_url string optional
pg_sub_merchant_id string optional
pg_return_url string After the payment process your customers will be redirected here (e.g. https://www.mysite.com/thanks). optional
pg_cancel_url string Your customer will be redirected to after a cancelled or failed payment process (e.g. https://www.mysite.com/failed). optional

Available Payment methods:

Name Code Description

Credit Card

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory

Bitcoin

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory

Webpay

pg_country Mandatory
pg_email Mandatory

Multicaja

pg_country Mandatory
pg_email Mandatory

Servipag

pg_country Mandatory
pg_email Mandatory

PagoEfectivo

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory
pg_phone Mandatory

Pago Facil

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory

Rapipago

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory

Paysafecard

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory

Giropay

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory (Use this field for BIC)

iDEAL

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory

Sofort

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory

Przelewy24

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory

Bancontact

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory

Bradesco

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory
pg_phone Mandatory (Format E.g.: 5531123456789)

OXXO

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory

Itaú

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory
pg_phone Mandatory (Format E.g.: 5531123456789)

Davivienda

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory

Boleto

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory

Redpagos

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory

Santander Brasil

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory
pg_phone Mandatory (Format E.g.: 5531123456789)

Santander México

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory

Banco do Brasil

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory
pg_phone Mandatory (Format E.g.: 5531123456789)

PSE

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory

Efecty

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
pg_personalid Mandatory

ViaBaloto

pg_country Mandatory
pg_email Mandatory
pg_first_name Mandatory
pg_last_name Mandatory
Instant Payment Notification (IPN)

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