Original : https://github.com/slash-fi-public/slash-payments-minimum-merchant-api
npm init -y
npm install typescript ts-node
npm install @types/node -D
tsconfig.json
{
"compilerOptions": {
"module": "CommonJS",
"strict": true,
}
}
npm install axios yargs crypto
npm install @types/yargs
npx ts-node scripts/generate-payment-url.ts --help
--env, --environment testnet or mainnet [string] [default: "testnet"]
--auth, --authentication_token Authentication Token can be obtained from the Merchant Management screen [string] [required] [default: false]
--hash, --hash_token Hash Token can be obtained from the Merchant Management screen [string] [required] [default: false]
-o, --order_code The value set by the merchant to uniquely identify the payment [string] [required] [default: false]
-a, --amount The amount to be charged by your deposit currency. It is Zero or more.If the payer determines the amount to be paid, this field can be null. So this field is optional. [number] [default: false]
--theme, --color_theme dark or light [string] [default: "dark"]
--callback, --callback_url Custom Callback URL that will be called when the transaction’s status was changed [string] [default: false]
--help Show help [boolean]
npx ts-node scripts/generate-payment-url.ts --auth 0eee78a07b89c948050168521396d833 --hash 2de7aa4926d7b1c149dd57d6ead69fc0 -o t202302112252
-o order_code is uniquely identifed code ( need to change ).
{
"url": "https://testnet.slash.fi/payment/dcf9cfa16994442d3fa20fa6c12f8ae0",
"token": "dcf9cfa16994442d3fa20fa6c12f8ae0"
}
An API that POST from your store to SlashPayment. Required.
Original : https://slash-fi.gitbook.io/docs/integration-guide/apis/payment-request-api
### Authentication Token
AUTH_TOKEN = "0eee78a07b89c948050168521396d833";
### Hash Token
HASH_TOKEN = "2de7aa4926d7b1c149dd57d6ead69fc0";
### Code set by the merchant to uniquely identify the payment
order_code = "t202302112330"
python3 scripts/slash_req.py
{'identification_token': '0eee78a07b89c948050168521396d833', 'order_code': 't202302112330', 'verify_token': '906442201cf348fb4264450172a5e509350ae7e36da604824f25d563b73f2537'}
200
{"url":"https:\/\/testnet.slash.fi\/payment\/77ed979cad9e1326e5cea7a8f618fa7f","token":"77ed979cad9e1326e5cea7a8f618fa7f"}
get url ( delete back slash )