coinbase / coinbase/coinbase-commerce-ruby
SyntaxError: Unexpected token o in JSON at position 1
- Dominant language
- Ruby
- Stars
- 35
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I seem to be getting error everytime and now I struck.
Here is my Node implementation of same validation:
let key = process.env.COINBASE_CALLBACK_SECRET;
let payload = {
"id": 1,
"scheduled_for": "2017-01-31T20:50:02Z",
"event": {
"id": "24934862-d980-46cb-9402-43c81b0cdba6",
...
}
}
}
=======================================
Code below
=======================================
function validate(payload, key){
let msg = JSON.parse(payload);
let hash = crypto.createHmac('sha256', key).update(msg);
// convert to hexits from binary
hash.digest('hex');
}
Kindly assist. Thanks.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.