<Prompt>
The <Prompt>
noun allows you to customize the default prompts used by <Pay>
.
When CPaaS executes <Pay>
CXML instructions without <Prompt>
, the caller will hear default prompts for each step of the
payment process. You can modify what the caller hears for a given payment step by nesting <Prompt>
within <Pay>
's opening
and closing tags.
You can customize prompts using either:
- Text-to-speech by nesting
<Say>
CXML within<Prompt>
- Pre-recorded audio by nesting
<Play>
CXML within<Prompt>
Payment Steps
There are seven payment steps in the <Pay>
process where prompts can be customized (see the for
attribute section below).
Each step that you wish to customize requires its own <Prompt>
element.
Attributes
Attribute | Allowed Values | Default | Description |
---|---|---|---|
for required | payment-card-number , expiration-date , security-code , postal-code , bank-routing-number , bank-account-number , payment-processing | - | Specifies which payment step's prompt you wish to customize. See Payment Steps for details. |
cardType optional | visa , mastercard , amex , maestro , discover , optima , jcb , diners-club , enroute | - | Space-separated list of card types. Allows customization of prompts for specific card types (e.g., different security code lengths). |
attempt optional | Integer from 1 -10 | - | Specifies which attempt number this prompt should be used for. Useful for providing more detailed instructions after failed attempts. |
errorType optional | timeout , invalid-card-number , invalid-card-type , invalid-date , invalid-security-code , invalid-bank-routing-number , invalid-bank-account-number , input-matching-failed | - | Space-separated list of error types. Customize error messages for specific failure scenarios. |
Payment Step
Specifies which payment step's prompt you wish to customize:
Payment Step | Description |
---|---|
payment-card-number | Prompt for credit/debit card number |
expiration-date | Prompt for card expiration date |
security-code | Prompt for card security code (CVV) |
postal-code | Prompt for billing postal code |
bank-routing-number | Prompt for bank routing number |
bank-account-number | Prompt for bank account number |
payment-processing | Message during payment processing |
Examples
Prompt for Card Number with TTS
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Pay>
<Prompt for="payment-card-number">
<Say>Please enter your 16 digit Visa or Mastercard number.</Say>
</Prompt>
</Pay>
</Response>
Prompt for Card Number with MP3
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Pay>
<Prompt for="payment-card-number">
<Play>https://example.com/signalwire/cxml/audio/card_number.mp3</Play>
</Prompt>
</Pay>
</Response>