Back button
back

SCI: How easily start accepting payments just after 5 mins after the registration?

Before we explain the quick way of start accepting payments via SCI, we recommend checking API vs SCI article.

In order to start receiving payments immediately via SCI, it is necessary to add a code on your website.

Code for SCI form generation:

<?php

$res = [

    'amount' => '',

     'in_curr' => '',

     'payway' => '',

     'merchant' => '',

     'merchant_payfee' => '',

     'client_email' => '',

     'externalid' => uniqid(),

     'redirect_url' => '',

     'callback_url' => ''

];

$res['sign'] = sign_form_data('SCI key', $res);

function sign_form_data($key, $data) {

 ksort($data);

 $s = '';

 foreach($data as $k=>$value) {

  if (in_array(gettype($value), array('array', 'object', 'NULL')) ){

    continue;

   }    

if(is_bool($value)){

     $s .= $value ? "true" : "false";

   } else {

     $s .= $value;

   }

 }  

return hash_hmac('sha512', strtolower($s), $key);

}

?>

<form name="payment" method="post" action="https://sci.any.money/invoice" accept-charset="UTF-8">

<?php foreach ($res as $k=> $v): ?>

<input type="hidden" name="<?= $k; ?>" value="<?= $v; ?>"/>

<?php endforeach; ?>

<input type="submit" value="PAY">

</form>

In the code it is necessary to edit "SCI key" with the merchant's secret key.


You also need to set a value for the parameters in the $ res variable.

It is obligatory to indicate:

- merchant's id ("merchant");

- the amount of the invoice ("amount");

- invoice currency ("in_curr");

- as well as the invoice id ("externalid");


The rest of the parameters are optional and may have a null / empty value (null) or be completely removed from the request.


The "Pay" button can be built into the "Pay" button on the website under the product, or it can be simply placed on a separate page.