交易 API 將於 2023 年 5 月 3 日淘汰,並將於 2023 年 6 月 13 日淘汰。詳情請參閱「
對話動作已淘汰」。
GitHub 上的範例
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
請按一下範例名稱來查看及下載 GitHub 中的完整範例,接著就可以開始建構自己的交易。
Dialogflow
下表列出執行交易的範例動作專案:
範例 |
說明 |
交易
(Node.js、Java)
|
這個沙箱範例旨在提供交易流程。當中包含確認使用者是否能執行交易、取得寄送地址,以及確認交易已成功完成。 |
數位商品
(Node.js)
|
這個範例說明使用 Digital Goods API 進行數位購買交易的方式。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-05-16 (世界標準時間)。
[null,null,["上次更新時間:2023-05-16 (世界標準時間)。"],[[["\u003cp\u003eTransaction functionalities for Conversational Actions are unavailable in Denmark, France, Germany, Italy, the Netherlands, Norway, Poland, Spain, and Sweden due to new regulatory requirements.\u003c/p\u003e\n"],["\u003cp\u003eExisting Actions with Transactions will continue to function in all other supported locations.\u003c/p\u003e\n"],["\u003cp\u003eSample Actions projects demonstrating transaction implementations are available on GitHub, including a basic transaction flow example and a digital goods purchase example using the Digital Goods API.\u003c/p\u003e\n"]]],[],null,["# Samples on GitHub\n\n| **Warning:** Due to new regulatory requirements, transaction functionalities for Conversational Actions are no longer available in the following countries:\n|\n|\n| Denmark, France, Germany, Italy, the Netherlands, Norway, Poland, Spain, Sweden\n|\n|\n| Actions with Transactions will continue to work in all supported locales.\n\n\u003cbr /\u003e\n\nClick on the sample name to view and download the full samples on\n[GitHub](https://github.com/actions-on-google), then get started to\nbuild your own Actions with transactions.\n\nDialogflow\n----------\n\nThe following table lists our sample Actions projects that implement\ntransactions:\n\n| Sample | Description |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Transactions ([Node.js](https://github.com/actions-on-google/dialogflow-transactions-nodejs), [Java](https://github.com/actions-on-google/dialogflow-transactions-java)) | This is a sandbox example of fulfilling the transaction flow. It includes confirming that a user can perform a transaction, getting a delivery address, and confirming that a transaction was successfully completed. |\n| Digital Goods ([Node.js](https://github.com/actions-on-google/dialogflow-digital-goods-nodejs)) | This sample demonstrates usage of the Digital Goods API to make digital purchases. |"]]