Class: AchClient::ICheckGateway::CompanyInfo

Inherits:
Abstract::CompanyInfo show all
Defined in:
lib/ach_client/providers/soap/i_check_gateway/company_info.rb

Overview

ICheckGateway credentials for your company

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, site_i_d:, site_key:, live:) ⇒ CompanyInfo

Returns a new instance of CompanyInfo.

Parameters:

  • api_key (String)

    your ICheckGateway API key

  • site_i_d (String)

    your ICheckGateway SiteID

  • site_key (String)

    your ICheckGateway SiteKey

  • live (Boolean)

    “GatewayLiveMode” value



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ach_client/providers/soap/i_check_gateway/company_info.rb', line 15

def initialize(
  api_key:,
  site_i_d:,
  site_key:,
  live:
)
  @api_key = api_key
  @site_i_d = site_i_d
  @site_key = site_key
  @live = live
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



5
6
7
# File 'lib/ach_client/providers/soap/i_check_gateway/company_info.rb', line 5

def api_key
  @api_key
end

#liveObject (readonly)

Returns the value of attribute live.



5
6
7
# File 'lib/ach_client/providers/soap/i_check_gateway/company_info.rb', line 5

def live
  @live
end

#site_i_dObject (readonly)

Returns the value of attribute site_i_d.



5
6
7
# File 'lib/ach_client/providers/soap/i_check_gateway/company_info.rb', line 5

def site_i_d
  @site_i_d
end

#site_keyObject (readonly)

Returns the value of attribute site_key.



5
6
7
# File 'lib/ach_client/providers/soap/i_check_gateway/company_info.rb', line 5

def site_key
  @site_key
end

Class Method Details

.buildCompanyInfo

Returns instance built from configuration values.

Returns:

  • (CompanyInfo)

    instance built from configuration values



29
30
31
32
33
34
35
36
# File 'lib/ach_client/providers/soap/i_check_gateway/company_info.rb', line 29

def self.build
  build_from_config([
    :api_key,
    :live,
    :site_i_d,
    :site_key
  ])
end

Instance Method Details

#to_hashHash

Build a hash to send to ICheckGateway

Returns:

  • (Hash)

    hash to send to ICheckGateway



41
42
43
44
45
46
47
48
# File 'lib/ach_client/providers/soap/i_check_gateway/company_info.rb', line 41

def to_hash
  {
    SiteID: @site_i_d,
    SiteKey: @site_key,
    APIKey: @api_key,
    GatewayLiveMode: @live ? '1' : '0'
  }
end