Constructor

RichResponse

new RichResponse(richResponse)

Constructor for RichResponse. Accepts optional RichResponse to clone.

Parameter

Name Description

richResponse

Optional

RichResponse

Optional RichResponse to clone.

Methods

addBasicCard

addBasicCard(basicCard) returns RichResponse

Adds a BasicCard to list of items.

Parameter

Name Description

basicCard

BasicCard

Basic card to include in response.

Returns

RichResponse Returns current constructed RichResponse.

addOrderUpdate

addOrderUpdate(orderUpdate) returns RichResponse

Adds an order update to this response. Use after a successful transaction decision to confirm the order.

Parameter

Name Description

orderUpdate

OrderUpdate

OrderUpdate object to add.

Returns

RichResponse Returns current constructed RichResponse.

addSimpleResponse

addSimpleResponse(simpleResponse) returns RichResponse

Adds a SimpleResponse to list of items.

Parameter

Name Description

simpleResponse

(string or SimpleResponse)

Simple response to present to user. If just a string, display text will not be set.

Returns

RichResponse Returns current constructed RichResponse.

addSuggestionLink(destinationName, suggestionUrl) returns RichResponse

Sets the suggestion link for this rich response.

Parameters

Name Description

destinationName

string

Name of the link out destination.

suggestionUrl

string

String URL to open when suggestion is used.

Returns

RichResponse Returns current constructed RichResponse.

addSuggestions

addSuggestions(suggestions) returns RichResponse

Adds a single suggestion or list of suggestions to list of items.

Parameter

Name Description

suggestions

(string or Array of string)

Either a single string suggestion or list of suggestions to add.

Returns

RichResponse Returns current constructed RichResponse.

isValidSuggestionText

isValidSuggestionText(suggestionText) returns boolean

Returns true if the given suggestion text is valid to be added to the suggestion list. A valid text string is not longer than 25 characters.

Parameter

Name Description

suggestionText

string

Text to validate as suggestion.

Returns

boolean True if the text is valid, false otherwise.s