createPaymentAction

View as MarkdownOpen in Claude

Static helper that builds a single action entry for a payment prompt.

Parameters

actionType
stringRequired

Action type.

  • "say" — use text-to-speech
  • "play" — play an audio file URL
phrase
stringRequired

Text to speak (when actionType is "say") or URL to play (when actionType is "play").

Returns

PaymentAction — An object with type and phrase fields, for use in createPaymentPrompt().

Example

1import { FunctionResult } from '@signalwire/sdk';
2
3const action = FunctionResult.createPaymentAction(
4 'say',
5 'Please enter your card number.',
6);