Class: Docdata::Order::ListPaymentMethodsResponse
- Inherits:
-
Response
- Object
- Response
- Docdata::Order::ListPaymentMethodsResponse
show all
- Defined in:
- lib/docdata/order/response.rb
Overview
Response to a list payment methods operation.
Instance Attribute Summary
Attributes inherited from Response
#options, #response
Instance Method Summary
collapse
Methods inherited from Response
#body, #error_code, #error_message, #initialize
Instance Method Details
#data ⇒ Object
352
353
354
|
# File 'lib/docdata/order/response.rb', line 352
def data
body[:list_payment_methods_response]
end
|
#error? ⇒ Boolean
360
361
362
|
# File 'lib/docdata/order/response.rb', line 360
def error?
data.key?(:list_payment_methods_errors)
end
|
#errors ⇒ Object
364
365
366
|
# File 'lib/docdata/order/response.rb', line 364
def errors
data[:list_payment_methods_errors]
end
|
#payment_methods ⇒ Object
368
369
370
371
372
373
374
|
# File 'lib/docdata/order/response.rb', line 368
def payment_methods
data[:list_payment_methods_success][:payment_method].map do |payment_method|
method = PaymentMethod.new(payment_method[:name])
method.issuers = payment_method[:issuers][:issuer].map { |issuer| [issuer.attributes["id"], issuer.to_s] }.to_h if payment_method.key?(:issuers)
method
end
end
|
#success? ⇒ Boolean
356
357
358
|
# File 'lib/docdata/order/response.rb', line 356
def success?
data.key?(:list_payment_methods_success)
end
|