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
368
369
370
|
# File 'lib/docdata/order/response.rb', line 368
def data
body[:list_payment_methods_response]
end
|
#error? ⇒ Boolean
376
377
378
|
# File 'lib/docdata/order/response.rb', line 376
def error?
data.key?(:list_payment_methods_errors)
end
|
#errors ⇒ Object
380
381
382
|
# File 'lib/docdata/order/response.rb', line 380
def errors
data[:list_payment_methods_errors]
end
|
#payment_methods ⇒ Object
384
385
386
387
388
389
390
|
# File 'lib/docdata/order/response.rb', line 384
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].to_h { |issuer| [issuer.attributes['id'], issuer.to_s] } if payment_method.key?(:issuers)
method
end
end
|
#success? ⇒ Boolean
372
373
374
|
# File 'lib/docdata/order/response.rb', line 372
def success?
data.key?(:list_payment_methods_success)
end
|