Module: Netaxept::Service::Configuration

Included in:
Netaxept::Service
Defined in:
lib/netaxept/service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#merchant_idObject

Returns the value of attribute merchant_id.



11
12
13
# File 'lib/netaxept/service.rb', line 11

def merchant_id
  @merchant_id
end

Instance Method Details

#authenticate(merchant_id, token) ⇒ Object

Stores the merchant id and the token for later requests



16
17
18
19
20
21
22
# File 'lib/netaxept/service.rb', line 16

def authenticate(merchant_id, token)
  self.merchant_id = merchant_id
  default_params({
    :MerchantId => merchant_id,
    :token => token
    })
end

#environment=(new_environment) ⇒ Object

Switches between sandbox and production environment



27
28
29
30
31
32
33
34
# File 'lib/netaxept/service.rb', line 27

def environment=(new_environment)
  if(new_environment == :production)
    base_uri "https://epayment.bbs.no/"
  end
  if(new_environment == :test)
    base_uri "https://epayment-test.bbs.no/"
  end
end