The API key for accessing the REST service roskassa.net can be generated on the store settings page https://my.roskassa.net/shop-settings/
All data in requests to the ROSKASSA service are transmitted using the POST method over the HTTP protocol to the address https://api.roskassa.net/*method*. The message parameters are packed into a JSON object.
A signature must be sent along with the request. It is necessary to sign the request body in its entirety, in the form in which it is sent to the Bank's server (after serializing the request body to JSON for sending via HTTP ).
Use your private key to sign. Generate SHA-256 signature.
<?php$api_key = 'EEFA1913EA9D9351469B1E5D852A';$data = array('shop_id' =>'1913EA9D9351469B1E5D852A','nonce' => time(),);$body = json_encode($data);$sign = hash_hmac('sha256', $body, $api_key);$curl = curl_init();curl_setopt_array($curl, array(CURLOPT_URL => "https://api.roskassa.net/orders/",CURLOPT_RETURNTRANSFER => true,CURLOPT_CUSTOMREQUEST => "POST",CURLOPT_POSTFIELDS =>$body,CURLOPT_HTTPHEADER => array("Authorization: Bearer $sign","Content-Type: application/json"),));$response = curl_exec($curl);curl_close($curl);echo $response;