Class: SpreedlyCore::Gateway

Inherits:
Base
  • Object
show all
Defined in:
lib/spreedly_core/gateway.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

configure, gateway_token, login, verify_get, verify_options, verify_post, verify_put, verify_request

Constructor Details

#initialize(attrs = {}) ⇒ Gateway

Returns a new instance of Gateway.



14
15
16
17
# File 'lib/spreedly_core/gateway.rb', line 14

def initialize(attrs={})
  attrs.merge!(attrs.delete("characteristics") || {})
  super(attrs)
end

Instance Attribute Details

#auth_modesObject (readonly)

Returns the value of attribute auth_modes.



3
4
5
# File 'lib/spreedly_core/gateway.rb', line 3

def auth_modes
  @auth_modes
end

#gateway_typeObject (readonly)

Returns the value of attribute gateway_type.



3
4
5
# File 'lib/spreedly_core/gateway.rb', line 3

def gateway_type
  @gateway_type
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/spreedly_core/gateway.rb', line 3

def name
  @name
end

#supports_authorizeObject (readonly)

Returns the value of attribute supports_authorize.



3
4
5
# File 'lib/spreedly_core/gateway.rb', line 3

def supports_authorize
  @supports_authorize
end

#supports_captureObject (readonly)

Returns the value of attribute supports_capture.



3
4
5
# File 'lib/spreedly_core/gateway.rb', line 3

def supports_capture
  @supports_capture
end

#supports_creditObject (readonly)

Returns the value of attribute supports_credit.



3
4
5
# File 'lib/spreedly_core/gateway.rb', line 3

def supports_credit
  @supports_credit
end

#supports_purchaseObject (readonly)

Returns the value of attribute supports_purchase.



3
4
5
# File 'lib/spreedly_core/gateway.rb', line 3

def supports_purchase
  @supports_purchase
end

#supports_voidObject (readonly)

Returns the value of attribute supports_void.



3
4
5
# File 'lib/spreedly_core/gateway.rb', line 3

def supports_void
  @supports_void
end

Class Method Details

.supported_gatewaysObject

returns an array of Gateway which are supported



8
9
10
11
12
# File 'lib/spreedly_core/gateway.rb', line 8

def self.supported_gateways
  verify_options("/gateways.xml") do |response|
    response.parsed_response["gateways"]["gateway"].map{|h| new(h) }
  end
end