Class: Paynl::Config

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

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.getApiTokenObject

getApiToken - Retrieves Pay.nl api token



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

def self.getApiToken
  return @@apiToken
end

.getApiUrl(endpoint, version = nil) ⇒ Object

getApiUrl - Get constructed API Url for the given endpoint



39
40
41
42
43
44
45
# File 'lib/paynl/config.rb', line 39

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



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

def self.getApiVersion
  return @@apiVersion
end

.getServiceIdObject

getServiceId - Retrieves Pay.nl Service Id



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

def self.getServiceId
  return @@serviceId
end

.setApiToken(apiToken) ⇒ Object

setApiToken - Sets Pay.nl api token



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

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

.setApiVersion(apiVersion) ⇒ Object

setApiVersion - Set the Pay.nl Api version



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

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

.setServiceId(serviceId) ⇒ Object

setServiceId - Set the Pay.nl Service Id



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

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