adyen-ruby-api-library 7.0.0 → 7.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -1
- data/.github/release.yml +18 -0
- data/.github/workflows/gh_release.yml +16 -0
- data/.github/workflows/release_request.yml +15 -0
- data/.github/workflows/ruby.yml +1 -1
- data/.github/workflows/services.yml +28 -0
- data/.rubocop.yml +8 -0
- data/Gemfile +7 -7
- data/Makefile +14 -10
- data/README.md +13 -10
- data/Rakefile +3 -3
- data/adyen-ruby-api-library.gemspec +6 -3
- data/bin/console +2 -2
- data/lib/adyen/client.rb +96 -76
- data/lib/adyen/errors.rb +23 -18
- data/lib/adyen/hash_with_accessors.rb +12 -7
- data/lib/adyen/services/balanceControlService.rb +7 -14
- data/lib/adyen/services/balancePlatform/account_holders_api.rb +22 -38
- data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +48 -79
- data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +6 -13
- data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +6 -13
- data/lib/adyen/services/balancePlatform/grant_offers_api.rb +12 -22
- data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +16 -29
- data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +26 -45
- data/lib/adyen/services/balancePlatform/platform_api.rb +12 -22
- data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +21 -37
- data/lib/adyen/services/balancePlatform.rb +38 -40
- data/lib/adyen/services/binLookup.rb +12 -22
- data/lib/adyen/services/checkout/classic_checkout_sdk_api.rb +11 -21
- data/lib/adyen/services/checkout/modifications_api.rb +31 -53
- data/lib/adyen/services/checkout/orders_api.rb +16 -29
- data/lib/adyen/services/checkout/payment_links_api.rb +16 -29
- data/lib/adyen/services/checkout/payments_api.rb +40 -53
- data/lib/adyen/services/checkout/recurring_api.rb +13 -23
- data/lib/adyen/services/checkout/utility_api.rb +11 -21
- data/lib/adyen/services/checkout.rb +32 -34
- data/lib/adyen/services/dataProtection.rb +7 -14
- data/lib/adyen/services/dispute.rb +6 -5
- data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +21 -37
- data/lib/adyen/services/legalEntityManagement/documents_api.rb +21 -37
- data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +16 -29
- data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +26 -45
- data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +21 -37
- data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +25 -29
- data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +21 -37
- data/lib/adyen/services/legalEntityManagement.rb +32 -34
- data/lib/adyen/services/management/account_company_level_api.rb +18 -31
- data/lib/adyen/services/management/account_merchant_level_api.rb +22 -38
- data/lib/adyen/services/management/account_store_level_api.rb +43 -71
- data/lib/adyen/services/management/allowed_origins_company_level_api.rb +21 -37
- data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +21 -37
- data/lib/adyen/services/management/api_credentials_company_level_api.rb +22 -38
- data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +22 -38
- data/lib/adyen/services/management/api_key_company_level_api.rb +6 -13
- data/lib/adyen/services/management/api_key_merchant_level_api.rb +6 -13
- data/lib/adyen/services/management/client_key_company_level_api.rb +6 -13
- data/lib/adyen/services/management/client_key_merchant_level_api.rb +6 -13
- data/lib/adyen/services/management/my_api_credential_api.rb +26 -45
- data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +32 -54
- data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +26 -45
- data/lib/adyen/services/management/split_configuration_merchant_level_api.rb +92 -0
- data/lib/adyen/services/management/terminal_actions_company_level_api.rb +24 -40
- data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +6 -13
- data/lib/adyen/services/management/terminal_orders_company_level_api.rb +55 -89
- data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +55 -89
- data/lib/adyen/services/management/terminal_settings_company_level_api.rb +23 -39
- data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +23 -39
- data/lib/adyen/services/management/terminal_settings_store_level_api.rb +45 -73
- data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +21 -37
- data/lib/adyen/services/management/terminals_terminal_level_api.rb +7 -14
- data/lib/adyen/services/management/users_company_level_api.rb +22 -38
- data/lib/adyen/services/management/users_merchant_level_api.rb +22 -38
- data/lib/adyen/services/management/webhooks_company_level_api.rb +37 -62
- data/lib/adyen/services/management/webhooks_merchant_level_api.rb +37 -62
- data/lib/adyen/services/management.rb +99 -96
- data/lib/adyen/services/marketpay.rb +42 -36
- data/lib/adyen/services/payment/general_api.rb +56 -0
- data/lib/adyen/services/payment/modifications_api.rb +83 -0
- data/lib/adyen/services/payment.rb +10 -158
- data/lib/adyen/services/payout/initialization_api.rb +16 -29
- data/lib/adyen/services/payout/instant_payouts_api.rb +6 -13
- data/lib/adyen/services/payout/reviewing_api.rb +11 -21
- data/lib/adyen/services/payout.rb +19 -21
- data/lib/adyen/services/posTerminalManagement.rb +27 -46
- data/lib/adyen/services/recurring.rb +32 -54
- data/lib/adyen/services/service.rb +5 -4
- data/lib/adyen/services/storedValue.rb +32 -54
- data/lib/adyen/services/transfers/capital_api.rb +38 -0
- data/lib/adyen/services/transfers/transactions_api.rb +12 -22
- data/lib/adyen/services/transfers/transfers_api.rb +6 -13
- data/lib/adyen/services/transfers.rb +20 -17
- data/lib/adyen/utils/hmac_validator.rb +9 -9
- data/lib/adyen/version.rb +3 -3
- data/lib/adyen-ruby-api-library.rb +21 -21
- data/spec/account_spec.rb +20 -20
- data/spec/balance_control_spec.rb +28 -29
- data/spec/balance_platform_spec.rb +108 -102
- data/spec/bin_lookup_spec.rb +50 -50
- data/spec/checkout_spec.rb +581 -515
- data/spec/client_spec.rb +118 -71
- data/spec/data_protection_spec.rb +4 -4
- data/spec/dispute_spec.rb +7 -7
- data/spec/errors_spec.rb +37 -17
- data/spec/fund_spec.rb +10 -10
- data/spec/hash_with_accessors_spec.rb +18 -8
- data/spec/hop_spec.rb +4 -4
- data/spec/lem_spec.rb +44 -49
- data/spec/management_spec.rb +46 -48
- data/spec/notification_spec.rb +9 -9
- data/spec/payments_spec.rb +31 -32
- data/spec/payouts_spec.rb +29 -32
- data/spec/pos_terminal_management_spec.rb +30 -32
- data/spec/recurring_spec.rb +8 -8
- data/spec/service_spec.rb +4 -0
- data/spec/spec_helper.rb +37 -35
- data/spec/stored_value_spec.rb +28 -27
- data/spec/transfers_spec.rb +48 -47
- data/spec/utils/hmac_validator_spec.rb +15 -14
- data/templates/api-single.mustache +13 -15
- data/templates/api-small.mustache +8 -15
- data/templates/api.mustache +7 -14
- metadata +27 -18
- data/.github/dependabot.yml +0 -8
- /data/spec/mocks/responses/Webhooks/{backslash_notification.json → backslash_webhook.json} +0 -0
- /data/spec/mocks/responses/Webhooks/{colon_notification.json → colon_webhook.json} +0 -0
- /data/spec/mocks/responses/Webhooks/{forwardslash_notification.json → forwardslash_webhook.json} +0 -0
- /data/spec/mocks/responses/Webhooks/{mixed_notification.json → mixed_webhook.json} +0 -0
@@ -1,171 +1,23 @@
|
|
1
|
-
require_relative '
|
2
|
-
|
3
|
-
|
1
|
+
require_relative 'payment/general_api'
|
2
|
+
require_relative 'payment/modifications_api'
|
4
3
|
|
5
|
-
|
4
|
+
module Adyen
|
5
|
+
class Payment
|
6
6
|
attr_accessor :service, :version
|
7
|
-
DEFAULT_VERSION = 68
|
8
7
|
|
8
|
+
DEFAULT_VERSION = 68
|
9
9
|
def initialize(client, version = DEFAULT_VERSION)
|
10
|
-
@service =
|
10
|
+
@service = 'Payment'
|
11
11
|
@client = client
|
12
12
|
@version = version
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
|
17
|
-
Change the authorised amount
|
18
|
-
"""
|
19
|
-
endpoint = "/adjustAuthorisation".gsub(/{.+?}/, '%s')
|
20
|
-
endpoint = endpoint.gsub(/^\//, "")
|
21
|
-
endpoint = endpoint % []
|
22
|
-
|
23
|
-
action = { method: "post", url: endpoint}
|
24
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
25
|
-
end
|
26
|
-
|
27
|
-
def authorise(request, headers: {} )
|
28
|
-
"""
|
29
|
-
Create an authorisation
|
30
|
-
"""
|
31
|
-
endpoint = "/authorise".gsub(/{.+?}/, '%s')
|
32
|
-
endpoint = endpoint.gsub(/^\//, "")
|
33
|
-
endpoint = endpoint % []
|
34
|
-
|
35
|
-
action = { method: "post", url: endpoint}
|
36
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
37
|
-
end
|
38
|
-
|
39
|
-
def authorise3d(request, headers: {} )
|
40
|
-
"""
|
41
|
-
Complete a 3DS authorisation
|
42
|
-
"""
|
43
|
-
endpoint = "/authorise3d".gsub(/{.+?}/, '%s')
|
44
|
-
endpoint = endpoint.gsub(/^\//, "")
|
45
|
-
endpoint = endpoint % []
|
46
|
-
|
47
|
-
action = { method: "post", url: endpoint}
|
48
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
49
|
-
end
|
50
|
-
|
51
|
-
def authorise3ds2(request, headers: {} )
|
52
|
-
"""
|
53
|
-
Complete a 3DS2 authorisation
|
54
|
-
"""
|
55
|
-
endpoint = "/authorise3ds2".gsub(/{.+?}/, '%s')
|
56
|
-
endpoint = endpoint.gsub(/^\//, "")
|
57
|
-
endpoint = endpoint % []
|
58
|
-
|
59
|
-
action = { method: "post", url: endpoint}
|
60
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
61
|
-
end
|
62
|
-
|
63
|
-
def cancel(request, headers: {} )
|
64
|
-
"""
|
65
|
-
Cancel an authorisation
|
66
|
-
"""
|
67
|
-
endpoint = "/cancel".gsub(/{.+?}/, '%s')
|
68
|
-
endpoint = endpoint.gsub(/^\//, "")
|
69
|
-
endpoint = endpoint % []
|
70
|
-
|
71
|
-
action = { method: "post", url: endpoint}
|
72
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
73
|
-
end
|
74
|
-
|
75
|
-
def cancel_or_refund(request, headers: {} )
|
76
|
-
"""
|
77
|
-
Cancel or refund a payment
|
78
|
-
"""
|
79
|
-
endpoint = "/cancelOrRefund".gsub(/{.+?}/, '%s')
|
80
|
-
endpoint = endpoint.gsub(/^\//, "")
|
81
|
-
endpoint = endpoint % []
|
82
|
-
|
83
|
-
action = { method: "post", url: endpoint}
|
84
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
85
|
-
end
|
86
|
-
|
87
|
-
def capture(request, headers: {} )
|
88
|
-
"""
|
89
|
-
Capture an authorisation
|
90
|
-
"""
|
91
|
-
endpoint = "/capture".gsub(/{.+?}/, '%s')
|
92
|
-
endpoint = endpoint.gsub(/^\//, "")
|
93
|
-
endpoint = endpoint % []
|
94
|
-
|
95
|
-
action = { method: "post", url: endpoint}
|
96
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
97
|
-
end
|
98
|
-
|
99
|
-
def donate(request, headers: {} )
|
100
|
-
"""
|
101
|
-
Create a donation
|
102
|
-
"""
|
103
|
-
endpoint = "/donate".gsub(/{.+?}/, '%s')
|
104
|
-
endpoint = endpoint.gsub(/^\//, "")
|
105
|
-
endpoint = endpoint % []
|
106
|
-
|
107
|
-
action = { method: "post", url: endpoint}
|
108
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
109
|
-
end
|
110
|
-
|
111
|
-
def get_authentication_result(request, headers: {} )
|
112
|
-
"""
|
113
|
-
Get the 3DS authentication result
|
114
|
-
"""
|
115
|
-
endpoint = "/getAuthenticationResult".gsub(/{.+?}/, '%s')
|
116
|
-
endpoint = endpoint.gsub(/^\//, "")
|
117
|
-
endpoint = endpoint % []
|
118
|
-
|
119
|
-
action = { method: "post", url: endpoint}
|
120
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
121
|
-
end
|
122
|
-
|
123
|
-
def refund(request, headers: {} )
|
124
|
-
"""
|
125
|
-
Refund a captured payment
|
126
|
-
"""
|
127
|
-
endpoint = "/refund".gsub(/{.+?}/, '%s')
|
128
|
-
endpoint = endpoint.gsub(/^\//, "")
|
129
|
-
endpoint = endpoint % []
|
130
|
-
|
131
|
-
action = { method: "post", url: endpoint}
|
132
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
133
|
-
end
|
134
|
-
|
135
|
-
def retrieve3ds2_result(request, headers: {} )
|
136
|
-
"""
|
137
|
-
Get the 3DS2 authentication result
|
138
|
-
"""
|
139
|
-
endpoint = "/retrieve3ds2Result".gsub(/{.+?}/, '%s')
|
140
|
-
endpoint = endpoint.gsub(/^\//, "")
|
141
|
-
endpoint = endpoint % []
|
142
|
-
|
143
|
-
action = { method: "post", url: endpoint}
|
144
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
145
|
-
end
|
146
|
-
|
147
|
-
def technical_cancel(request, headers: {} )
|
148
|
-
"""
|
149
|
-
Cancel an authorisation using your reference
|
150
|
-
"""
|
151
|
-
endpoint = "/technicalCancel".gsub(/{.+?}/, '%s')
|
152
|
-
endpoint = endpoint.gsub(/^\//, "")
|
153
|
-
endpoint = endpoint % []
|
154
|
-
|
155
|
-
action = { method: "post", url: endpoint}
|
156
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
15
|
+
def general_api
|
16
|
+
@general_api ||= Adyen::GeneralApi.new(@client, @version)
|
157
17
|
end
|
158
18
|
|
159
|
-
def
|
160
|
-
|
161
|
-
Cancel an in-person refund
|
162
|
-
"""
|
163
|
-
endpoint = "/voidPendingRefund".gsub(/{.+?}/, '%s')
|
164
|
-
endpoint = endpoint.gsub(/^\//, "")
|
165
|
-
endpoint = endpoint % []
|
166
|
-
|
167
|
-
action = { method: "post", url: endpoint}
|
168
|
-
@client.call_adyen_api(@service, action, request, headers, @version)
|
19
|
+
def modifications_api
|
20
|
+
@modifications_api ||= Adyen::ModificationsApi.new(@client, @version)
|
169
21
|
end
|
170
22
|
|
171
23
|
end
|
@@ -1,49 +1,36 @@
|
|
1
1
|
require_relative '../service'
|
2
2
|
module Adyen
|
3
|
-
|
4
|
-
|
5
3
|
class InitializationApi < Service
|
6
4
|
attr_accessor :service, :version
|
7
5
|
|
8
6
|
def initialize(client, version = DEFAULT_VERSION)
|
9
|
-
|
10
|
-
@client = client
|
11
|
-
@version = version
|
7
|
+
super(client, version, 'Payout')
|
12
8
|
end
|
13
9
|
|
14
|
-
def store_detail(request, headers: {}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
endpoint = "/storeDetail".gsub(/{.+?}/, '%s')
|
19
|
-
endpoint = endpoint.gsub(/^\//, "")
|
20
|
-
endpoint = endpoint % []
|
10
|
+
def store_detail(request, headers: {})
|
11
|
+
endpoint = '/storeDetail'.gsub(/{.+?}/, '%s')
|
12
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
13
|
+
endpoint = format(endpoint)
|
21
14
|
|
22
|
-
action = { method:
|
15
|
+
action = { method: 'post', url: endpoint }
|
23
16
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
24
17
|
end
|
25
18
|
|
26
|
-
def store_detail_and_submit_third_party(request, headers: {}
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
endpoint = "/storeDetailAndSubmitThirdParty".gsub(/{.+?}/, '%s')
|
31
|
-
endpoint = endpoint.gsub(/^\//, "")
|
32
|
-
endpoint = endpoint % []
|
19
|
+
def store_detail_and_submit_third_party(request, headers: {})
|
20
|
+
endpoint = '/storeDetailAndSubmitThirdParty'.gsub(/{.+?}/, '%s')
|
21
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
22
|
+
endpoint = format(endpoint)
|
33
23
|
|
34
|
-
action = { method:
|
24
|
+
action = { method: 'post', url: endpoint }
|
35
25
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
36
26
|
end
|
37
27
|
|
38
|
-
def submit_third_party(request, headers: {}
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
endpoint = "/submitThirdParty".gsub(/{.+?}/, '%s')
|
43
|
-
endpoint = endpoint.gsub(/^\//, "")
|
44
|
-
endpoint = endpoint % []
|
28
|
+
def submit_third_party(request, headers: {})
|
29
|
+
endpoint = '/submitThirdParty'.gsub(/{.+?}/, '%s')
|
30
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
31
|
+
endpoint = format(endpoint)
|
45
32
|
|
46
|
-
action = { method:
|
33
|
+
action = { method: 'post', url: endpoint }
|
47
34
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
48
35
|
end
|
49
36
|
|
@@ -1,25 +1,18 @@
|
|
1
1
|
require_relative '../service'
|
2
2
|
module Adyen
|
3
|
-
|
4
|
-
|
5
3
|
class InstantPayoutsApi < Service
|
6
4
|
attr_accessor :service, :version
|
7
5
|
|
8
6
|
def initialize(client, version = DEFAULT_VERSION)
|
9
|
-
|
10
|
-
@client = client
|
11
|
-
@version = version
|
7
|
+
super(client, version, 'Payout')
|
12
8
|
end
|
13
9
|
|
14
|
-
def payout(request, headers: {}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
endpoint = "/payout".gsub(/{.+?}/, '%s')
|
19
|
-
endpoint = endpoint.gsub(/^\//, "")
|
20
|
-
endpoint = endpoint % []
|
10
|
+
def payout(request, headers: {})
|
11
|
+
endpoint = '/payout'.gsub(/{.+?}/, '%s')
|
12
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
13
|
+
endpoint = format(endpoint)
|
21
14
|
|
22
|
-
action = { method:
|
15
|
+
action = { method: 'post', url: endpoint }
|
23
16
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
24
17
|
end
|
25
18
|
|
@@ -1,37 +1,27 @@
|
|
1
1
|
require_relative '../service'
|
2
2
|
module Adyen
|
3
|
-
|
4
|
-
|
5
3
|
class ReviewingApi < Service
|
6
4
|
attr_accessor :service, :version
|
7
5
|
|
8
6
|
def initialize(client, version = DEFAULT_VERSION)
|
9
|
-
|
10
|
-
@client = client
|
11
|
-
@version = version
|
7
|
+
super(client, version, 'Payout')
|
12
8
|
end
|
13
9
|
|
14
|
-
def confirm_third_party(request, headers: {}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
endpoint = "/confirmThirdParty".gsub(/{.+?}/, '%s')
|
19
|
-
endpoint = endpoint.gsub(/^\//, "")
|
20
|
-
endpoint = endpoint % []
|
10
|
+
def confirm_third_party(request, headers: {})
|
11
|
+
endpoint = '/confirmThirdParty'.gsub(/{.+?}/, '%s')
|
12
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
13
|
+
endpoint = format(endpoint)
|
21
14
|
|
22
|
-
action = { method:
|
15
|
+
action = { method: 'post', url: endpoint }
|
23
16
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
24
17
|
end
|
25
18
|
|
26
|
-
def decline_third_party(request, headers: {}
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
endpoint = "/declineThirdParty".gsub(/{.+?}/, '%s')
|
31
|
-
endpoint = endpoint.gsub(/^\//, "")
|
32
|
-
endpoint = endpoint % []
|
19
|
+
def decline_third_party(request, headers: {})
|
20
|
+
endpoint = '/declineThirdParty'.gsub(/{.+?}/, '%s')
|
21
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
22
|
+
endpoint = format(endpoint)
|
33
23
|
|
34
|
-
action = { method:
|
24
|
+
action = { method: 'post', url: endpoint }
|
35
25
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
36
26
|
end
|
37
27
|
|
@@ -3,29 +3,27 @@ require_relative 'payout/instant_payouts_api'
|
|
3
3
|
require_relative 'payout/reviewing_api'
|
4
4
|
|
5
5
|
module Adyen
|
6
|
-
|
6
|
+
class Payout
|
7
|
+
attr_accessor :service, :version
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@client = client
|
15
|
-
@version = version
|
16
|
-
end
|
17
|
-
|
18
|
-
def initialization_api
|
19
|
-
@initialization_api ||= Adyen::InitializationApi.new(@client, @version)
|
20
|
-
end
|
9
|
+
DEFAULT_VERSION = 68
|
10
|
+
def initialize(client, version = DEFAULT_VERSION)
|
11
|
+
@service = 'Payout'
|
12
|
+
@client = client
|
13
|
+
@version = version
|
14
|
+
end
|
21
15
|
|
22
|
-
|
23
|
-
|
24
|
-
|
16
|
+
def initialization_api
|
17
|
+
@initialization_api ||= Adyen::InitializationApi.new(@client, @version)
|
18
|
+
end
|
25
19
|
|
26
|
-
|
27
|
-
|
28
|
-
|
20
|
+
def instant_payouts_api
|
21
|
+
@instant_payouts_api ||= Adyen::InstantPayoutsApi.new(@client, @version)
|
22
|
+
end
|
29
23
|
|
24
|
+
def reviewing_api
|
25
|
+
@reviewing_api ||= Adyen::ReviewingApi.new(@client, @version)
|
30
26
|
end
|
31
|
-
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -1,74 +1,55 @@
|
|
1
1
|
require_relative './service'
|
2
2
|
module Adyen
|
3
|
-
|
4
|
-
|
5
3
|
class PosTerminalManagement < Service
|
6
4
|
attr_accessor :service, :version
|
7
|
-
DEFAULT_VERSION = 1
|
8
5
|
|
6
|
+
DEFAULT_VERSION = 1
|
9
7
|
def initialize(client, version = DEFAULT_VERSION)
|
10
|
-
|
11
|
-
@client = client
|
12
|
-
@version = version
|
8
|
+
super(client, version, 'PosTerminalManagement')
|
13
9
|
end
|
14
10
|
|
15
|
-
def assign_terminals(request, headers: {}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
endpoint = "/assignTerminals".gsub(/{.+?}/, '%s')
|
20
|
-
endpoint = endpoint.gsub(/^\//, "")
|
21
|
-
endpoint = endpoint % []
|
11
|
+
def assign_terminals(request, headers: {})
|
12
|
+
endpoint = '/assignTerminals'.gsub(/{.+?}/, '%s')
|
13
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
14
|
+
endpoint = format(endpoint)
|
22
15
|
|
23
|
-
action = { method:
|
16
|
+
action = { method: 'post', url: endpoint }
|
24
17
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
25
18
|
end
|
26
19
|
|
27
|
-
def find_terminal(request, headers: {}
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
endpoint = "/findTerminal".gsub(/{.+?}/, '%s')
|
32
|
-
endpoint = endpoint.gsub(/^\//, "")
|
33
|
-
endpoint = endpoint % []
|
20
|
+
def find_terminal(request, headers: {})
|
21
|
+
endpoint = '/findTerminal'.gsub(/{.+?}/, '%s')
|
22
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
23
|
+
endpoint = format(endpoint)
|
34
24
|
|
35
|
-
action = { method:
|
25
|
+
action = { method: 'post', url: endpoint }
|
36
26
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
37
27
|
end
|
38
28
|
|
39
|
-
def get_stores_under_account(request, headers: {}
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
endpoint = "/getStoresUnderAccount".gsub(/{.+?}/, '%s')
|
44
|
-
endpoint = endpoint.gsub(/^\//, "")
|
45
|
-
endpoint = endpoint % []
|
29
|
+
def get_stores_under_account(request, headers: {})
|
30
|
+
endpoint = '/getStoresUnderAccount'.gsub(/{.+?}/, '%s')
|
31
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
32
|
+
endpoint = format(endpoint)
|
46
33
|
|
47
|
-
action = { method:
|
34
|
+
action = { method: 'post', url: endpoint }
|
48
35
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
49
36
|
end
|
50
37
|
|
51
|
-
def get_terminal_details(request, headers: {}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
endpoint = "/getTerminalDetails".gsub(/{.+?}/, '%s')
|
56
|
-
endpoint = endpoint.gsub(/^\//, "")
|
57
|
-
endpoint = endpoint % []
|
38
|
+
def get_terminal_details(request, headers: {})
|
39
|
+
endpoint = '/getTerminalDetails'.gsub(/{.+?}/, '%s')
|
40
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
41
|
+
endpoint = format(endpoint)
|
58
42
|
|
59
|
-
action = { method:
|
43
|
+
action = { method: 'post', url: endpoint }
|
60
44
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
61
45
|
end
|
62
46
|
|
63
|
-
def get_terminals_under_account(request, headers: {}
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
endpoint = "/getTerminalsUnderAccount".gsub(/{.+?}/, '%s')
|
68
|
-
endpoint = endpoint.gsub(/^\//, "")
|
69
|
-
endpoint = endpoint % []
|
47
|
+
def get_terminals_under_account(request, headers: {})
|
48
|
+
endpoint = '/getTerminalsUnderAccount'.gsub(/{.+?}/, '%s')
|
49
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
50
|
+
endpoint = format(endpoint)
|
70
51
|
|
71
|
-
action = { method:
|
52
|
+
action = { method: 'post', url: endpoint }
|
72
53
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
73
54
|
end
|
74
55
|
|
@@ -1,86 +1,64 @@
|
|
1
1
|
require_relative './service'
|
2
2
|
module Adyen
|
3
|
-
|
4
|
-
|
5
3
|
class Recurring < Service
|
6
4
|
attr_accessor :service, :version
|
7
|
-
DEFAULT_VERSION = 68
|
8
5
|
|
6
|
+
DEFAULT_VERSION = 68
|
9
7
|
def initialize(client, version = DEFAULT_VERSION)
|
10
|
-
|
11
|
-
@client = client
|
12
|
-
@version = version
|
8
|
+
super(client, version, 'Recurring')
|
13
9
|
end
|
14
10
|
|
15
|
-
def create_permit(request, headers: {}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
endpoint = "/createPermit".gsub(/{.+?}/, '%s')
|
20
|
-
endpoint = endpoint.gsub(/^\//, "")
|
21
|
-
endpoint = endpoint % []
|
11
|
+
def create_permit(request, headers: {})
|
12
|
+
endpoint = '/createPermit'.gsub(/{.+?}/, '%s')
|
13
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
14
|
+
endpoint = format(endpoint)
|
22
15
|
|
23
|
-
action = { method:
|
16
|
+
action = { method: 'post', url: endpoint }
|
24
17
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
25
18
|
end
|
26
19
|
|
27
|
-
def disable(request, headers: {}
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
endpoint = "/disable".gsub(/{.+?}/, '%s')
|
32
|
-
endpoint = endpoint.gsub(/^\//, "")
|
33
|
-
endpoint = endpoint % []
|
20
|
+
def disable(request, headers: {})
|
21
|
+
endpoint = '/disable'.gsub(/{.+?}/, '%s')
|
22
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
23
|
+
endpoint = format(endpoint)
|
34
24
|
|
35
|
-
action = { method:
|
25
|
+
action = { method: 'post', url: endpoint }
|
36
26
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
37
27
|
end
|
38
28
|
|
39
|
-
def disable_permit(request, headers: {}
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
endpoint = "/disablePermit".gsub(/{.+?}/, '%s')
|
44
|
-
endpoint = endpoint.gsub(/^\//, "")
|
45
|
-
endpoint = endpoint % []
|
29
|
+
def disable_permit(request, headers: {})
|
30
|
+
endpoint = '/disablePermit'.gsub(/{.+?}/, '%s')
|
31
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
32
|
+
endpoint = format(endpoint)
|
46
33
|
|
47
|
-
action = { method:
|
34
|
+
action = { method: 'post', url: endpoint }
|
48
35
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
49
36
|
end
|
50
37
|
|
51
|
-
def list_recurring_details(request, headers: {}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
endpoint = "/listRecurringDetails".gsub(/{.+?}/, '%s')
|
56
|
-
endpoint = endpoint.gsub(/^\//, "")
|
57
|
-
endpoint = endpoint % []
|
38
|
+
def list_recurring_details(request, headers: {})
|
39
|
+
endpoint = '/listRecurringDetails'.gsub(/{.+?}/, '%s')
|
40
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
41
|
+
endpoint = format(endpoint)
|
58
42
|
|
59
|
-
action = { method:
|
43
|
+
action = { method: 'post', url: endpoint }
|
60
44
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
61
45
|
end
|
62
46
|
|
63
|
-
def notify_shopper(request, headers: {}
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
endpoint = "/notifyShopper".gsub(/{.+?}/, '%s')
|
68
|
-
endpoint = endpoint.gsub(/^\//, "")
|
69
|
-
endpoint = endpoint % []
|
47
|
+
def notify_shopper(request, headers: {})
|
48
|
+
endpoint = '/notifyShopper'.gsub(/{.+?}/, '%s')
|
49
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
50
|
+
endpoint = format(endpoint)
|
70
51
|
|
71
|
-
action = { method:
|
52
|
+
action = { method: 'post', url: endpoint }
|
72
53
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
73
54
|
end
|
74
55
|
|
75
|
-
def schedule_account_updater(request, headers: {}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
endpoint = "/scheduleAccountUpdater".gsub(/{.+?}/, '%s')
|
80
|
-
endpoint = endpoint.gsub(/^\//, "")
|
81
|
-
endpoint = endpoint % []
|
56
|
+
def schedule_account_updater(request, headers: {})
|
57
|
+
endpoint = '/scheduleAccountUpdater'.gsub(/{.+?}/, '%s')
|
58
|
+
endpoint = endpoint.gsub(%r{^/}, '')
|
59
|
+
endpoint = format(endpoint)
|
82
60
|
|
83
|
-
action = { method:
|
61
|
+
action = { method: 'post', url: endpoint }
|
84
62
|
@client.call_adyen_api(@service, action, request, headers, @version)
|
85
63
|
end
|
86
64
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Adyen
|
2
2
|
class Service
|
3
|
-
attr_accessor :service, :version
|
3
|
+
attr_accessor :service, :version
|
4
4
|
|
5
5
|
# add snake case to camel case converter to String
|
6
6
|
# to convert rubinic method names to Adyen API methods
|
@@ -11,7 +11,7 @@ module Adyen
|
|
11
11
|
method_name.to_s.gsub(/_./) { |x| x[1].upcase }
|
12
12
|
end
|
13
13
|
|
14
|
-
def initialize(client, version, service, method_names, with_application_info = [])
|
14
|
+
def initialize(client, version, service, method_names = [], with_application_info = [])
|
15
15
|
@client = client
|
16
16
|
@version = version
|
17
17
|
@service = service
|
@@ -20,14 +20,15 @@ module Adyen
|
|
20
20
|
method_names.each do |method_name|
|
21
21
|
define_singleton_method method_name do |request, headers = {}|
|
22
22
|
action = self.class.action_for_method_name(method_name)
|
23
|
-
@client.call_adyen_api(@service, action, request, headers, @version,
|
23
|
+
@client.call_adyen_api(@service, action, request, headers, @version,
|
24
|
+
_with_application_info: with_application_info.include?(method_name))
|
24
25
|
end
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
29
|
# create query parameter from a hash
|
29
30
|
def create_query_string(arr)
|
30
|
-
"
|
31
|
+
"?#{URI.encode_www_form(arr)}"
|
31
32
|
end
|
32
33
|
end
|
33
34
|
end
|