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

<?php
$secret = 'GB%^&*YJni677';
$data = array(
'shop_id'=>'D0F98E7D7742609DC508D86BB7500914',
'amount'=>100,
'currency'=>'RUB',
'order_id'=>'123',
);
ksort($data);
$str = http_build_query($data);
$sign = md5($str . $secret);

Attention! If the test payment flag test = 1 was passed to the payment form, this parameter also participates in the formation of the signature:

<?php
$secret = 'GB%^&*YJni677';
$data = array(
'shop_id'=>'D0F98E7D7742609DC508D86BB7500914',
'amount'=>100,
'currency'=>'RUB',
'order_id'=>'123',
'test'=>1,
);
ksort($data);
$str = http_build_query($data);
$sign = md5($str . $secret);

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:

<form action="https://pay.roskassa.net/form/" method="post">
<input type="hidden" name="shop_id" value="D0F98E7D7742609DC508D86BB7500914">
<input type="hidden" name="amount" value="100">
<input type="hidden" name="order_id" value="123">
<input type="hidden" name="lang" value="ru">
<input type="hidden" name="currency" value="RUB">
<input type="hidden" name="payment_system" value="11">
<input type="hidden" name="fields[email]" value="[email protected]">
<input type="hidden" name="sign" value="e51845e62b106d245cc96c431d8aae42">
<input type="submit" value="Оплатить">
</form>