Answer the question
In order to leave comments, you need to log in
Wrong secret when working with the Cryptonator API?
Hello, I work with the cryptonator
API. I
wrote this piece of code
let path = `/balance`
let value = Number(1)
let currency = 'bitcoin'
let language = 'ru'
let item_name = 'new'
let url = `${config.payment.url}createinvoice`
let string = `${config.payment.id}&${item_name}&${currency}&${value}&${currency}&${language}&${config.payment.secret}`
let secret_hash = crypto.createHash('sha1').update(string).digest('hex')
let form = {
merchant_id: config.payment.id,
item_name: item_name,
checkout_currency: currency,
invoice_amount: value,
invoice_currency: currency,
language: language,
secret_hash: secret_hash
}
console.log(form)
let headers = {
'content-type' : 'application/x-www-form-urlencoded',
'charset': 'utf-8'
}
request.post({
headers: headers,
url: url,
form: form
}, function(err, response, body) {
console.log("Get response: " + response.statusCode)
console.log(body)
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question