Class: Twilio::REST::Api::V2010::AccountContext::CallContext::PaymentInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::CallContext::PaymentInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/call/payment.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Payments resource.
-
#call_sid ⇒ String
The SID of the [Call](www.twilio.com/docs/voice/api/call-resource) the Payments resource is associated with.
-
#context ⇒ PaymentContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil) ⇒ PaymentInstance
constructor
Initialize the PaymentInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
The SID of the Payments resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(idempotency_key: nil, status_callback: nil, capture: :unset, status: :unset) ⇒ PaymentInstance
Update the PaymentInstance.
-
#uri ⇒ String
The URI of the resource, relative to
https://api.twilio.com.
Constructor Details
#initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil) ⇒ PaymentInstance
Initialize the PaymentInstance
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 457 def initialize(version, payload , account_sid: nil, call_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'call_sid' => payload['call_sid'], 'sid' => payload['sid'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'uri' => payload['uri'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid ,'call_sid' => call_sid || @properties['call_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Payments resource.
489 490 491 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 489 def account_sid @properties['account_sid'] end |
#call_sid ⇒ String
Returns The SID of the [Call](www.twilio.com/docs/voice/api/call-resource) the Payments resource is associated with. This will refer to the call sid that is producing the payment card (credit/ACH) information thru DTMF.
495 496 497 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 495 def call_sid @properties['call_sid'] end |
#context ⇒ PaymentContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
480 481 482 483 484 485 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 480 def context unless @instance_context @instance_context = PaymentContext.new(@version , @params['account_sid'], @params['call_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
507 508 509 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 507 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
513 514 515 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 513 def date_updated @properties['date_updated'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
554 555 556 557 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 554 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.PaymentInstance #{values}>" end |
#sid ⇒ String
Returns The SID of the Payments resource.
501 502 503 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 501 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
547 548 549 550 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 547 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.PaymentInstance #{values}>" end |
#update(idempotency_key: nil, status_callback: nil, capture: :unset, status: :unset) ⇒ PaymentInstance
Update the PaymentInstance
530 531 532 533 534 535 536 537 538 539 540 541 542 543 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 530 def update( idempotency_key: nil, status_callback: nil, capture: :unset, status: :unset ) context.update( idempotency_key: idempotency_key, status_callback: status_callback, capture: capture, status: status, ) end |
#uri ⇒ String
Returns The URI of the resource, relative to https://api.twilio.com.
519 520 521 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 519 def uri @properties['uri'] end |