Gateway API
curl --location --request POST 'https://api.freedompay.kz/init_payment.php' \
--form 'pg_order_id=23' \
--form 'pg_merchant_id={{paybox_merchant_id}}' \
--form 'pg_amount=25' \
--form 'pg_description=test' \
--form 'pg_salt=molbulak' \
--form 'pg_sig={{paybox_signature}}'
# Пример подписи:
'init_payment.php;25;test;{{paybox_merchant_id}};23;molbulak;{{secret_key}}'
$pg_merchant_id = {{paybox_merchant_id}};
$secret_key = {{paybox_merchant_secret}};
$request = [
'pg_merchant_id'=> $pg_merchant_id,
'pg_order_id' => 1234,
'pg_amount' => 100,
'pg_payment_to' => 4405645000006150,
'pg_description' => 'Описание платежа',
'pg_post_link' => 'http://site.kz/post',
'pg_salt' => 'some random string',
];
//generate a signature and add it to the array
ksort($request); //sort alphabetically
array_unshift($request, 'p2p2nonreg');
array_push($request, $secret_key);
$request['pg_sig'] = md5(implode(';', $request));
unset($request[0], $request[1]);
Диаграммы взаимодействия