prompts.actions
The actions
array within a prompt object specifies the audio output or text-to-speech messages to be played at different stages of the payment process.
Name | Type | Description |
---|---|---|
actions Required | object[] | Array of action objects. |
Action Object
Name | Type | Description |
---|---|---|
phrase Required | string | When the action type is Say , this value is the text to be spoken; when the type is Play , it should be a URL to the audio file. |
type Required | string | Specifies the action to perform. Allowed Values:
|
Examples
Example: Text-to-Speech
- YAML
- JSON
version: 1.0.0
sections:
main:
- pay:
payment_connector_url: "https://example.com/process"
prompts:
- for: "payment-card-number"
actions:
- type: "Say"
phrase: "Please enter your credit card number"
- type: "Say"
phrase: "Enter the digits followed by the pound key"
{
"version": "1.0.0",
"sections": {
"main": [
{
"pay": {
"payment_connector_url": "https://example.com/process",
"prompts": [
{
"for": "payment-card-number",
"actions": [
{
"type": "Say",
"phrase": "Please enter your credit card number"
},
{
"type": "Say",
"phrase": "Enter the digits followed by the pound key"
}
]
}
]
}
}
]
}
}
Example: Audio File
- YAML
- JSON
version: 1.0.0
sections:
main:
- pay:
payment_connector_url: "https://example.com/process"
prompts:
- for: "payment-completed"
actions:
- type: "Play"
phrase: "https://example.com/audio/payment-success.wav"
{
"version": "1.0.0",
"sections": {
"main": [
{
"pay": {
"payment_connector_url": "https://example.com/process",
"prompts": [
{
"for": "payment-completed",
"actions": [
{
"type": "Play",
"phrase": "https://example.com/audio/payment-success.wav"
}
]
}
]
}
}
]
}
}
Example: Mixed Actions
- YAML
- JSON
version: 1.0.0
sections:
main:
- pay:
payment_connector_url: "https://example.com/process"
prompts:
- for: "payment-processing"
actions:
- type: "Play"
phrase: "https://example.com/audio/processing-sound.wav"
- type: "Say"
phrase: "Please wait while we process your payment"
- type: "Play"
phrase: "https://example.com/audio/hold-music.wav"
{
"version": "1.0.0",
"sections": {
"main": [
{
"pay": {
"payment_connector_url": "https://example.com/process",
"prompts": [
{
"for": "payment-processing",
"actions": [
{
"type": "Play",
"phrase": "https://example.com/audio/processing-sound.wav"
},
{
"type": "Say",
"phrase": "Please wait while we process your payment"
},
{
"type": "Play",
"phrase": "https://example.com/audio/hold-music.wav"
}
]
}
]
}
}
]
}
}