Class: Adyen::Payment

Inherits:
Service show all
Defined in:
lib/adyen/services/payment.rb

Constant Summary collapse

DEFAULT_VERSION =
68

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) ⇒ Payment

Returns a new instance of Payment.



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

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

Instance Attribute Details

#serviceObject

Returns the value of attribute service.



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

def service
  @service
end

#versionObject

Returns the value of attribute version.



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

def version
  @version
end

Instance Method Details

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



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

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

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



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

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

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



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

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

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



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

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

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



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

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

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



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

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

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



65
66
67
68
69
70
71
72
# File 'lib/adyen/services/payment.rb', line 65

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


74
75
76
77
78
79
80
81
# File 'lib/adyen/services/payment.rb', line 74

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

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



83
84
85
86
87
88
89
90
# File 'lib/adyen/services/payment.rb', line 83

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

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



92
93
94
95
96
97
98
99
# File 'lib/adyen/services/payment.rb', line 92

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

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



101
102
103
104
105
106
107
108
# File 'lib/adyen/services/payment.rb', line 101

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

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



110
111
112
113
114
115
116
117
# File 'lib/adyen/services/payment.rb', line 110

def technical_cancel(request, headers: {})
  endpoint = '/technicalCancel'.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_pending_refund(request, headers: {}) ⇒ Object



119
120
121
122
123
124
125
126
# File 'lib/adyen/services/payment.rb', line 119

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