Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { type: 'ISV',
- code: 'IncompleteSignature',
- message: 'The request signature does not conform to lazada standards',
- request_id: '0be6e79215428302067761224' }
- var sha256 = require('js-sha256');
- module.exports = function(app, Request){
- app.get('/', function(req,res){
- var access_token = "myToken";
- var app_key = "myAppKey";
- var order_id = "36835322434";
- var sign_method = "sha256";
- var timestamp = new Date().timestamp;
- var concatenatedString = "/order/items/getaccess_token"+access_token
- +"app_key"+app_key
- +"order_id"+order_id
- +"sign_method"+sign_method
- +"timestamp"+new Date().getTime();
- var hash = sha256.hmac.create("myAppSecret");
- hash.update(concatenatedString);
- var httpRequestLink = "http://api.lazada.co.th/rest/order/items/get?access_token="+access_token
- +"&app_key="+app_key
- +"&order_id="+order_id
- +"&sign_method="+sign_method
- +"×tamp="+new Date().getTime()
- +"&sign="+hash.hex();
- Request.get(httpRequestLink, (error, response, body) => {
- if(error) {
- return console.log(error);
- }
- console.log(JSON.parse(body));
- });
- });
- }
Add Comment
Please, Sign In to add comment