Class: Adyen::StoredValue
- Defined in:
- lib/adyen/services/storedValue.rb
Constant Summary collapse
- DEFAULT_VERSION =
46
Instance Attribute Summary collapse
-
#service ⇒ Object
Returns the value of attribute service.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from Service
Instance Method Summary collapse
- #change_status(request, headers: {}) ⇒ Object
- #check_balance(request, headers: {}) ⇒ Object
-
#initialize(client, version = DEFAULT_VERSION) ⇒ StoredValue
constructor
A new instance of StoredValue.
- #issue(request, headers: {}) ⇒ Object
- #load(request, headers: {}) ⇒ Object
- #merge_balance(request, headers: {}) ⇒ Object
- #void_transaction(request, headers: {}) ⇒ Object
Methods inherited from Service
Constructor Details
#initialize(client, version = DEFAULT_VERSION) ⇒ StoredValue
Returns a new instance of StoredValue.
9 10 11 12 13 |
# File 'lib/adyen/services/storedValue.rb', line 9 def initialize(client, version = DEFAULT_VERSION) @service = "StoredValue" @client = client @version = version end |
Instance Attribute Details
#service ⇒ Object
Returns the value of attribute service.
6 7 8 |
# File 'lib/adyen/services/storedValue.rb', line 6 def service @service end |
#version ⇒ Object
Returns the value of attribute version.
6 7 8 |
# File 'lib/adyen/services/storedValue.rb', line 6 def version @version end |
Instance Method Details
#change_status(request, headers: {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/adyen/services/storedValue.rb', line 15 def change_status(request, headers: {} ) """ Changes the status of the payment method. """ endpoint = "/changeStatus".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#check_balance(request, headers: {}) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/adyen/services/storedValue.rb', line 27 def check_balance(request, headers: {} ) """ Checks the balance. """ endpoint = "/checkBalance".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#issue(request, headers: {}) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/adyen/services/storedValue.rb', line 39 def issue(request, headers: {} ) """ Issues a new card. """ endpoint = "/issue".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#load(request, headers: {}) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/adyen/services/storedValue.rb', line 51 def load(request, headers: {} ) """ Loads the payment method. """ endpoint = "/load".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#merge_balance(request, headers: {}) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/adyen/services/storedValue.rb', line 63 def merge_balance(request, headers: {} ) """ Merge the balance of two cards. """ endpoint = "/mergeBalance".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#void_transaction(request, headers: {}) ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/adyen/services/storedValue.rb', line 75 def void_transaction(request, headers: {} ) """ Voids a transaction. """ endpoint = "/voidTransaction".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |