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: