pay
Collect and process a credit card payment during the call. Generates a SWML
pay verb that walks the caller through entering card details via DTMF or
voice, then submits to your payment connector endpoint.
Parameters
payment_connector_url
URL of your payment processing endpoint. SignalWire sends the collected card data to this URL for processing.
input_method
How the caller provides card details.
"dtmf"— caller enters digits on the keypad"voice"— caller speaks the numbers
status_url
URL to receive payment status change webhook notifications.
payment_method
Payment method type. Currently only "credit-card" is supported.
timeout
Seconds to wait for the next DTMF digit before timing out.
max_attempts
Number of retry attempts if payment collection fails.
security_code
Whether to prompt the caller for the card’s security code (CVV).
postal_code
Whether to prompt for the billing postal code. Pass True to prompt, False
to skip, or a string with the actual postal code to use without prompting.
min_postal_code_length
Minimum number of digits required for the postal code.
token_type
Payment token type.
"one-time"— single-use token"reusable"— token can be charged again later
charge_amount
Amount to charge as a decimal string (e.g., "49.99").
currency
ISO 4217 currency code (e.g., "usd", "eur").
language
Language for TTS payment prompts (e.g., "en-US", "es-MX").
voice
TTS voice for payment prompts (e.g., "woman", "man").
description
Custom description for the payment transaction.
valid_card_types
Space-separated list of accepted card types.
parameters
Additional name/value pairs to send to the payment connector.
Use create_payment_parameter() to build entries.
prompts
Custom prompt configurations to override default payment prompts.
Use create_payment_prompt() to build entries.
ai_response
AI response template after payment completes. The ${pay_result} variable
is substituted with the payment outcome. Set to None to disable.
Returns
FunctionResult — self, for chaining.