Class: GoPay::PaymentMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/gopay/models/payment_method.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PaymentMethod

Returns a new instance of PaymentMethod.



8
9
10
11
12
# File 'lib/gopay/models/payment_method.rb', line 8

def initialize(attributes = {})
  attributes.each do |key, value|
    instance_variable_set(:"@#{key}", value) if self.respond_to?(key)
  end
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



6
7
8
# File 'lib/gopay/models/payment_method.rb', line 6

def code
  @code
end

#logoObject (readonly)

Returns the value of attribute logo.



6
7
8
# File 'lib/gopay/models/payment_method.rb', line 6

def 
  
end

#offlineObject (readonly)

Returns the value of attribute offline.



6
7
8
# File 'lib/gopay/models/payment_method.rb', line 6

def offline
  @offline
end

#payment_methodObject (readonly)

Returns the value of attribute payment_method.



6
7
8
# File 'lib/gopay/models/payment_method.rb', line 6

def payment_method
  @payment_method
end

Class Method Details

.allObject



14
15
16
17
18
19
20
21
# File 'lib/gopay/models/payment_method.rb', line 14

def self.all
  client = Savon::Client.new :wsdl => GoPay.configuration.urls["wsdl"], :log => false
  response = client.call :payment_method_list

  response.to_hash[:payment_method_list_response][:payment_method_list_return][:payment_method_list_return].map do |item|
    PaymentMethod.new(item)
  end
end