Class: Twilio::TwiML::Pay

Inherits:
TwiML
  • Object
show all
Defined in:
lib/twilio-ruby/twiml/voice_response.rb

Overview

<Pay> Twiml Verb

Instance Attribute Summary

Attributes inherited from TwiML

#name

Instance Method Summary collapse

Methods inherited from TwiML

#add_child, #add_text, #append, #comment, to_lower_camel_case, #to_s, #xml

Constructor Details

#initialize(**keyword_args) {|_self| ... } ⇒ Pay

Returns a new instance of Pay.

Yields:

  • (_self)

Yield Parameters:


738
739
740
741
742
743
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 738

def initialize(**keyword_args)
  super(**keyword_args)
  @name = 'Pay'

  yield(self) if block_given?
end

Instance Method Details

#parameter(name: nil, value: nil, **keyword_args) ⇒ Object

Create a new <Parameter> element

name

The name of the custom parameter

value

The value of the custom parameter

keyword_args

additional attributes


764
765
766
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 764

def parameter(name: nil, value: nil, **keyword_args)
  append(Parameter.new(name: name, value: value, **keyword_args))
end

#prompt(for_: nil, error_type: nil, card_type: nil, attempt: nil, **keyword_args) {|prompt| ... } ⇒ Object

Create a new <Prompt> element

for_

Name of the payment source data element

error_type

Type of error

card_type

Type of the credit card

attempt

Current attempt count

keyword_args

additional attributes

Yields:


752
753
754
755
756
757
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 752

def prompt(for_: nil, error_type: nil, card_type: nil, attempt: nil, **keyword_args)
  prompt = Prompt.new(for_: for_, error_type: error_type, card_type: card_type, attempt: attempt, **keyword_args)

  yield(prompt) if block_given?
  append(prompt)
end