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:



1416
1417
1418
1419
1420
1421
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1416

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



1443
1444
1445
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1443

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, require_matching_inputs: 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

require_matching_inputs

Require customer to input requested information twice and verify matching.

keyword_args

additional attributes

Yields:



1431
1432
1433
1434
1435
1436
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1431

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

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