pay
Start a payment collection session on the call. Collects credit card or other
payment information from the caller via DTMF. Returns a
PayAction that you can use to stop
the payment flow or wait for it to complete.
This method emits calling.call.pay events. See Call Events for payload details.
Parameters
payment_connector_url
URL of the payment connector service that processes the payment.
control_id
Custom control ID. Auto-generated if not provided.
input_method
How the caller provides payment info.
"dtmf"— caller enters digits on the keypad"speech"— caller speaks the payment information
status_url
URL to receive payment status webhooks.
payment_method
Payment method type. Valid values: "credit-card".
timeout
Timeout for the payment session.
max_attempts
Maximum number of input attempts before failing.
security_code
Whether to collect CVV.
"true"— prompt the caller for the security code"false"— skip security code collection
postal_code
Whether to collect postal code.
"true"— prompt the caller for the postal code"false"— skip postal code collection
min_postal_code_length
Minimum length for the postal code.
token_type
Tokenization type for the payment data.
charge_amount
Amount to charge (e.g., "29.99").
currency
Currency code (e.g., "USD", "EUR").
language
Language for payment prompts (e.g., "en").
voice
Voice for TTS prompts during the payment flow.
description
Description of the payment/charge.
valid_card_types
Comma-separated list of accepted card types (e.g., "visa,mastercard,amex").
parameters
Additional parameters to pass to the payment connector.
prompts
Custom prompts for the payment flow.
on_completed
Callback invoked when the payment operation completes.
Returns
PayAction — An action handle with
stop() and wait() methods.