如何解决“使用前必须启用事务API”

时间:2019-10-07 13:26:43

标签: node.js transactions actions-on-google

我正在尝试开发适用于transactionsorder的第一个AoG动作。为此,在node.js履行代码中,我使用了https://developers.google.com/actions/transactions/physical/dev-guide-physical-reservations#troubleshooting Build Reservations 中显示的确切代码。

在履行职责时,我使用order标签上的Node.js对象,该标签位于 2下。建立订单https://developers.google.com/actions/transactions/physical/dev-guide-physical-reservations#fulfillment_2
以及 3下TransactionDecision实例的代码。提出订单https://developers.google.com/actions/transactions/physical/dev-guide-physical-reservations#fulfillment_3

然后我使用以下代码生成响应:

          const order = ... // from 'Build the order'

          let td = new TransactionDecision({
            orderOptions: {
              requestDeliveryAddress: 'false',
            },
            presentationOptions: {
              actionDisplayName: 'RESERVE',
            },
            order: order 
          });

          conv.ask(td);   

当我尝试在Google Actions Console上的Actions中对此进行测试时,我在日志中收到以下错误消息:

MalformedResponse at expected_inputs[0].possible_intents[0]: Transactions API must be enabled before using
{
 insertId: "ofgpz4fqpyuj4"  
 labels: {…}  
 logName: "projects/huismeester-21dea/logs/actions.googleapis.com%2Factions"  
 receiveTimestamp: "2019-10-07T11:57:38.323616528Z"  
 resource: {…}  
 severity: "ERROR"  
 textPayload: "MalformedResponse at expected_inputs[0].possible_intents[0]: Transactions API must be enabled before using"  
 timestamp: "2019-10-07T11:57:38.315740302Z"  
 trace: "projects/84695521529/traces/ABwppHHPuMPb-ybvyUKvtbrWR5lyDCb00dW5vMunLreeqLb0XbWPF_UINvjbOMF4W_akp2ca9noZGCceZuphXZc"  
}

谁能告诉我我做错了什么或我忘记了哪一步?我正在使用actionsdk:

const app = actionssdk({ ordersv3: true });

此外,在 Deployment |下的 Actions Console 中。其他信息,我在交易下打了两个勾号。

亲切的问候,

0 个答案:

没有答案