Api for SMZ and hashconnect
Run server locallynode index.js
Server uses API mentioned below (see ./src
directory for more details):
smz.getStatus
const ruid = await smz.getStatus(token, inn);
-
token
String. The bearer access token for smz-api. -
inn
String. Individual tax number of the user. -
Returns id of the request.
Get info about user using his individual tax number.
smz.bindPartner
const ruid = await bindPartner(token, inn);
-
token
String. The bearer access token for smz-api. -
inn
String. Individual tax number of the user. -
Returns id of the request.
Bind user to the partner's app using user's individual tax number
smz.getAuthToken
const token = await smz.getAuthToken(username, password, clientId);
-
username
String. Partner app name. -
clientId
String. It's equal to "smz". -
password
String. Partner app password. -
Returns access token.
smz.waitRequest
const payloadStatus = await waitRequest(token, ruid);
-
token
String. The bearer access token for smz-api. -
ruid
String. Unique request identifier. -
Returns response body
Wait for the reuest status change.
hashconnect.createPaymentLink
const url = await createPaymentLink(siteId, ruid, pageParams, price);
-
siteId
String. Unique identifier (shoud be given by Hashconnect) -
pageParams
String. Links where user should be redirected from the payment page -
price
String. Price of the deal -
ruid
String. Unique request identifier. -
Returns payment link
Creates payment and returns url where user should redirected.