Class: Adyen::ModificationsApi

Inherits:
Service
  • Object
show all
Defined in:
lib/adyen/services/checkout/modifications_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) ⇒ ModificationsApi

Returns a new instance of ModificationsApi.



8
9
10
11
12
# File 'lib/adyen/services/checkout/modifications_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/modifications_api.rb', line 6

def service
  @service
end

#versionObject

Returns the value of attribute version.



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

def version
  @version
end

Instance Method Details

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



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

def cancel_authorised_payment(request, headers: {} )
  """
  Cancel an authorised payment
  """
  endpoint = "/cancels".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % []
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#cancel_authorised_payment_by_psp_reference(request, paymentPspReference, headers: {}) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/adyen/services/checkout/modifications_api.rb', line 38

def cancel_authorised_payment_by_psp_reference(request, paymentPspReference, headers: {} )
  """
  Cancel an authorised payment
  """
  endpoint = "/payments/{paymentPspReference}/cancels".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [paymentPspReference]
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#capture_authorised_payment(request, paymentPspReference, headers: {}) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/adyen/services/checkout/modifications_api.rb', line 50

def capture_authorised_payment(request, paymentPspReference, headers: {} )
  """
  Capture an authorised payment
  """
  endpoint = "/payments/{paymentPspReference}/captures".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [paymentPspReference]
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#refund_captured_payment(request, paymentPspReference, headers: {}) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/adyen/services/checkout/modifications_api.rb', line 62

def refund_captured_payment(request, paymentPspReference, headers: {} )
  """
  Refund a captured payment
  """
  endpoint = "/payments/{paymentPspReference}/refunds".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [paymentPspReference]
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#refund_or_cancel_payment(request, paymentPspReference, headers: {}) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
# File 'lib/adyen/services/checkout/modifications_api.rb', line 74

def refund_or_cancel_payment(request, paymentPspReference, headers: {} )
  """
  Refund or cancel a payment
  """
  endpoint = "/payments/{paymentPspReference}/reversals".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [paymentPspReference]
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end

#update_authorised_amount(request, paymentPspReference, headers: {}) ⇒ Object



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

def update_authorised_amount(request, paymentPspReference, headers: {} )
  """
  Update an authorised amount
  """
  endpoint = "/payments/{paymentPspReference}/amountUpdates".gsub(/{.+?}/, '%s') 
  endpoint = endpoint.gsub(/^\//, "")
  endpoint = endpoint % [paymentPspReference]
  
  action = { method: "post", url: endpoint}
  @client.call_adyen_api(@service, action, request, headers, @version)
end