Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When you submit a skill to Google for alpha testing, Google verifies if all the transactions in the skill, both monetary and non-monetary, are done through Google Transaction API and rejects the skill if not using the API. Orbita has integrated the Google Transaction API so that all the transactions will be dealt with the Google Transaction API.

Instructions

The Transaction API should be enabled for your skill and the intent should contain an Event for transaction decision making.

For example, you might want to create a slot reservation flow for a restaurant.

Enable Transactions in Skill

Follow these steps to enable transactions in the skill1.

  1. Login to https://console.actions.google.com/ and select a project.

...

  1. Image Added

...

  1. In the project screen:

    1. Make sure you have chosen the correct project.

    2. Select the “Deploy” tab.

    3. Select “Directory Information” from the side menu.

    4. Scroll down and expand the “Additional Information.

...

    1. Image Added

...

  1. Scroll down to the “Transactions” section and check the appropriate checkbox that suits your use case.

...

  1. Image Added

...

  1. Scroll to the top of the screen and click

...

  1. Save.

...

  1. Image Added
Info

Note: To successfully save the changes on this page, you must fill all the mandatory fields. If the mandatory fields are incomplete, you will see a warning message as shown below.

...

...

Sample Flow

In the below example, SlotReservation intent is used to invoke the reservation flow.

...

The final response upon successful completion of the flow should be given in the Say node.

...

...

Intent and Event

You must create an intent to connect it with the event that the Transaction API calls.

...

Utterances are not required for this intent as the event will have its default utterances.

...

...

Function node

The code in the function node

Code Block
breakoutModewide
languagejson
var json = {

...


  "systemIntent" : {
    "intent"    

...

   : "actions.intent.TRANSACTION_DECISION",
    "data"         

...

: {
      "@type"      

...

  : "type.googleapis.com/google.actions.transactions.v3.TransactionDecisionValueSpec",

...


      

...

"orderOptions" : { 

...

"requestDeliveryAddress": false 

...

},

...


      "order"

...

 

...

       : {
        "merchantOrderId"     : "" + Math.floor(Math.random() * 200000) + Date.now(),
        

...

"userVisibleOrderId"  : "" + Math.floor(Math.random() * 200000) + Date.now()+1,
        

...

"transactionMerchant" : {
          "id"        

...

: "" + Math.floor(Math.random() * 200000) + Date.now()+2,
          "name"      

...

: "Merchant"
                

...

                },
 

...

 

...

      "contents"  : {
           "lineItems" : [{
             

...

"id"                

...

: "" + Math.floor(Math.random() * 200000) + Date.now()+3,
             "name"              

...

: "Slot Reservation",
             

...

"description"       

...

: "Reserve a slot in a restaurant",
             

...

"reservation"       

...

: {
               "status"                  

...

: "PENDING",

...


               

...

"userVisibleStatusLabel"  : "Reservation is pending.",
               "type"                    

...

: "RESTAURANT",

...


               

...

"reservationTime"

...

 

...

        

...

: { "timeIso8601" : "2019-08-31T01:30:15.01Z

...

 " },
               

...

"userAcceptableTimeRange" : {

...

 "timeIso8601" : "2019-08-31T01:30:15.01Z"

...

 

...

},

...


               "staffFacilitators"

...

 

...

      

...

: [{ "name"       

...

: "La Richi"

...

 

...

}

...

],
               "location"                

...

: {
                 

...

"zipCode"       

...

: "20001",
                 

...

"city"          

...

: "NewYork",

...


                 

...

"postalAddress" : {
                   "regionCode"         

...

: "US",
                   

...

"postalCode"         

...

: "20001",

...


                   

...

"administrativeArea" : "CA",
                   

...

"locality"           

...

: "NewYork",
                   

...

"addressLines"

...

 

...

      : 

...

[ "222, Wellignton Street"

...

 

...

]
                                   

...

}

...


                             

...

}
                           }

...

                         }

...

] 
     

...

                 },

...


        "buyerInfo" : {
          

...

"email"       

...

: "La_richi@gmail.com",
          "firstName"   : "John",
     

...

 

...

    "lastName"    : 

...

"Smith",
          "

...

displayName" : "

...

John"

...


                    

...

  },
              

...

      }
      

...

         }
    }
}
msg.alexaResponse.response.payload.google.systemIntent = json.systemIntent;
delete msg.alexaResponse.response.payload.google.noInputPrompts;
delete msg.alexaResponse.response.payload.google.isSsml;
delete msg.alexaResponse.response.payload.google.richResponse; 
return msg;

...

Filter by label (Content by label)
showLabelsfalse
max5
showSpacefalse
cqllabel = "only-for-google"