Skip to main content

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

NameTypeDescription
actionsRequiredobject[]Array of action objects to execute for this prompt. These actions can either play an audio file or speak a phrase.
forRequiredstringThe payment step this prompt is for. See Payment Steps for a list of available steps.
attemptsOptionalstringSpecifies 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_typeOptionalstringSpace-separated list of card types this prompt applies to.
Allowed Values:
  • visa
  • mastercard
  • amex
  • maestro
  • discover
  • optima
  • jcb
  • diners-club
error_typeOptionalstringSpace-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.

StepDescriptionDefault Prompt
payment-card-numberOptionalCollect the payment card number."Please enter your credit card number"
expiration-dateOptionalCollect 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-codeOptionalCollect 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-codeOptionalCollect the payment card postal code."Please enter your billing postal code"
payment-processingOptionalThe step used during the payment processing."Payment processing. Please wait"
payment-completedOptionalThe step used when the payment is completed."Payment completed. Thank you"
payment-failedOptionalThe step used when the payment fails."Payment failed"
payment-canceledOptionalThe step used when the payment is cancelled."Payment canceled"

Error types

The error_type property can include any of these values:

Error TypeDescription
timeoutUser input timeout
invalid-card-numberFailed card validation
invalid-card-typeUnsupported card type
invalid-dateInvalid expiration date
invalid-security-codeInvalid CVV format
invalid-postal-codeInvalid postal code format
session-in-progressConcurrent session attempt
card-declinedPayment declined

Example

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."