Class: Adyen::StoredValue

Inherits:
Service
  • Object
show all
Defined in:
lib/adyen/services/storedValue.rb

Constant Summary collapse

DEFAULT_VERSION =
46

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Service

action_for_method_name, #create_query_string

Constructor Details

#initialize(client, version = DEFAULT_VERSION) ⇒ StoredValue

Returns a new instance of StoredValue.



7
8
9
# File 'lib/adyen/services/storedValue.rb', line 7

def initialize(client, version = DEFAULT_VERSION)
  super(client, version, 'StoredValue')
end

Instance Attribute Details

#serviceObject

Returns the value of attribute service.



4
5
6
# File 'lib/adyen/services/storedValue.rb', line 4

def service
  @service
end

#versionObject

Returns the value of attribute version.



4
5
6
# File 'lib/adyen/services/storedValue.rb', line 4

def version
  @version
end

Instance Method Details

#change_status(request, headers: {}) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/adyen/services/storedValue.rb', line 11

def change_status(request, headers: {})
  endpoint = '/changeStatus'.gsub(/{.+?}/, '%s')
  endpoint = endpoint.gsub(%r{^/}, '')
  endpoint = format(endpoint)
  
  action = { method: 'post', url: endpoint }
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#check_balance(request, headers: {}) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/adyen/services/storedValue.rb', line 20

def check_balance(request, headers: {})
  endpoint = '/checkBalance'.gsub(/{.+?}/, '%s')
  endpoint = endpoint.gsub(%r{^/}, '')
  endpoint = format(endpoint)
  
  action = { method: 'post', url: endpoint }
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#issue(request, headers: {}) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/adyen/services/storedValue.rb', line 29

def issue(request, headers: {})
  endpoint = '/issue'.gsub(/{.+?}/, '%s')
  endpoint = endpoint.gsub(%r{^/}, '')
  endpoint = format(endpoint)
  
  action = { method: 'post', url: endpoint }
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#load(request, headers: {}) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/adyen/services/storedValue.rb', line 38

def load(request, headers: {})
  endpoint = '/load'.gsub(/{.+?}/, '%s')
  endpoint = endpoint.gsub(%r{^/}, '')
  endpoint = format(endpoint)
  
  action = { method: 'post', url: endpoint }
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#merge_balance(request, headers: {}) ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/adyen/services/storedValue.rb', line 47

def merge_balance(request, headers: {})
  endpoint = '/mergeBalance'.gsub(/{.+?}/, '%s')
  endpoint = endpoint.gsub(%r{^/}, '')
  endpoint = format(endpoint)
  
  action = { method: 'post', url: endpoint }
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#void_transaction(request, headers: {}) ⇒ Object



56
57
58
59
60
61
62
63
# File 'lib/adyen/services/storedValue.rb', line 56

def void_transaction(request, headers: {})
  endpoint = '/voidTransaction'.gsub(/{.+?}/, '%s')
  endpoint = endpoint.gsub(%r{^/}, '')
  endpoint = format(endpoint)
  
  action = { method: 'post', url: endpoint }
  @client.call_adyen_api(@service, action, request, headers, @version)
end