Get payment status

Receive payment status
Request

curl --location --request POST 'https://api.freedompay.money/get_status3.php' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_payment_id=123456789' \
--form 'pg_order_id=00102' \
--form 'pg_salt=some random string' \
--form 'pg_sig={{paybox_signature}}'
# Signature example:
'get_status.php;{{paybox_merchant_id}};00102;123456789;some random string;{{secret_key}}'
Reply

<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>123456789</pg_payment_id>
    <pg_can_reject>1</pg_can_reject>
    <pg_payment_method>bankcard</pg_payment_method>
    <pg_amount>10</pg_amount>
    <pg_currency>KZT</pg_currency>
    <pg_payment_status>success</pg_payment_status>
    <pg_clearing_amount>10</pg_clearing_amount>
    <pg_reference>123456789</pg_reference>
    <pg_card_name>Card Holder</pg_card_name>
    <pg_card_pan>5483-18XX-XXXX-0293</pg_card_pan>
    <pg_card_token>ef741cfc-f85e-41a0-84e6-2ba964912182</pg_card_token>
    <pg_refund_payments>
        <pg_refund_payment>
            <pg_payment_id>123456789</pg_payment_id>
            <pg_payment_status>success</pg_payment_status>
            <pg_amount>-10</pg_amount>
            <pg_payment_date>2023-05-31 16:26:36</pg_payment_date>
            <pg_reference>123456789</pg_reference>
        </pg_refund_payment>
    </pg_refund_payments>
    <pg_refund_amount>-10</pg_refund_amount>
    <pg_captured>1</pg_captured>
    <pg_create_date>2023-05-31 16:24:20</pg_create_date>
    <pg_salt>some random string</pg_salt>
    <pg_sig>your_signature</pg_sig>
</response>

The merchant can request the FreedomPay status of any payment initiated by the merchant. This can be useful, for example, if the Result URL call was not received by the merchant due to a temporary communication failure, and the buyer has already been transferred to the Success URL, but the status of the transaction is not yet known to the merchant.
Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};

$request = [
    'pg_merchant_id'=> $pg_merchant_id,
    'pg_payment_id' => 123456789,
    'pg_salt' => 'some random string',
];

//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'get_status3.php');
array_push($request, $secret_key);

$request['pg_sig'] = md5(implode(';', $request)); // signature

unset($request[0], $request[1]);

Request URL

POST https://api.freedompay.money/get_status3.php

Request fields
Response parameters
Array for pg_revoked_payments/pg_refund_payments
Capture

The store can independently request clearing from the bank via FreedomPay, if the bank is configured to make payments in two steps - authorization and clearing. If the system is configured accordingly, after the transaction is completed, the transaction will be authorized, but not calculated. The maximum debit delay time is 5 days and can be adjusted on the FreedomPay side from 1 to 5 days.
Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};

$request = [
    'pg_merchant_id'=> $pg_merchant_id,
    'pg_payment_id' => 12345,
    'pg_clearing_amount'=> 10,
    'pg_salt' => 'some random string',
];

//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'do_capture.php');
array_push($request, $secret_key);

$request['pg_sig'] = md5(implode(';', $request)); // signature

unset($request[0], $request[1]);

Request URL

POST https://api.freedompay.money/do_capture.php

Request fields
Response parameters
Payment cancellation
The Merchant can cancel an invoice that has been issued but not yet paid. After this operation, FreedomPay will refuse to make a payment at the stage of checking the possibility of making a payment (if the SP supports this request). In addition, the account is canceled in those PSs that support this operation. Thus, the cancellation of the invoice does not guarantee the impossibility of its payment in all PSs.
Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};

$request = [
    'pg_merchant_id'=> $pg_merchant_id,
    'pg_payment_id' => 12345,
    'pg_salt' => 'some random string',
];

//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'cancel.php');
array_push($request, $secret_key);

$request['pg_sig'] = md5(implode(';', $request)); // signature

unset($request[0], $request[1]);

Request URL

POST https://api.freedompay.money/cancel.php

Request fields
Response parameters
Payment refund

The Merchant can cancel a successfully completed payment if the payment system allows it (for example, Bank cards). In this case, the money is returned to the buyer. You can return both the full amount of the payment and part of the amount. You can make several partial refunds until the total amount of refunds reaches the amount of the original payment. You can cancel a payment both from the merchant's personal account, and in automatic mode by calling the script.
Signature generation:

$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};

$request = [
    'pg_merchant_id'=> $pg_merchant_id,
    'pg_payment_id' => 12345,
    'pg_refund_amount'=> 50,
    'pg_salt' => 'some random string',
];

//generate a signature and add it to the array
ksort($request); // sort alphabetically
array_unshift($request, 'revoke.php');
array_push($request, $secret_key);

$request['pg_sig'] = md5(implode(';', $request)); // signature

unset($request[0], $request[1]);

Request URL

POST https://api.freedompay.money/revoke.php

Request fields
Response parameters