Hi,
I used the Dialogflow integartion.
I didnt use the the androidPackaName field
My code is in the app.js and looks like this - NOTE THAT THE ON TRANSACTION WRAPS the other intents
ON_TRANSACTION: {
//1. check customer can transact
TRANSACTION_REQUIREMENTS_CHECK() {
if (this.$googleAction.$transaction.canTransact()) {
//Do stuff here including handle available surfaces and ask for delivery addres
}
}
//2. get and set your delivery options or handle if delivery address is rejected and
// build the order
DELIVERY_ADDRESS() {
....
//set your orderOptions & PresentationOptions
this.$googleAction.$transaction.buildOrder(order, presentationOptions,
orderOptions);
}
//3. get the transaction decision
TRANSACTION_DECISION() {
const attributes = this.$session.$data;
let result = this.$googleAction.$transaction.getTransactionDecisionResult();
attributes.result = result
....
/ / Do stuff depening on result fo decision
}
} // Close main ON_TRANSACTION intent
Hope that helps.
It is the basic structure I used. I’ve omitted a lot of the code that use as it wouldn’t be relevant to you I don’t think. If you have further, more detailed questions feel free to ask. Bear in mind I’m in Australia so you may not get an immediate response!
Also bear in mind when you submit to google you must state you are using the Transactions API. Certification can take 4 weeks and if they reject for anything (not necessarily to do with transactions) you may have to wait weeks again -so be careful to go over your code and check for any stupid mistakes that might stop certification