Facing issue with Transaction API


#1

I am implementing the Transaction API in my project. I have followed the Transaction API from Jovo tutorials. I have called only checkRequirements function for the check requirement. skill is getting stopped and give a message - sorry, skill name isn’t responding right now. please try again soon

TransactionCheckRequirementsIntent() {
 this.$googleAction.$transaction.checkRequirements({
 requestDeliveryAddress: false,
 },
{
 actionProvidedOptions: {
  "paymentType": "PAYMENT_CARD",
  "displayName": "VISA-1234"
 },
})
this.ask('Check requirements');
}

Not getting any error from the backend side and I have checked all configuration.

Anybody can help me with this issue?

thank you


#2

I have exactly the same issue.
If I remember well I tested this a few months ago and it was working.
Maybe due to an update on Google side?


#3

thank you @SnooGrapes1518.


#4

Hi - I’m also having problems with the Transactions tutorial. I’m trying to initiate physical transactions and/or reseverations. I’ve followed Google’s tutorial - getting right through the transaction process to purchase completion.

But once I start trying with the Jovo tutorial it’s defeating me!
I can get delivery addresses but when I start to feed the transaction decision handler the order it’s not working and displaying to the user for confirmation

I’ve noticed that my tutorial in google actions console is using “@type”: “type.googleapis.com/google.actions.transactions.v3.TransactionDecisionValueSpec”,

but the built-in Jovo handler uses v2:

@type”: “type.googleapis.com/google.actions.v2.TransactionDecisionValueSpec

Is it possible that this is causing issues and needs updating?

Jovo is sending a “ProposedOrder” object which has now been depreciated:

https://developers.google.com/assistant/transactions/reference/physical/migrationv1v2/physical_migration_v3#nodejs-v3

V3 accepts : presentationOptions, orderOptions,order


#5

Yes I’ve done some investigations and came to the same conclusion. So I guess it’s a matter of waiting that we get an update from Jovo team on this?


#6

Hey, I will dive deeper into it this week and then give feedback.


#7

Hi Alex,
Thanks a lot for the followup. Google won’t approve some Actions if they don’t comply with their Transaction API, and it’d be painful for us to have to create a separate project for Google only outside of Jovo :slight_smile:


#8

Hm, we need to update to docs (after the updates for the TransactionsAPIv3).

Could you try the code from the examples here:

Digital Goods:

Physical Goods:

Reservations:

I just tried the first steps of the Google Transactions flow and it worked. Let me know if it doesn’t work for you. I will assist :slight_smile:

Note to me: Add the samples to the javascript samples folder.


#9

Hi Alex,

I tried again without any luck. I am not using .ts but regular node.js, here is my current code:

  LAUNCH() {

    return this.toIntent(‘TransactionCheckRequirementsIntent’);    
  },
  //GOOGLE TRANSACTION API STARTS HERE

  TransactionCheckRequirementsIntent() {

    console.log(“Going to check requirements”);

    this.$googleAction.$transaction.checkRequirements();

    console.log(“Requirements checked”);

    this.ask(‘Ok sir?’);

  },

  ON_TRANSACTION: {

    TRANSACTION_REQUIREMENTS_CHECK() {

        // this.tell(‘requirements check’)

        if (this.$googleAction.$transaction.canTransact()) { //also tried with $transaction.isRequirementsCheckOk

            console.log(“OK SIR”);

            this.$googleAction.$transaction.askForDeliveryAddress(‘Address?’);

        } else if (this.$googleAction.$transaction.isRequirementsCheckUserActionRequired()) {

            console.log(“KO SIR”);

            this.tell(‘Further action is required’)

        }

    },

Here is the output from Jovo:
{
“fulfillmentText”: “Ok sir?”,
“outputContexts”: [],
“payload”: {
“google”: {
“expectUserResponse”: true,
“richResponse”: {
“items”: [
{
“simpleResponse”: {
“ssml”: “Ok sir?”
}
}
]
},
“noInputPrompts”: [
{
“ssml”: “Ok sir?”
}
],
“systemIntent”: {
“intent”: “actions.intent.TRANSACTION_REQUIREMENTS_CHECK”,
“data”: {
@type”: “type.googleapis.com/google.actions.transactions.v3.TransactionRequirementsCheckSpec
}
},
“userStorage”: “{“userId”:“9e9262eb-c12f-42ed-a3ef-4ca2ff8a70bd”}”
}
}
}

I am testing from Google Action Console. It keeps on saying that the Action does not reply. But to me Jovo output seem correct?
It is the same if I test from Google Assistant on mobile phone.

Thanks for any tip !


#10

SUPER AWESOME ALEX! I’ve just got through the physical purchase process all the way! Thank you very much. About to try the reservation code now too.


#11

SnooGrapes - this works for me:

TransactionCheckRequirementsIntent() {
this.$googleAction.$transaction.checkRequirements({
requestDeliveryAddress: false,
}, {
actionProvidedOptions: {
“paymentType”: “PAYMENT_CARD”,
“displayName”: “VISA-1234”
},
});
//console.log(“WE GOT HERE”)
this.ask(‘Check’);

ON_TRANSACTION:{

TRANSACTION_REQUIREMENTS_CHECK() {
if(this.$googleAction.$transaction.canTransact()) {
this.$googleAction.$transaction.askForDeliveryAddress( Next I'll need your delivery address)
}
},
DELIVERY_ADDRESS() {…
},
TRANSACTION_DECISION() {…
}
}


#12

Guys, I found out the problem… I did not check the box “This action uses Transaction API” in the deploy options on Google Action Console…
Since I did it, it works fine!
So much wasted time for a checkbox… :slight_smile:


#13

@AlexSwe - I’m not sure that
this.$googleAction.$transaction.getDeliveryAddress() is working correctly .

@SnooGrapes1518 - are you having any luck with that?


#14

haha I did not want to ask because I thought it was too obvious :smiley:


#15

You’re right!

Fixed it. Please run jovo update


#16

Perfect - works now!

Thanks for your quick actions on this Alex - very much appreciated.


#17

Thanks a lot Alex! :star_struck:


#18

Hi,

I’m trying to implement Transactions for reservations but I’m having same issue that @SnooGrapes1518, this is my response:

<<<<< Response - 2021-07-23T11:22:43.468Z 
{
   "fulfillmentText": "<voice gender='female'>Check</voice>",
   "end_interaction": false,
   "outputContexts": [],
   "payload": {
      "google": {
         "expectUserResponse": true,
         "richResponse": {
            "items": [
               {
                  "simpleResponse": {
                     "ssml": "<speak><voice gender='female'>Check</voice></speak>"
                  }
               }
            ]
         },
         "noInputPrompts": [
            {
               "ssml": "<speak><voice gender='female'>Check</voice></speak>"
            }
         ],
         "systemIntent": {
            "intent": "actions.intent.TRANSACTION_REQUIREMENTS_CHECK",
            "data": {
               "@type": "type.googleapis.com/google.actions.transactions.v3.TransactionRequirementsCheckSpec"
            }
         },
         "userStorage": "{\"userId\":\"d0f0a33f-511f-4e99-b8c3-7065c9f11b50\"}"
      }
   }
}

Everything seems fine, but Google Assistant says my app is not responding. I see no errors in the log.

I’m confused about this and I can’t find documentation about Reservations in Jovo docs. I’m not sure if I need to define or map the

actions.intent.TRANSACTION_REQUIREMENTS_CHECK

intent, plus I am using Dialogflow integration with Actions, and this is getting confusing… Please help @AlexSwe !

Thank you


#19

@Programmusic hi! can you share your model.json please? Or help with my last post


#20

Sure. What exactly do you need the JSON mode or the js codel? The JSON doesnt really have much in it as you handover to the Google transactions api which you dont have any control over

I’m not sure if what I have in is code will fully help you. I ended up using the transactions api but not for reservations. The use case was to make a financial offer for something but not a confirmed purchase.