Prompts Object
The prompts object allows you to customize the audio prompts played during different stages of the payment process. If no custom prompts are provided, default prompts will be used. If custom prompts are provided but certain payment steps are omitted, the system will fall back to the default prompts for those steps.
Properties
Name | Type | Description |
---|---|---|
actions Required | object[] | Array of action objects to execute for this prompt. These actions can either play an audio file or speak a phrase. |
for Required | string | The payment step this prompt is for. See Payment Steps for a list of available steps. |
attempts Optional | string | Specifies which payment attempt(s) this prompt applies to. The value increments when a payment fails. Use a single number (e.g., "1") or space-separated numbers (e.g., "2 3") to target the specific attempts. |
card_type Optional | string | Space-separated list of card types this prompt applies to. Allowed Values:
|
error_type Optional | string | Space-separated list of error types this prompt applies to. See Error Types. |
Payment steps
The for
property indicates which payment step the prompt is for.
None of these steps are required in your custom prompts - any omitted steps will use default prompts.
note
For example, if security-code
is set to false
, then the security code step will be skipped.
Step | Description | Default Prompt |
---|---|---|
payment-card-number Optional | Collect the payment card number. | "Please enter your credit card number" |
expiration-date Optional | Collect the payment card expiration date. | "Please enter your credit card's expiration date. 2 digits for the month and 2 digits for the year" |
security-code Optional | Collect the payment card security code. | "Please enter your credit card's security code. It's the 3 digits located on the back of your card" |
postal-code Optional | Collect the payment card postal code. | "Please enter your billing postal code" |
payment-processing Optional | The step used during the payment processing. | "Payment processing. Please wait" |
payment-completed Optional | The step used when the payment is completed. | "Payment completed. Thank you" |
payment-failed Optional | The step used when the payment fails. | "Payment failed" |
payment-canceled Optional | The step used when the payment is cancelled. | "Payment canceled" |
Error types
The error_type
property can include any of these values:
Error Type | Description |
---|---|
timeout | User input timeout |
invalid-card-number | Failed card validation |
invalid-card-type | Unsupported card type |
invalid-date | Invalid expiration date |
invalid-security-code | Invalid CVV format |
invalid-postal-code | Invalid postal code format |
session-in-progress | Concurrent session attempt |
card-declined | Payment declined |
Example
- 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: "Welcome to SignalWire telephony payment gateway!"
- type: "Say"
phrase: "You are going to pay your monthly subscription fee"
- type: "Say"
phrase: "Please enter your credit card number"
- for: "payment-card-number"
error_type: "invalid-card-number timeout invalid-card-type"
actions:
- type: "Say"
phrase: "You entered an invalid credit card number. Please try again."
- for: "payment-completed"
actions:
- type: "Say"
phrase: "Payment completed. You can continue to use our services."
{
"version": "1.0.0",
"sections": {
"main": [
{
"pay": {
"payment_connector_url": "https://example.com/process",
"prompts": [
{
"for": "payment-card-number",
"actions": [
{
"type": "Say",
"phrase": "Welcome to SignalWire telephony payment gateway!"
},
{
"type": "Say",
"phrase": "You are going to pay your monthly subscription fee"
},
{
"type": "Say",
"phrase": "Please enter your credit card number"
}
]
},
{
"for": "payment-card-number",
"error_type": "invalid-card-number timeout invalid-card-type",
"actions": [
{
"type": "Say",
"phrase": "You entered an invalid credit card number. Please try again."
}
]
},
{
"for": "payment-completed",
"actions": [
{
"type": "Say",
"phrase": "Payment completed. You can continue to use our services."
}
]
}
]
}
}
]
}
}