Class: Adyen::RecurringApi

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

Instance Attribute Summary collapse

Attributes inherited from Service

#create_query_string

Instance Method Summary collapse

Methods inherited from Service

action_for_method_name

Constructor Details

#initialize(client, version = DEFAULT_VERSION) ⇒ RecurringApi

Returns a new instance of RecurringApi.



8
9
10
11
12
# File 'lib/adyen/services/checkout/recurring_api.rb', line 8

def initialize(client, version = DEFAULT_VERSION)
  @service = "Checkout"
  @client = client
  @version = version
end

Instance Attribute Details

#serviceObject

Returns the value of attribute service.



6
7
8
# File 'lib/adyen/services/checkout/recurring_api.rb', line 6

def service
  @service
end

#versionObject

Returns the value of attribute version.



6
7
8
# File 'lib/adyen/services/checkout/recurring_api.rb', line 6

def version
  @version
end

Instance Method Details

#delete_token_for_stored_payment_details(recurringId, headers: {}, queryParams: {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/adyen/services/checkout/recurring_api.rb', line 14

def delete_token_for_stored_payment_details(recurringId, headers: {} , queryParams: {})
  """
  Delete a token for stored payment details
  """
  endpoint = "/storedPaymentMethods/{recurringId}".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [recurringId]
  endpoint = endpoint + create_query_string(queryParams)
  action = { method: "delete", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end

#get_tokens_for_stored_payment_details(headers: {}, queryParams: {}) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/adyen/services/checkout/recurring_api.rb', line 26

def get_tokens_for_stored_payment_details(headers: {} , queryParams: {})
  """
  Get tokens for stored payment details
  """
  endpoint = "/storedPaymentMethods".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % []
  endpoint = endpoint + create_query_string(queryParams)
  action = { method: "get", url: endpoint}
  @client.call_adyen_api(@service, action, {}, headers, @version)
end