Create payment
With Roskassa, both the seller and the buyer receive an “electronic cashier”, which greatly simplifies transactions and speeds up payments.
To create a payment, you need to transfer the necessary parameters to a special url https://pay.roskassa.net/?params
Required parameters
Ключ
Описание
shop_id
Public key of the project
amount
Amount of payment
order_id
Order ID (payment number or customer email)
currency
Payment currency (RUB, USD, EUR)
sign
Request signature
Extra options
Ключ
Описание
lang
Interface language (ru, en)
test
If specified with the value "1" - payment will be carried out in test mode
payment_system
Payment system ID
success_url
Url of success
fail_url
Url errors
notify_url
Url notifications
To generate a signature, you need to sort all required parameters by key, combine key / value pairs with the & symbol and add your secret key to the end. Then hash the resulting MD5 string, for example
1
<?php
2
$secret = 'GB%^&*YJni677';
3
$data = array(
4
'shop_id'=>'D0F98E7D7742609DC508D86BB7500914',
5
'amount'=>100,
6
'currency'=>'RUB',
7
'order_id'=>'123',
8
);
9
ksort($data);
10
$str = http_build_query($data);
11
$sign = md5($str . $secret);
Copied!
Attention! If the test payment flag test = 1 was passed to the payment form, this parameter also participates in the formation of the signature:
1
<?php
2
$secret = 'GB%^&*YJni677';
3
$data = array(
4
'shop_id'=>'D0F98E7D7742609DC508D86BB7500914',
5
'amount'=>100,
6
'currency'=>'RUB',
7
'order_id'=>'123',
8
'test'=>1,
9
);
10
ksort($data);
11
$str = http_build_query($data);
12
$sign = md5($str . $secret);
Copied!
You can go directly to the payment system if you are ready to transfer all the data for payment in the incoming request. To do this, send the data using the POST method to the URL https://pay.roskassa.net/form/, be sure to specify the payment_system parameter and pass all the required fields for this payment method. In most cases, this is email, for more information please contact support.
Example:
1
<form action="https://pay.roskassa.net/form/" method="post">
2
<input type="hidden" name="shop_id" value="D0F98E7D7742609DC508D86BB7500914">
3
<input type="hidden" name="amount" value="100">
4
<input type="hidden" name="order_id" value="123">
5
<input type="hidden" name="lang" value="ru">
6
<input type="hidden" name="currency" value="RUB">
7
<input type="hidden" name="payment_system" value="11">
8
<input type="hidden" name="fields[email]" value="[email protected]">
9
<input type="hidden" name="sign" value="e51845e62b106d245cc96c431d8aae42">
10
<input type="submit" value="Оплатить">
11
</form>
Copied!
Last modified 5mo ago
Copy link