This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xeroClient.core.invoices.getInvoice(req.body.invoiceID, null, null, null, null, "application/pdf") | |
.then((data) => { | |
console.log(`data ${JSON.stringify(data)}`); | |
fs.writeFile(data.FileName, data.PdfContentRaw, 'binary', function(){ | |
// Do something with the file | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function authoriseRedirect(req, res) { | |
const xeroClient = getXeroClient(); | |
xeroClient.getRequestToken((err, token, secret) => { | |
if (err) return handleErr(err, res); | |
console.log('authoriseRedirect token: ' + token); | |
console.log('authoriseRedirect secret: ' + secret); | |
req.session.oauthRequestToken = token; | |
req.session.oauthRequestSecret = secret; | |
const data = { | |
authoriseURL: xeroClient.buildAuthorizeUrl(token), |