Class: PayCertify::Gateway

Inherits:
Object
  • Object
show all
Defined in:
lib/paycertify/gateway.rb,
lib/paycertify/gateway/base.rb,
lib/paycertify/gateway/charge.rb,
lib/paycertify/gateway/client.rb,
lib/paycertify/gateway/customer.rb,
lib/paycertify/gateway/response.rb,
lib/paycertify/gateway/credit_card.rb,
lib/paycertify/gateway/transaction.rb,
lib/paycertify/gateway/base/resource.rb,
lib/paycertify/gateway/base/validation.rb,
lib/paycertify/gateway/attribute_mapping.rb

Defined Under Namespace

Modules: AttributeMapping, Base Classes: Charge, Client, CreditCard, Customer, Response, Transaction

Constant Summary collapse

CREDENTIALS_PATH =
'/ws/encgateway2.asmx/GetCredential'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



17
18
19
# File 'lib/paycertify/gateway.rb', line 17

def api_key
  @api_key
end

.modeObject

Returns the value of attribute mode.



17
18
19
# File 'lib/paycertify/gateway.rb', line 17

def mode
  @mode
end

.vendorObject

Returns the value of attribute vendor.



17
18
19
# File 'lib/paycertify/gateway.rb', line 17

def vendor
  @vendor
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/paycertify/gateway.rb', line 19

def configure(&block)
  yield self if block_given?

  client = PayCertify::Gateway::Client.new(api_key: api_key, mode: mode)
  response = client.get(path: CREDENTIALS_PATH)
  
  self.vendor = response['response']['vendor']

  return {
    api_key: api_key,
    mode: mode,
    vendor: vendor
  }
end