class Docdata::Order::ListPaymentMethodsResponse

Response to a list payment methods operation.

Public Instance Methods

data() click to toggle source
# File lib/docdata/order/response.rb, line 352
def data
  body[:list_payment_methods_response]
end
error?() click to toggle source
# File lib/docdata/order/response.rb, line 360
def error?
  data.key?(:list_payment_methods_errors)
end
errors() click to toggle source
# File lib/docdata/order/response.rb, line 364
def errors
  data[:list_payment_methods_errors]
end
payment_methods() click to toggle source
# 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?() click to toggle source
# File lib/docdata/order/response.rb, line 356
def success?
  data.key?(:list_payment_methods_success)
end