Class: Paynl::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/paynl/config.rb

Constant Summary collapse

@@apiToken =
''
@@tokenCode =
''
@@serviceId =
''
@@apiBase =
'https://rest-api.pay.nl'
@@apiVersion =
5

Class Method Summary collapse

Class Method Details

.getApiTokenObject

getApiToken - Retrieves Pay.nl api token



20
21
22
# File 'lib/paynl/config.rb', line 20

def self.getApiToken
  return @@apiToken
end

.getApiUrl(endpoint, version = nil) ⇒ Object

getApiUrl - Get constructed API Url for the given endpoint



50
51
52
53
54
55
56
# File 'lib/paynl/config.rb', line 50

def self.getApiUrl(endpoint, version = nil)
  unless !version.nil?
    version = @@apiVersion
  end

  return @@apiBase + '/v' + version.to_s + '/' + endpoint + '/json'
end

.getApiVersionObject

getApiVersion - Retrieves Pay.nl Api version



40
41
42
# File 'lib/paynl/config.rb', line 40

def self.getApiVersion
  return @@apiVersion
end

.getServiceIdObject

getServiceId - Retrieves Pay.nl Service Id



30
31
32
# File 'lib/paynl/config.rb', line 30

def self.getServiceId
  return @@serviceId
end

.getTokenCodeObject

getTokenCode - Retrieves Pay.nl tokencode



10
11
12
# File 'lib/paynl/config.rb', line 10

def self.getTokenCode
  return @@tokenCode
end

.setApiToken(apiToken) ⇒ Object

setApiToken - Sets Pay.nl api token



25
26
27
# File 'lib/paynl/config.rb', line 25

def self.setApiToken(apiToken)
  @@apiToken = apiToken
end

.setApiVersion(apiVersion) ⇒ Object

setApiVersion - Set the Pay.nl Api version



45
46
47
# File 'lib/paynl/config.rb', line 45

def self.setApiVersion(apiVersion)
  @@apiVersion = apiVersion
end

.setServiceId(serviceId) ⇒ Object

setServiceId - Set the Pay.nl Service Id



35
36
37
# File 'lib/paynl/config.rb', line 35

def self.setServiceId(serviceId)
  @@serviceId = serviceId
end

.setTokenCode(tokenCode) ⇒ Object

setTokenCode - Sets Pay.nl tokencode



15
16
17
# File 'lib/paynl/config.rb', line 15

def self.setTokenCode(tokenCode)
  @@tokenCode = tokenCode
end