Class: Twilio::REST::Api::V2010::AccountContext::CallContext::PaymentContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::CallContext::PaymentContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/call/payment.rb
Instance Method Summary collapse
-
#initialize(version, account_sid, call_sid, sid) ⇒ PaymentContext
constructor
Initialize the PaymentContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(idempotency_key: nil, status_callback: nil, capture: :unset, status: :unset) ⇒ PaymentInstance
Update the PaymentInstance.
Constructor Details
#initialize(version, account_sid, call_sid, sid) ⇒ PaymentContext
Initialize the PaymentContext
126 127 128 129 130 131 132 133 134 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 126 def initialize(version, account_sid, call_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, call_sid: call_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:call_sid]}/Payments/#{@solution[:sid]}.json" end |
Instance Method Details
#inspect ⇒ Object
Provide a detailed, user friendly representation
182 183 184 185 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 182 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.PaymentContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
175 176 177 178 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 175 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.PaymentContext #{context}>" end |
#update(idempotency_key: nil, status_callback: nil, capture: :unset, status: :unset) ⇒ PaymentInstance
Update the PaymentInstance
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 142 def update( idempotency_key: nil, status_callback: nil, capture: :unset, status: :unset ) data = Twilio::Values.of({ 'IdempotencyKey' => idempotency_key, 'StatusCallback' => status_callback, 'Capture' => capture, 'Status' => status, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) PaymentInstance.new( @version, payload, account_sid: @solution[:account_sid], call_sid: @solution[:call_sid], sid: @solution[:sid], ) end |