adyen-ruby-api-library 7.0.1 → 7.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -1
  3. data/.github/release.yml +18 -0
  4. data/.github/workflows/gh_release.yml +16 -0
  5. data/.github/workflows/release_request.yml +15 -0
  6. data/.github/workflows/ruby.yml +1 -1
  7. data/.github/workflows/services.yml +28 -0
  8. data/.rubocop.yml +8 -0
  9. data/Gemfile +7 -7
  10. data/Makefile +16 -10
  11. data/README.md +13 -10
  12. data/Rakefile +3 -3
  13. data/adyen-ruby-api-library.gemspec +6 -3
  14. data/bin/console +2 -2
  15. data/lib/adyen/client.rb +91 -75
  16. data/lib/adyen/errors.rb +23 -18
  17. data/lib/adyen/hash_with_accessors.rb +12 -7
  18. data/lib/adyen/services/balanceControlService.rb +7 -14
  19. data/lib/adyen/services/balancePlatform/account_holders_api.rb +22 -38
  20. data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +48 -79
  21. data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +6 -13
  22. data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +6 -13
  23. data/lib/adyen/services/balancePlatform/grant_offers_api.rb +12 -22
  24. data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +16 -29
  25. data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +26 -45
  26. data/lib/adyen/services/balancePlatform/platform_api.rb +12 -22
  27. data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +21 -37
  28. data/lib/adyen/services/balancePlatform.rb +38 -40
  29. data/lib/adyen/services/binLookup.rb +12 -22
  30. data/lib/adyen/services/checkout/classic_checkout_sdk_api.rb +11 -21
  31. data/lib/adyen/services/checkout/modifications_api.rb +31 -53
  32. data/lib/adyen/services/checkout/orders_api.rb +16 -29
  33. data/lib/adyen/services/checkout/payment_links_api.rb +16 -29
  34. data/lib/adyen/services/checkout/payments_api.rb +40 -53
  35. data/lib/adyen/services/checkout/recurring_api.rb +13 -23
  36. data/lib/adyen/services/checkout/utility_api.rb +11 -21
  37. data/lib/adyen/services/checkout.rb +32 -34
  38. data/lib/adyen/services/dataProtection.rb +7 -14
  39. data/lib/adyen/services/dispute.rb +6 -5
  40. data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +21 -37
  41. data/lib/adyen/services/legalEntityManagement/documents_api.rb +21 -37
  42. data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +16 -29
  43. data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +26 -45
  44. data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +21 -37
  45. data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +25 -29
  46. data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +21 -37
  47. data/lib/adyen/services/legalEntityManagement.rb +32 -34
  48. data/lib/adyen/services/management/account_company_level_api.rb +18 -31
  49. data/lib/adyen/services/management/account_merchant_level_api.rb +22 -38
  50. data/lib/adyen/services/management/account_store_level_api.rb +43 -71
  51. data/lib/adyen/services/management/allowed_origins_company_level_api.rb +21 -37
  52. data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +21 -37
  53. data/lib/adyen/services/management/api_credentials_company_level_api.rb +22 -38
  54. data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +22 -38
  55. data/lib/adyen/services/management/api_key_company_level_api.rb +6 -13
  56. data/lib/adyen/services/management/api_key_merchant_level_api.rb +6 -13
  57. data/lib/adyen/services/management/client_key_company_level_api.rb +6 -13
  58. data/lib/adyen/services/management/client_key_merchant_level_api.rb +6 -13
  59. data/lib/adyen/services/management/my_api_credential_api.rb +26 -45
  60. data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +32 -54
  61. data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +26 -45
  62. data/lib/adyen/services/management/split_configuration_merchant_level_api.rb +92 -0
  63. data/lib/adyen/services/management/terminal_actions_company_level_api.rb +24 -40
  64. data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +6 -13
  65. data/lib/adyen/services/management/terminal_orders_company_level_api.rb +55 -89
  66. data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +55 -89
  67. data/lib/adyen/services/management/terminal_settings_company_level_api.rb +23 -39
  68. data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +23 -39
  69. data/lib/adyen/services/management/terminal_settings_store_level_api.rb +45 -73
  70. data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +21 -37
  71. data/lib/adyen/services/management/terminals_terminal_level_api.rb +7 -14
  72. data/lib/adyen/services/management/users_company_level_api.rb +22 -38
  73. data/lib/adyen/services/management/users_merchant_level_api.rb +22 -38
  74. data/lib/adyen/services/management/webhooks_company_level_api.rb +37 -62
  75. data/lib/adyen/services/management/webhooks_merchant_level_api.rb +37 -62
  76. data/lib/adyen/services/management.rb +99 -96
  77. data/lib/adyen/services/marketpay.rb +42 -36
  78. data/lib/adyen/services/payment.rb +67 -110
  79. data/lib/adyen/services/payout/initialization_api.rb +16 -29
  80. data/lib/adyen/services/payout/instant_payouts_api.rb +6 -13
  81. data/lib/adyen/services/payout/reviewing_api.rb +11 -21
  82. data/lib/adyen/services/payout.rb +19 -21
  83. data/lib/adyen/services/posTerminalManagement.rb +27 -46
  84. data/lib/adyen/services/recurring.rb +32 -54
  85. data/lib/adyen/services/service.rb +5 -4
  86. data/lib/adyen/services/storedValue.rb +32 -54
  87. data/lib/adyen/services/transfers/capital_api.rb +38 -0
  88. data/lib/adyen/services/transfers/transactions_api.rb +12 -22
  89. data/lib/adyen/services/transfers/transfers_api.rb +6 -13
  90. data/lib/adyen/services/transfers.rb +20 -17
  91. data/lib/adyen/utils/hmac_validator.rb +18 -7
  92. data/lib/adyen/version.rb +3 -3
  93. data/lib/adyen-ruby-api-library.rb +21 -21
  94. data/spec/account_spec.rb +20 -20
  95. data/spec/balance_control_spec.rb +28 -29
  96. data/spec/balance_platform_spec.rb +108 -102
  97. data/spec/bin_lookup_spec.rb +50 -50
  98. data/spec/checkout_spec.rb +573 -524
  99. data/spec/client_spec.rb +117 -70
  100. data/spec/data_protection_spec.rb +4 -4
  101. data/spec/dispute_spec.rb +7 -7
  102. data/spec/errors_spec.rb +37 -17
  103. data/spec/fund_spec.rb +10 -10
  104. data/spec/hash_with_accessors_spec.rb +18 -8
  105. data/spec/hop_spec.rb +4 -4
  106. data/spec/lem_spec.rb +44 -49
  107. data/spec/management_spec.rb +46 -48
  108. data/spec/notification_spec.rb +9 -9
  109. data/spec/payments_spec.rb +29 -30
  110. data/spec/payouts_spec.rb +29 -32
  111. data/spec/pos_terminal_management_spec.rb +30 -32
  112. data/spec/recurring_spec.rb +8 -8
  113. data/spec/service_spec.rb +4 -0
  114. data/spec/spec_helper.rb +37 -35
  115. data/spec/stored_value_spec.rb +28 -27
  116. data/spec/transfers_spec.rb +48 -47
  117. data/spec/utils/hmac_validator_spec.rb +15 -14
  118. data/templates/api-single.mustache +13 -15
  119. data/templates/api-small.mustache +8 -15
  120. data/templates/api.mustache +7 -14
  121. metadata +25 -18
  122. data/.github/dependabot.yml +0 -8
  123. /data/spec/mocks/responses/Webhooks/{backslash_notification.json → backslash_webhook.json} +0 -0
  124. /data/spec/mocks/responses/Webhooks/{colon_notification.json → colon_webhook.json} +0 -0
  125. /data/spec/mocks/responses/Webhooks/{forwardslash_notification.json → forwardslash_webhook.json} +0 -0
  126. /data/spec/mocks/responses/Webhooks/{mixed_notification.json → mixed_webhook.json} +0 -0
@@ -1,170 +1,127 @@
1
1
  require_relative './service'
2
2
  module Adyen
3
-
4
-
5
3
  class Payment < 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
- @service = "Payment"
11
- @client = client
12
- @version = version
8
+ super(client, version, 'Payment')
13
9
  end
14
10
 
15
- def adjust_authorisation(request, headers: {} )
16
- """
17
- Change the authorised amount
18
- """
19
- endpoint = "/adjustAuthorisation".gsub(/{.+?}/, '%s')
20
- endpoint = endpoint.gsub(/^\//, "")
21
- endpoint = endpoint % []
11
+ def adjust_authorisation(request, headers: {})
12
+ endpoint = '/adjustAuthorisation'.gsub(/{.+?}/, '%s')
13
+ endpoint = endpoint.gsub(%r{^/}, '')
14
+ endpoint = format(endpoint)
22
15
 
23
- action = { method: "post", url: endpoint}
16
+ action = { method: 'post', url: endpoint }
24
17
  @client.call_adyen_api(@service, action, request, headers, @version)
25
18
  end
26
19
 
27
- def authorise(request, headers: {} )
28
- """
29
- Create an authorisation
30
- """
31
- endpoint = "/authorise".gsub(/{.+?}/, '%s')
32
- endpoint = endpoint.gsub(/^\//, "")
33
- endpoint = endpoint % []
20
+ def authorise(request, headers: {})
21
+ endpoint = '/authorise'.gsub(/{.+?}/, '%s')
22
+ endpoint = endpoint.gsub(%r{^/}, '')
23
+ endpoint = format(endpoint)
34
24
 
35
- action = { method: "post", url: endpoint}
25
+ action = { method: 'post', url: endpoint }
36
26
  @client.call_adyen_api(@service, action, request, headers, @version)
37
27
  end
38
28
 
39
- def authorise3d(request, headers: {} )
40
- """
41
- Complete a 3DS authorisation
42
- """
43
- endpoint = "/authorise3d".gsub(/{.+?}/, '%s')
44
- endpoint = endpoint.gsub(/^\//, "")
45
- endpoint = endpoint % []
29
+ def authorise3d(request, headers: {})
30
+ endpoint = '/authorise3d'.gsub(/{.+?}/, '%s')
31
+ endpoint = endpoint.gsub(%r{^/}, '')
32
+ endpoint = format(endpoint)
46
33
 
47
- action = { method: "post", url: endpoint}
34
+ action = { method: 'post', url: endpoint }
48
35
  @client.call_adyen_api(@service, action, request, headers, @version)
49
36
  end
50
37
 
51
- def authorise3ds2(request, headers: {} )
52
- """
53
- Complete a 3DS2 authorisation
54
- """
55
- endpoint = "/authorise3ds2".gsub(/{.+?}/, '%s')
56
- endpoint = endpoint.gsub(/^\//, "")
57
- endpoint = endpoint % []
38
+ def authorise3ds2(request, headers: {})
39
+ endpoint = '/authorise3ds2'.gsub(/{.+?}/, '%s')
40
+ endpoint = endpoint.gsub(%r{^/}, '')
41
+ endpoint = format(endpoint)
58
42
 
59
- action = { method: "post", url: endpoint}
43
+ action = { method: 'post', url: endpoint }
60
44
  @client.call_adyen_api(@service, action, request, headers, @version)
61
45
  end
62
46
 
63
- def cancel(request, headers: {} )
64
- """
65
- Cancel an authorisation
66
- """
67
- endpoint = "/cancel".gsub(/{.+?}/, '%s')
68
- endpoint = endpoint.gsub(/^\//, "")
69
- endpoint = endpoint % []
47
+ def cancel(request, headers: {})
48
+ endpoint = '/cancel'.gsub(/{.+?}/, '%s')
49
+ endpoint = endpoint.gsub(%r{^/}, '')
50
+ endpoint = format(endpoint)
70
51
 
71
- action = { method: "post", url: endpoint}
52
+ action = { method: 'post', url: endpoint }
72
53
  @client.call_adyen_api(@service, action, request, headers, @version)
73
54
  end
74
55
 
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 % []
56
+ def cancel_or_refund(request, headers: {})
57
+ endpoint = '/cancelOrRefund'.gsub(/{.+?}/, '%s')
58
+ endpoint = endpoint.gsub(%r{^/}, '')
59
+ endpoint = format(endpoint)
82
60
 
83
- action = { method: "post", url: endpoint}
61
+ action = { method: 'post', url: endpoint }
84
62
  @client.call_adyen_api(@service, action, request, headers, @version)
85
63
  end
86
64
 
87
- def capture(request, headers: {} )
88
- """
89
- Capture an authorisation
90
- """
91
- endpoint = "/capture".gsub(/{.+?}/, '%s')
92
- endpoint = endpoint.gsub(/^\//, "")
93
- endpoint = endpoint % []
65
+ def capture(request, headers: {})
66
+ endpoint = '/capture'.gsub(/{.+?}/, '%s')
67
+ endpoint = endpoint.gsub(%r{^/}, '')
68
+ endpoint = format(endpoint)
94
69
 
95
- action = { method: "post", url: endpoint}
70
+ action = { method: 'post', url: endpoint }
96
71
  @client.call_adyen_api(@service, action, request, headers, @version)
97
72
  end
98
73
 
99
- def donate(request, headers: {} )
100
- """
101
- Create a donation
102
- """
103
- endpoint = "/donate".gsub(/{.+?}/, '%s')
104
- endpoint = endpoint.gsub(/^\//, "")
105
- endpoint = endpoint % []
74
+ def donate(request, headers: {})
75
+ endpoint = '/donate'.gsub(/{.+?}/, '%s')
76
+ endpoint = endpoint.gsub(%r{^/}, '')
77
+ endpoint = format(endpoint)
106
78
 
107
- action = { method: "post", url: endpoint}
79
+ action = { method: 'post', url: endpoint }
108
80
  @client.call_adyen_api(@service, action, request, headers, @version)
109
81
  end
110
82
 
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 % []
83
+ def get_authentication_result(request, headers: {})
84
+ endpoint = '/getAuthenticationResult'.gsub(/{.+?}/, '%s')
85
+ endpoint = endpoint.gsub(%r{^/}, '')
86
+ endpoint = format(endpoint)
118
87
 
119
- action = { method: "post", url: endpoint}
88
+ action = { method: 'post', url: endpoint }
120
89
  @client.call_adyen_api(@service, action, request, headers, @version)
121
90
  end
122
91
 
123
- def refund(request, headers: {} )
124
- """
125
- Refund a captured payment
126
- """
127
- endpoint = "/refund".gsub(/{.+?}/, '%s')
128
- endpoint = endpoint.gsub(/^\//, "")
129
- endpoint = endpoint % []
92
+ def refund(request, headers: {})
93
+ endpoint = '/refund'.gsub(/{.+?}/, '%s')
94
+ endpoint = endpoint.gsub(%r{^/}, '')
95
+ endpoint = format(endpoint)
130
96
 
131
- action = { method: "post", url: endpoint}
97
+ action = { method: 'post', url: endpoint }
132
98
  @client.call_adyen_api(@service, action, request, headers, @version)
133
99
  end
134
100
 
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 % []
101
+ def retrieve3ds2_result(request, headers: {})
102
+ endpoint = '/retrieve3ds2Result'.gsub(/{.+?}/, '%s')
103
+ endpoint = endpoint.gsub(%r{^/}, '')
104
+ endpoint = format(endpoint)
142
105
 
143
- action = { method: "post", url: endpoint}
106
+ action = { method: 'post', url: endpoint }
144
107
  @client.call_adyen_api(@service, action, request, headers, @version)
145
108
  end
146
109
 
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 % []
110
+ def technical_cancel(request, headers: {})
111
+ endpoint = '/technicalCancel'.gsub(/{.+?}/, '%s')
112
+ endpoint = endpoint.gsub(%r{^/}, '')
113
+ endpoint = format(endpoint)
154
114
 
155
- action = { method: "post", url: endpoint}
115
+ action = { method: 'post', url: endpoint }
156
116
  @client.call_adyen_api(@service, action, request, headers, @version)
157
117
  end
158
118
 
159
- def void_pending_refund(request, headers: {} )
160
- """
161
- Cancel an in-person refund
162
- """
163
- endpoint = "/voidPendingRefund".gsub(/{.+?}/, '%s')
164
- endpoint = endpoint.gsub(/^\//, "")
165
- endpoint = endpoint % []
119
+ def void_pending_refund(request, headers: {})
120
+ endpoint = '/voidPendingRefund'.gsub(/{.+?}/, '%s')
121
+ endpoint = endpoint.gsub(%r{^/}, '')
122
+ endpoint = format(endpoint)
166
123
 
167
- action = { method: "post", url: endpoint}
124
+ action = { method: 'post', url: endpoint }
168
125
  @client.call_adyen_api(@service, action, request, headers, @version)
169
126
  end
170
127
 
@@ -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
- @service = "Payout"
10
- @client = client
11
- @version = version
7
+ super(client, version, 'Payout')
12
8
  end
13
9
 
14
- def store_detail(request, headers: {} )
15
- """
16
- Store payout details
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: "post", url: endpoint}
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
- Store details and submit a payout
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: "post", url: endpoint}
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
- Submit a payout
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: "post", url: endpoint}
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
- @service = "Payout"
10
- @client = client
11
- @version = version
7
+ super(client, version, 'Payout')
12
8
  end
13
9
 
14
- def payout(request, headers: {} )
15
- """
16
- Make an instant card payout
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: "post", url: endpoint}
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
- @service = "Payout"
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
- Confirm a payout
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: "post", url: endpoint}
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
- Cancel a payout
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: "post", url: endpoint}
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
- class Payout
9
- attr_accessor :service, :version
10
-
11
- DEFAULT_VERSION = 68
12
- def initialize(client, version = DEFAULT_VERSION)
13
- @service = "Payout"
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
- def instant_payouts_api
23
- @instant_payouts_api ||= Adyen::InstantPayoutsApi.new(@client, @version)
24
- end
16
+ def initialization_api
17
+ @initialization_api ||= Adyen::InitializationApi.new(@client, @version)
18
+ end
25
19
 
26
- def reviewing_api
27
- @reviewing_api ||= Adyen::ReviewingApi.new(@client, @version)
28
- end
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
- end
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
- @service = "PosTerminalManagement"
11
- @client = client
12
- @version = version
8
+ super(client, version, 'PosTerminalManagement')
13
9
  end
14
10
 
15
- def assign_terminals(request, headers: {} )
16
- """
17
- Assign terminals
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: "post", url: endpoint}
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
- Get the account or store of a terminal
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: "post", url: endpoint}
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
- Get the stores of an account
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: "post", url: endpoint}
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
- Get the details of a terminal
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: "post", url: endpoint}
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
- Get the list of terminals
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: "post", url: endpoint}
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
- @service = "Recurring"
11
- @client = client
12
- @version = version
8
+ super(client, version, 'Recurring')
13
9
  end
14
10
 
15
- def create_permit(request, headers: {} )
16
- """
17
- Create new permits linked to a recurring contract.
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: "post", url: endpoint}
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
- Disable stored payment details
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: "post", url: endpoint}
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
- Disable an existing permit.
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: "post", url: endpoint}
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
- Get stored payment details
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: "post", url: endpoint}
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
- Ask issuer to notify the shopper
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: "post", url: endpoint}
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
- Schedule running the Account Updater
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: "post", url: endpoint}
61
+ action = { method: 'post', url: endpoint }
84
62
  @client.call_adyen_api(@service, action, request, headers, @version)
85
63
  end
86
64