{"_id":"@alexa-skill-components/checkout","_rev":"2-368d5ad034e9c30e15ffc5862649c7ce","name":"@alexa-skill-components/checkout","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@alexa-skill-components/checkout","version":"0.0.1","license":"AmznSL-1.0","_id":"@alexa-skill-components/checkout@0.0.1","maintainers":[{"name":"amazon-prachibh","email":"prachibh@amazon.com"},{"name":"amzn-aaditya","email":"aadified@amazon.com"},{"name":"abhjroy","email":"abhjroy@amazon.com"},{"name":"mattsb42-aws","email":"bullocm@amazon.com"},{"name":"amzn-anusha","email":"panuanu@amazon.com"},{"name":"anuprk","email":"anukatar@amazon.com"},{"name":"amzn-akeat","email":"akeat@amazon.com"},{"name":"amzn-oss","email":"osa-3p@amazon.com"}],"homepage":"https://github.com/alexa/skill-components#readme","bugs":{"url":"https://github.com/alexa/skill-components/issues"},"ask":{"srcDir":"src"},"dist":{"shasum":"217b6caf68d3739e4a2e9b7ad1213f91c987a428","tarball":"https://registry.npmjs.org/@alexa-skill-components/checkout/-/checkout-0.0.1.tgz","fileCount":27,"integrity":"sha512-8n1lOk2U0OE2kOHeeLXoU1pV+vVPtW+fAGfbtub++Snr/Pr47N0FAyx4q2haVPQcEvN095c1GTNxxWoF2SjaKQ==","signatures":[{"sig":"MEUCIEiAUlZSAxZxw7uhEiD2KMXMR5a2m6NYRvz/poMKM+8NAiEAxOj4KFg2aJVdQTjCdbXpq1QEZoGNsgjwwK20pCIpcIM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117671},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"79f0b9279ce234742cbfd612824616b065f5d67e","scripts":{"lint":"eslint --fix --max-warnings 0 -c .eslintrc.js 'src/**/*.{ts,tsx}'","test":"jest --testTimeout=10000","build":"npm run compile && npm pack","clean":"rm -rf dist && rm -rf build && rm -rf node_modules && rm -rf *.tgz","compile":"npm run compile-ts && npm run compile-acdl","release":"npm run build && npm run lint && npm run test","compile-ts":"tsc","clean-build":"npm run clean && npm install && npm run build","compile-acdl":"acc","clean-release":"npm run clean && npm install && npm run release"},"_npmUser":{"name":"amzn-aaditya","email":"aadified@amazon.com"},"publisher":"Amazon","repository":{"url":"git+ssh://git@github.com/alexa/skill-components.git","type":"git","directory":"checkout"},"_npmVersion":"9.5.1","description":"Alexa skill component to checkout","directories":{},"_nodeVersion":"18.16.0","dependencies":{"uuid":"^8.3.2","lodash":"^4.17.15","@types/node":"^18.8.4","ask-sdk-core":"^2.10.1","ask-sdk-model":"^1.18.0","@aws-sdk/util-dynamodb":"^3.199.0","@aws-sdk/client-dynamodb":"^3.199.0","@alexa-skill-components/account-linking":"*"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","eslint":"^7.2.0","ts-jest":"^26.5.6","webpack":"^5.38.1","ts-loader":"^9.2.0","ts-mockito":"2.5.0","typescript":"^3.9.9","@alexa/acdl":"^0.1.13","@types/jest":"^26.0.24","@types/uuid":"^8.3.4","webpack-cli":"^4.7.0","@types/lodash":"^4.14.181","jest-html-reporter":"3.2.0","eslint-plugin-import":"^2.22.1","@typescript-eslint/parser":"^3.3.0","@typescript-eslint/eslint-plugin":"^3.10.1"},"_npmOperationalInternal":{"tmp":"tmp/checkout_0.0.1_1684392750168_0.8694668008992203","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-05-18T06:52:30.075Z","modified":"2025-05-22T20:53:33.723Z","0.0.1":"2023-05-18T06:52:30.300Z"},"bugs":{"url":"https://github.com/alexa/skill-components/issues"},"license":"AmznSL-1.0","homepage":"https://github.com/alexa/skill-components#readme","repository":{"url":"git+ssh://git@github.com/alexa/skill-components.git","type":"git","directory":"checkout"},"description":"Alexa skill component to checkout","maintainers":[{"email":"osa-3p@amazon.com","name":"amzn-oss"},{"email":"akeat@amazon.com","name":"amzn-akeat"},{"email":"anukatar@amazon.com","name":"anuprk"},{"email":"aadified@amazon.com","name":"amzn-aaditya"},{"email":"prachibh@amazon.com","name":"amazon-prachibh"}],"readme":"# Checkout Skill Component\n\n\nWith the Checkout Skill Component, you can enable users to pay to the business for their goods or services like in a Food Delivery App, Shopping App etc. To use the Alexa Skill components, [sign up for the developer preview](https://build.amazonalexadev.com/2022-Skill-Components-Interest.html). We actively update these components and look forward to improving them with your feedback. To get the latest version, check back here often.\n\n**Note:** Alexa Skill Components are provided as a pre-production alpha release in developer preview, with limited support. Our goal is to solicit feedback on our approach and design as we work toward general availability. While we make every effort to minimize issues with this pre-production alpha release, we can't promise backward compatibility or a rapid turn-around on bug fixes.\n\n## Table Of Contents\n\n* [Introduction](#introduction)\n    * [When to use this component](#when-to-use-this-component)\n    * [Example Interaction](#example-interaction)\n* [Getting Started Process](#getting-started-process)\n* [Reference](#reference)\n* [Example skill](#example-skill)\n* [Feedback](#feedback)\n* [License](#license)\n\n## Introduction\n\nTo reduce your development time, Alexa Skill Components are consistent with user experience best practices. The Checkout Skill Component lets users of your skill to add items in their cart, select the mode of payment and proceed to checkout.\n\n### When to use this component\n\nAre you building an app in which your users add items to a cart and can make online purchase with a full checkout experience? Use the pre-built interaction patterns within the Checkout Skill Component to build out and customize these interactions.\n\n### Example interaction\n\nFollowing is an example skill interaction that shows different paths a component user might follow. These scenarios are taken from the included [Online Food Ordering example skill](./examples/OnlineFoodOrdering).\n\n#### Checkout Without Account Linking\n\n```\nUser  > Buy me 3 burgers\nAlexa > Added 3 burgers to your cart.Choose a mode of payment to checkout - Credit Card or Cash On Delivery.\nUser  > Cash On Delivery\nAlexa > Selected Cash On Delivery as the mode of payment\nUser  > I want to checkout\nAlexa > Your subtotal for 3 burgers is Rs 150. Would you like to checkout ?\nUser  > Yes\nAlexa > Checkout Success! Your order is placed\n```\n\n```\nUser  > Buy me 3 burgers\nAlexa > Added 3 burgers to your cart.Choose a mode of payment to checkout - Credit Card or Cash On Delivery.\nUser  > Credit Card\nAlexa > Selected Credit Card as the mode of payment\nUser  > I want to checkout\nAlexa > Your subtotal for 3 burgers is Rs 150. Would you like to checkout ?\nUser  > Yes\nAlexa > Checkout Failed! Missing information to checkout with Credit Card as the mode of payment.\n```\n\n#### Checkout With Account Linking\n\n```\nUser  > Buy me 3 pizzas\nAlexa > Added 3 pizzas to your cart\nUser  > I want to checkout\nAlexa > Your Account is not linked. I've sent information on the Alexa app to proceed.\n//user goes to the Alexa App gets his account linked and re-initiates the flow\n```\n\n```\nUser  > Buy me 3 pizzas\nAlexa > Added 3 pizzas to your cart\nUser  > I want to checkout.\nAlexa > Your Account is linked in order to checkout. Proceeding to order confirmation\nAlexa > Your subtotal for 3 pizzas is Rs 150. Would you like to checkout?\nUser  > Yes\nAlexa > Checkout Success! Your order is placed\n```\n\n#### Minimum Amount Limit\n\nThe minimum limit to checkout are error conditions which do not affect the overall working of the component, these are just custom logics on the provider end which can be modified.\n\n```\nUser  > Buy me 2 burgers\nAlexa > Added 2 burgers to your cart.Choose a mode of payment to checkout - Credit Card or Cash On Delivery.\nUser  > Cash On Delivery\nAlexa > Selected cash On Delivery as the mode of payment\nUser  > I want to checkout\nAlexa > Your cart subtotal is Rs... It does not meet the minimum amount limit to checkout. Add some more items to your cart.\n```\n\n#### Maximum Amount Limit\n\nThe maximum limit to checkout are error conditions which do not affect the overall working of the component, these are just custom logics on the provider end which can be modified.\n\n```\nUser  > Buy me 101 burgers\nAlexa > Added 101 burgers to your cart.Choose a mode of payment to checkout - Credit Card or Cash On Delivery.\nUser  > Cash On Delivery\nAlexa > Selected Cash On Delivery as the mode of payment\nUser  > I want to checkout\nAlexa > Your cart subtotal is Rs... It exceeds the maximum amount limit to checkout.\n```\n\n## Getting Started Process\n\n* [Step 1: Learn about Alexa Skill Components](#step-1-learn-about-alexa-skill-components)\n* [Step 2: Install the Checkout component](#step-2-install-the-checkout-component)\n* [Step 3: Call the reusable dialogs](#step-3-call-the-reusable-dialog)\n* [Step 4: Configure InteractionModel](#step-4-configure-interactionmodel)\n* [Step 5: Set up API handlers](#step-5-set-up-api-handlers)\n* [Step 6: Compile and deploy](#step-6-compile-and-deploy)\n* [Step 7: Test](#step-7-test)\n* [Step 8: Iterate](#step-8-iterate)\n\n### Step 1: Learn about Alexa Skill Components\n\nRead the [Skill Components Getting Started Guide](https://github.com/alexa/skill-components#getting-started). If you're unfamiliar with skill development, the following example skills are a good starting place:\n\n* [Hello World skill](https://developer.amazon.com/en-US/docs/alexa/custom-skills/tutorial-use-the-developer-console-to-build-your-first-alexa-skill.html)\n* [Flight Search skill](https://developer.amazon.com/en-US/docs/alexa/workshops/acdl-flightsearch-tutorial/get-started/index.html)\n\n### Step 2: Install the Checkout component\n\nThe next step is to install the Checkout Skill Component in your skill. If a `package.json` file doesn't already exist in the skill's root directory, create one with the following command.\n\n```\nnpm init\n```\n\nInstall the Checkout component from either the public release or a local build of the component.\n\n#### Public release\n\nIn your skill's root directory, install using `npm`.\n\n```\nnpm install --save @alexa-skill-components/checkout\nnpm install\n```\n\nThen install the component as a dependency in your API code (lambda).\n\n```\nnpm install --save @alexa-skill-components/checkout\nnpm install\n```\n\n#### Local build\n\nIn a separate directory from your skill, build the Checkout component from source code.\n\n```\ngit clone git@github.com:alexa/skill-components.git\ncd skill-components\ncd checkout\nnpm run clean-build\n```\n\nThen, in your skill's root directory, use `npm` to install the local build.\n\n```\nnpm install --save \"<path>/skill-components/checkout\"\nnpm install\n```\n\nAlso install the component as a dependency in your API code (lambda):\n\n```\nnpm install --save \"<path>/skill-components/checkout\"\nnpm install\n```\n\n### Step 3: Call the Reusable Dialogs\n\nImport and call the ACDL reusable dialogs provided by this component from your skill's own custom sample dialogs.\n\n#### 1\\. Import reusable dialogs and types\n\nImport the component's reusable dialogs and types into your skill's ACDL.\n\n```\nnamespace examples.checkout_skill\n\nimport com.amazon.alexa.skill.components.checkout.*\nimport com.amazon.alexa.skill.components.checkout.types.*\n```\n\n#### 2\\. Build the configuration object\n\nCall the buildCheckoutConfig ACDL reusable dialog in your skill's sample to build the configuration object needed for checkout to function, passing in the actions and events:\n\n```\n CheckoutConfig\n      {\n          checkoutEvent = checkoutEvent,\n          checkoutPrompt = checkoutPrompt,\n          validationPrompt = validationPrompt,\n          affirmUtterances=affirmUtterances\n\n      }\n```\n\n#### 3\\. Call reusable dialog\n\nIn one of your skill's samples, call the reusable CheckoutWithoutAccountLinking dialog to checkout without using Account Linking, passing in the previously built config, to generate dialog flows:\n\n```\nCheckoutWithoutAccountLinking(checkoutConfig)\n```\n\nCall the reusable Checkout dialog to checkout with Account Linking, passing in the previously built config, to generate dialog flows:\n\n```\nCheckout(checkoutConfig)\n```\n\n### Step 4: Configure Interaction Model\n\nAdd all the possible slot types and slot values in the InteractionModel of the skill.\n\n```\n{\n    \"interactionModel\": {\n    \"languageModel\": {\n        ...\n        \"types\": [\n                {\n                    \"name\": \"PAYMENTMODE\",\n                    \"values\": [\n                    {\n                        \"name\": {\n                        \"value\": \"credit card\"\n                        }\n                    },\n                    {\n                        \"name\": {\n                        \"value\": \"cash on delivery\",\n                        \"synonyms\": [\n                            \"cod\",\n                            \"pay on delivery\"\n                        ]\n                       }\n                    }\n               ]\n         }\n    }\n}\n```\n\n### Step 5: Set up API handlers\n\nImport and register the request handlers provided by the component into the skill's API code (where it will live along with the skill's other request handlers).\n\n#### TypeScript\n\n\n```\nimport { Checkout } from '@alexa-skill-components/checkout';\n\n...\n\nexport const skillDomain = \"examples.checkout_skill\";\n\nexport const handler = SkillBuilders.custom()\n    .addRequestHandlers(\n        ...\n        ...CheckoutComponent.createHandlers(\n            new CustomProvider()\n    ),\n    )\n.lambda();\n```\n\n#### Javascript\n\nFor an example, see [ OnlineFoodOrdering Example Skill](#example-skill).\n\n```\nconst Checkout = require('@alexa-skill-components/checkout')\n\n...\n\nexport const skillDomain = \"examples.checkout_skill\";\n\nexports.handler = Alexa.SkillBuilders.custom()\n    .addRequestHandlers(\n        ...\n        ...CheckoutComponent.createHandlers(\n        new CustomProvider()\n    ),\n.lambda();\n```\n\n### Step 6: Compile and deploy\n\nBuild your skill as you normally would. The component's dialog samples and API handlers, which were integrated into the skill, are built along with your skill's own custom dialog samples and handlers. Note that an Alexa Conversations skill deployment can take 20-40 minutes to complete.\n\n**Note:** Make sure the ask-cli-x and @alexa/acdl packages are up to date.\n\n```\naskx compile && askx deploy\n```\n\n### Step 7: Test\n\nTo use the CLI to test your component, enter the following command. Alternatively, use the Alexa Skills Kit Developer Console (click the **Test** tab) to simulate your skill's behavior.\n\n```\naskx dialog -s <YOUR_SKILL_ID> -l en-US -g development\n```\n\n### Step 8: Iterate\n\nAfter testing the default behavior of the component, see the [Reference](./docs/REFERENCE.md) document for available customization to suit your needs.\nFor details, see the [Example Skills](#example-skill).\n\nDeploy any changes, compile your code, and then deploy again.\n\n```\naskx compile && askx deploy\n```\n\n## Example skill\n\nFor an example skill, see [OnlineFoodOrdering](./examples/OnlineFoodOrdering).\n\n\n## Feedback\n\nAmazon welcomes your feedback. Connect with us on [Github](https://github.com/alexa/skill-components#support).\n\n## License\n\nCopyright 2022 Amazon.com, Inc., or its affiliates. All rights reserved. You may not use this file except in compliance with the terms and conditions set forth in the accompanying [LICENSE](https://github.com/alexa/skill-components/blob/main/LICENSE) file. THESE MATERIALS ARE PROVIDED ON AN \"AS IS\" BASIS. AMAZON SPECIFICALLY DISCLAIMS, WITH RESPECT TO THESE MATERIALS, ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.","readmeFilename":"README.md"}