actions_intent_TRANSACTION_DECISION is never called using Order API v3
I am building a simple shopping cart app using actions-on-google. I can present the order, and the user can accept and authorise payment in the assistant. But the event "actions_intent_TRANSACTION_DECISION" is never fired which would trigger my intent that raises the transaction and updates the order
Built using Dialogflow and fulfillment through firebase cloud functions.
I have had this working using the sample here: https://github.com/actions-on-google/dialogflow-transactions-nodejs and worked through to the end. I am using Stripe it would retrieve a token and raise a transaction successfully
However the guides now reference version 3 of the Orders API https://developers.google.com/actions/transactions/physical/dev-guide-physical-gpay and given v2 is deprecated I figured I'd use v3.
The code will present the order to the user (note the snippet is basically copied from the example in the guide) and they can authorise payment and the token is created in Stripe. But for some reason the actions_intent_TRANSACTION_DECISION event is never triggered so I can't handle the user's decision in my follow up intent. The assistant just responds "Sorry, something went wrong. Please try again later"
All required information has been set here:
left sidebar -> DEPLOY -> Directory information -> (Details, Image, Contact Details, Privacy and consent, Additional Information)
There are no errors in firebase and the assistant completes the transaction decision for the order.

const now = new Date().toISOString();
const order = {
createTime: now,
lastUpdateTime: now,
merchantOrderId: "UNIQUE_ORDER_ID",
userVisibleOrderId: "USER_VISIBLE_ORDER_ID",
transactionMerchant: {
id: 'http://www.example.com',
name: 'Example Merchant',
},
contents: {
lineItems: [
{
id: 'LINE_ITEM_ID',
name: 'Pizza',
description: 'A four cheese pizza.',
priceAttributes: [
{
type: 'REGULAR',
name: 'Line Item Price',
state: 'ACTUAL',
amount: {
currencyCode: 'USD',
amountInMicros: 8990000,
},
taxIncluded: true,
},
],
notes: [
'Extra cheese.',
],
purchase: {
quantity: 1,
unitMeasure: {
measure: 1,
unit: 'POUND'
},
itemOptions: [
{
id: 'ITEM_OPTION_ID',
name: 'Pepperoni',
prices: [
{
type: 'REGULAR',
state: 'ACTUAL',
name: 'Item Price',
amount: {
currencyCode: 'USD',
amountInMicros: 1000000,
},
taxIncluded: true,
},
],
note: 'Extra pepperoni',
quantity: 1,
subOptions: [],
},
],
},
},
],
},
buyerInfo: {
email: '[email protected]',
firstName: 'Jane',
lastName: 'Doe',
displayName: 'Jane Doe',
},
priceAttributes: [
{
type: 'TOTAL',
name: 'Total Price',
state: 'ESTIMATE',
amount: {
currencyCode: 'USD',
amountInMicros: 15770000,
},
taxIncluded: true,
},
{
type: 'TAX',
name: 'Tax',
state: 'ESTIMATE',
amount: {
currencyCode: 'USD',
amountInMicros: 3780000,
},
taxIncluded: true,
},
{
type: 'SUBTOTAL',
name: 'Subtotal',
state: 'ESTIMATE',
amount: {
currencyCode: 'USD',
amountInMicros: 9990000,
},
taxIncluded: true,
},
{
type: 'DELIVERY',
name: 'Delivery',
state: 'ACTUAL',
amount: {
currencyCode: 'USD',
amountInMicros: 2000000,
},
taxIncluded: true,
},
],
followUpActions: [
{
type: 'VIEW_DETAILS',
title: 'View details',
openUrlAction: {
url: 'http://example.com',
},
},
{
type: 'CALL',
title: 'Call us',
openUrlAction: {
url: 'tel:+16501112222',
},
},
{
type: 'EMAIL',
title: 'Email us',
openUrlAction: {
url: 'mailto:[email protected]',
},
},
],
termsOfServiceUrl: 'www.example.com',
note: 'Sale event',
promotions: [
{
coupon: 'COUPON_CODE',
},
],
purchase: {
status: 'CREATED',
userVisibleStatusLabel: 'CREATED',
type: 'FOOD',
returnsInfo: {
isReturnable: false,
daysToReturn: 1,
policyUrl: 'http://www.example.com'
},
fulfillmentInfo: {
id: 'FULFILLMENT_SERVICE_ID',
fulfillmentType: 'DELIVERY',
expectedFulfillmentTime: {
timeIso8601: '2017-01-16T01:30:15.01Z',
},
location: {
zipCode: '94086',
city: 'Sunnyvale',
postalAddress: {
regionCode: 'US',
postalCode: '94086',
administrativeArea: 'CA',
locality: 'Sunnyvale',
addressLines: [
'222, Some other Street',
],
},
},
price: {
type: 'REGULAR',
name: 'Delivery Price',
state: 'ACTUAL',
amount: {
currencyCode: 'USD',
amountInMicros: 2000000,
},
taxIncluded: true,
},
fulfillmentContact: {
email: '[email protected]',
firstName: 'John',
lastName: 'Johnson',
displayName: 'John Johnson',
},
},
purchaseLocationType: 'ONLINE_PURCHASE',
},
};
conv.ask(new TransactionDecision({
orderOptions: {
requestDeliveryAddress: false,
userInfoOptions: {
userInfoProperties: [
'EMAIL',
],
},
},
paymentParameters: {
googlePaymentOption: {
// facilitationSpec is expected to be a serialized JSON string
facilitationSpec: JSON.stringify({
apiVersion: 2,
apiVersionMinor: 0,
merchantInfo: {
merchantName: 'Mahalia Coffee',
},
allowedPaymentMethods: [
{
type: 'CARD',
parameters: {
allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'],
allowedCardNetworks: [
'AMEX', 'DISCOVER', 'JCB', 'MASTERCARD', 'VISA'],
},
tokenizationSpecification: {
type: 'PAYMENT_GATEWAY',
parameters: {
"gateway": "stripe",
"stripe:version": "2019-08-14",
"stripe:publishableKey": "pk_test_MY_STRIPE_KEY"
},
},
},
],
transactionInfo: {
totalPriceStatus: 'FINAL',
totalPrice: (subtotal + delivery / 1000000).toString(),
currencyCode: 'AUD',
},
}),
},
},
presentationOptions: {
actionDisplayName: 'PLACE_ORDER',
},
order: order,
}));
So the issue is with v3, but not v2? Even though your order object is the same?
So the issue is with v3, but not v2? Even though your order object is the same?
@Fleker sorry that was unclear in my post. V2 worked but it was using the v2 order object which is different.
I pointed out that it worked in v2 to point out that the conversation flow and how the intent was being triggered was working when I was using v2. I changed to v3 and modified the order object accordingly and have been unable to get it to fire the actions_intent_TRANSACTION_DECISION event.
So the issue is with v3, but not v2? Even though your order object is the same?
@Fleker sorry that was unclear in my post. V2 worked but it was using the v2 order object which is different.
I pointed out that it worked in v2 to point out that the conversation flow and how the intent was being triggered was working when I was using v2. I changed to v3 and modified the order object accordingly and have been unable to get it to fire the actions_intent_TRANSACTION_DECISION event.
Was there ever a solution identified?
Was there ever a solution identified?
@sburrell63 Not that I have found. I couldn't get it working so had to shelf the project. I will have to try again as the project still has to go ahead.