Transactions & Google Order Screen using V2 Deprecated API - Must Update to V3 Again

google-assistant

#1

@AlexSwe, @jan

Hello Alex,

A year ago this same issue was happening, and unfortunately something very similar, if not the same has come up again. Regarding Transactions, we are getting error messages saying we are invoking the V2 API, and this was the same error we got last year, however Alex pushed an update, and then things were working. However now, we are back in the same spot, and I can see in your source code it is still invoking V2.

When we trigger the googleOrderScreen() function, which will display the Google Order page on our phone, we are immediately given an error. Looking in GCP logs, we can see this message:

"MalformedResponse at expected_inputs[0].possible_intents[0].input_value_data.transaction_decision_value_spec: Transactions/Orders v2 API has been turned down. Follow the instructions https://developers.google.com/assistant/transactions/reference/physical/migrationv1v2/physical_migration_v3 to migrate to v3. For more support, please visit https://developers.google.com/assistant/support."

When we look at Transaction.js in the jovo-core-googleassistant directory, I can see in the implementation of TransactionDescision, it is using GoogleAPIs V2:

if (_get(output, 'GoogleAssistant.TransactionDecision')) {
            _set(googleAction.$originalResponse, 'expectUserResponse', true);
            _set(googleAction.$originalResponse, 'systemIntent', {
                intent: 'actions.intent.TRANSACTION_DECISION',
                data: {
                    '@type': 'type.googleapis.com/google.actions.v2.TransactionDecisionValueSpec',
                    'orderOptions': {
                        requestDeliveryAddress: true,
                    },
                    'paymentOptions': _get(output, 'GoogleAssistant.TransactionDecision.paymentOptions'),
                    'proposedOrder': _get(output, 'GoogleAssistant.TransactionDecision.proposedOrder'),
                },
            })
        }

Below is the full JSON request we are sending:

{
  "conversationToken": "[\"__system_counters__\",\"_jovo_session_iacxn\"]",
  "expectUserResponse": true,
  "expectedInputs": [{
    "inputPrompt": {
    },
    "possibleIntents": [{
      "intent": "actions.intent.TRANSACTION_DECISION",
      "inputValueData": {
        "@type": "type.googleapis.com/google.actions.v2.TransactionDecisionValueSpec",
        "proposedOrder": {
          "cart": {
            "merchant": {
              "id": "p_s_e_g",
              "name": "PSE\u0026G"
            },
            "notes": "Please note, this appliance is not covered by a WorryFree contract. Our regular service charges for parts and labor will apply if you choose to have us service the equipment",
            "lineItems": [{
              "name": "SERVICE APPOINTMENT: GAS WATER HEATER",
              "type": "REGULAR",
              "id": "pseg_payment",
              "quantity": 1,
              "price": {
                "type": "ACTUAL",
                "amount": {
                  "currencyCode": "USD"
                }
              }
            }]
          },
          "otherItems": [{
            "name": "Subtotal",
            "type": "SUBTOTAL",
            "id": "subtotal",
            "price": {
              "type": "ESTIMATE",
              "amount": {
                "currencyCode": "USD"
              }
            }
          }, {
            "name": "Tax",
            "type": "TAX",
            "id": "tax",
            "price": {
              "type": "ESTIMATE",
              "amount": {
                "currencyCode": "USD"
              }
            }
          }],
          "totalPrice": {
            "type": "ESTIMATE",
            "amount": {
              "currencyCode": "USD"
            }
          },
          "id": "kevin10701634584105"
        },
        "orderOptions": {
          "requestDeliveryAddress": true
        },
        "paymentOptions": {
          "actionProvidedOptions": {
            "displayName": "The charges will be included in your next bill.",
            "paymentType": "BANK"
          }
        }
      }
    }],
    "speechBiasingHints": ["$ApplianceIssue", "$sys.number-integer", "$TimeOfDay", "$sys.number", "$ApplianceGroup", "$outageType", "$FuelType", "$Appliance", "$DayBefore", "$SecondaryAddress", "$sys.number-sequence", "$Alphabet", "$Options"]
  }],
  "responseMetadata": {
    "status": {
      "message": "Success (200)"
    },
    "queryMatchInfo": {
      "queryMatched": true,
      "intent": "ea852ee4-1ecc-41ef-a699-481aeb96dc34"
    },
    "delegatedRequest": {...}
}

We have tried to update to the latest Jovo version however this has not resolved our issues. Please let us know how we can resolve this as our Live application is now broken due to this issue. If we need to provide any more information please let us know.

Thanks,

Sal