September 2018
Intermediate to advanced
266 pages
7h 26m
English
With the intent set up, we can create the Lambda. Create a new folder called checkout and add an index.js file. In your folder, we need to run npm install --save aws-sdk. We are going to start with the node 8.10 handler with the confirmationStatus check for a denied status. We may want to trigger this intent with confirmIntent in the future:
exports.handler = async (event) => { if (event.currentIntent && event.currentIntent.confirmationStatus === "Denied") { let message = `Would you like to find another product?`; let intentName = 'productFind'; slots = { type: null, size: null, colour: null, length: null, itemNumber: null }; return Lex.confirmIntent({ intentName, slots, message }) } return handleCheckout(event);}
We have ...
Read now
Unlock full access