adyen-ruby-api-library 6.3.0 → 7.0.0

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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/Makefile +72 -0
  4. data/README.md +20 -18
  5. data/lib/adyen/client.rb +66 -38
  6. data/lib/adyen/services/balanceControlService.rb +28 -0
  7. data/lib/adyen/services/balancePlatform/account_holders_api.rb +63 -0
  8. data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +123 -0
  9. data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +27 -0
  10. data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +27 -0
  11. data/lib/adyen/services/balancePlatform/grant_offers_api.rb +39 -0
  12. data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +51 -0
  13. data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +75 -0
  14. data/lib/adyen/services/balancePlatform/platform_api.rb +39 -0
  15. data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +63 -0
  16. data/lib/adyen/services/balancePlatform.rb +61 -0
  17. data/lib/adyen/services/binLookup.rb +40 -0
  18. data/lib/adyen/services/checkout/classic_checkout_sdk_api.rb +39 -0
  19. data/lib/adyen/services/checkout/modifications_api.rb +87 -0
  20. data/lib/adyen/services/checkout/orders_api.rb +51 -0
  21. data/lib/adyen/services/checkout/payment_links_api.rb +51 -0
  22. data/lib/adyen/services/checkout/payments_api.rb +87 -0
  23. data/lib/adyen/services/checkout/recurring_api.rb +39 -0
  24. data/lib/adyen/services/checkout/utility_api.rb +39 -0
  25. data/lib/adyen/services/checkout.rb +38 -211
  26. data/lib/adyen/services/dataProtection.rb +28 -0
  27. data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +63 -0
  28. data/lib/adyen/services/legalEntityManagement/documents_api.rb +63 -0
  29. data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +51 -0
  30. data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +75 -0
  31. data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +63 -0
  32. data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +51 -0
  33. data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +63 -0
  34. data/lib/adyen/services/legalEntityManagement.rb +51 -0
  35. data/lib/adyen/services/management/account_company_level_api.rb +51 -0
  36. data/lib/adyen/services/management/account_merchant_level_api.rb +63 -0
  37. data/lib/adyen/services/management/account_store_level_api.rb +111 -0
  38. data/lib/adyen/services/management/allowed_origins_company_level_api.rb +63 -0
  39. data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +63 -0
  40. data/lib/adyen/services/management/api_credentials_company_level_api.rb +63 -0
  41. data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +63 -0
  42. data/lib/adyen/services/management/api_key_company_level_api.rb +27 -0
  43. data/lib/adyen/services/management/api_key_merchant_level_api.rb +27 -0
  44. data/lib/adyen/services/management/client_key_company_level_api.rb +27 -0
  45. data/lib/adyen/services/management/client_key_merchant_level_api.rb +27 -0
  46. data/lib/adyen/services/management/my_api_credential_api.rb +75 -0
  47. data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +87 -0
  48. data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +75 -0
  49. data/lib/adyen/services/management/terminal_actions_company_level_api.rb +63 -0
  50. data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +27 -0
  51. data/lib/adyen/services/management/terminal_orders_company_level_api.rb +135 -0
  52. data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +135 -0
  53. data/lib/adyen/services/management/terminal_settings_company_level_api.rb +63 -0
  54. data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +63 -0
  55. data/lib/adyen/services/management/terminal_settings_store_level_api.rb +111 -0
  56. data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +63 -0
  57. data/lib/adyen/services/management/terminals_terminal_level_api.rb +27 -0
  58. data/lib/adyen/services/management/users_company_level_api.rb +63 -0
  59. data/lib/adyen/services/management/users_merchant_level_api.rb +63 -0
  60. data/lib/adyen/services/management/webhooks_company_level_api.rb +99 -0
  61. data/lib/adyen/services/management/webhooks_merchant_level_api.rb +99 -0
  62. data/lib/adyen/services/management.rb +151 -0
  63. data/lib/adyen/services/payment.rb +172 -0
  64. data/lib/adyen/services/payout/initialization_api.rb +51 -0
  65. data/lib/adyen/services/payout/instant_payouts_api.rb +27 -0
  66. data/lib/adyen/services/payout/reviewing_api.rb +39 -0
  67. data/lib/adyen/services/payout.rb +31 -0
  68. data/lib/adyen/services/posTerminalManagement.rb +76 -0
  69. data/lib/adyen/services/recurring.rb +81 -13
  70. data/lib/adyen/services/service.rb +2 -2
  71. data/lib/adyen/services/storedValue.rb +88 -0
  72. data/lib/adyen/services/transfers/transactions_api.rb +39 -0
  73. data/lib/adyen/services/transfers/transfers_api.rb +27 -0
  74. data/lib/adyen/services/transfers.rb +26 -0
  75. data/lib/adyen/version.rb +1 -1
  76. data/lib/adyen-ruby-api-library.rb +11 -5
  77. data/spec/account_spec.rb +1 -1
  78. data/spec/balance_control_spec.rb +44 -0
  79. data/spec/balance_platform_spec.rb +123 -0
  80. data/spec/bin_lookup_spec.rb +68 -10
  81. data/spec/checkout_spec.rb +39 -66
  82. data/spec/client_spec.rb +88 -9
  83. data/spec/fund_spec.rb +1 -1
  84. data/spec/hop_spec.rb +1 -1
  85. data/spec/lem_spec.rb +68 -0
  86. data/spec/management_spec.rb +68 -0
  87. data/spec/mocks/requests/BalanceControl/balance_transfer.json +10 -0
  88. data/spec/mocks/requests/BalancePlatform/create_account_holder.json +5 -0
  89. data/spec/mocks/requests/BalancePlatform/update_account_holder.json +10 -0
  90. data/spec/mocks/requests/LegalEntityManagement/create_business_line.json +15 -0
  91. data/spec/mocks/requests/Management/create_store.json +15 -0
  92. data/spec/mocks/requests/Recurring/create_permit.json +6 -0
  93. data/spec/mocks/requests/StoredValue/issue_giftcard.json +12 -0
  94. data/spec/mocks/requests/Transfers/get_transactions.json +82 -0
  95. data/spec/mocks/requests/Transfers/make_transfer.json +32 -0
  96. data/spec/mocks/responses/BalanceControl/balance_transfer.json +14 -0
  97. data/spec/mocks/responses/BalancePlatform/create_account_holder.json +41 -0
  98. data/spec/mocks/responses/BalancePlatform/get_balance_account.json +15 -0
  99. data/spec/mocks/responses/BalancePlatform/update_account_holder.json +16 -0
  100. data/spec/mocks/responses/LegalEntityManagement/create_business_line.json +17 -0
  101. data/spec/mocks/responses/Management/create_store.json +23 -0
  102. data/spec/mocks/responses/Management/get_companies.json +42 -0
  103. data/spec/mocks/responses/Recurring/create_permit.json +4 -0
  104. data/spec/mocks/responses/StoredValue/issue_giftcard.json +13 -0
  105. data/spec/mocks/responses/Transfers/get_transactions.json +82 -0
  106. data/spec/mocks/responses/Transfers/make_transfer.json +36 -0
  107. data/spec/notification_spec.rb +1 -1
  108. data/spec/payments_spec.rb +41 -23
  109. data/spec/payouts_spec.rb +43 -16
  110. data/spec/pos_terminal_management_spec.rb +46 -0
  111. data/spec/recurring_spec.rb +2 -2
  112. data/spec/spec_helper.rb +0 -10
  113. data/spec/stored_value_spec.rb +43 -0
  114. data/spec/transfers_spec.rb +63 -0
  115. data/templates/api-single.mustache +29 -0
  116. data/templates/api-small.mustache +37 -0
  117. data/templates/api.mustache +36 -0
  118. data/templates/config.yaml +10 -0
  119. metadata +101 -11
  120. data/lib/adyen/services/bin_lookup.rb +0 -18
  121. data/lib/adyen/services/data_protection.rb +0 -17
  122. data/lib/adyen/services/payments.rb +0 -34
  123. data/lib/adyen/services/payouts.rb +0 -22
  124. data/lib/adyen/services/postfmapi.rb +0 -19
  125. data/spec/mocks/requests/Recurring/store_token.json +0 -15
  126. data/spec/mocks/responses/Recurring/store_token.json +0 -7
  127. data/spec/postfmapi_spec.rb +0 -16
@@ -0,0 +1,151 @@
1
+ require_relative 'management/api_credentials_company_level_api'
2
+ require_relative 'management/api_credentials_merchant_level_api'
3
+ require_relative 'management/api_key_company_level_api'
4
+ require_relative 'management/api_key_merchant_level_api'
5
+ require_relative 'management/account_company_level_api'
6
+ require_relative 'management/account_merchant_level_api'
7
+ require_relative 'management/account_store_level_api'
8
+ require_relative 'management/allowed_origins_company_level_api'
9
+ require_relative 'management/allowed_origins_merchant_level_api'
10
+ require_relative 'management/client_key_company_level_api'
11
+ require_relative 'management/client_key_merchant_level_api'
12
+ require_relative 'management/my_api_credential_api'
13
+ require_relative 'management/payment_methods_merchant_level_api'
14
+ require_relative 'management/payout_settings_merchant_level_api'
15
+ require_relative 'management/terminal_actions_company_level_api'
16
+ require_relative 'management/terminal_actions_terminal_level_api'
17
+ require_relative 'management/terminal_orders_company_level_api'
18
+ require_relative 'management/terminal_orders_merchant_level_api'
19
+ require_relative 'management/terminal_settings_company_level_api'
20
+ require_relative 'management/terminal_settings_merchant_level_api'
21
+ require_relative 'management/terminal_settings_store_level_api'
22
+ require_relative 'management/terminal_settings_terminal_level_api'
23
+ require_relative 'management/terminals_terminal_level_api'
24
+ require_relative 'management/users_company_level_api'
25
+ require_relative 'management/users_merchant_level_api'
26
+ require_relative 'management/webhooks_company_level_api'
27
+ require_relative 'management/webhooks_merchant_level_api'
28
+
29
+ module Adyen
30
+
31
+
32
+ class Management
33
+ attr_accessor :service, :version
34
+
35
+ DEFAULT_VERSION = 1
36
+ def initialize(client, version = DEFAULT_VERSION)
37
+ @service = "Management"
38
+ @client = client
39
+ @version = version
40
+ end
41
+
42
+ def api_credentials_company_level_api
43
+ @api_credentials_company_level_api ||= Adyen::APICredentialsCompanyLevelApi.new(@client, @version)
44
+ end
45
+
46
+ def api_credentials_merchant_level_api
47
+ @api_credentials_merchant_level_api ||= Adyen::APICredentialsMerchantLevelApi.new(@client, @version)
48
+ end
49
+
50
+ def api_key_company_level_api
51
+ @api_key_company_level_api ||= Adyen::APIKeyCompanyLevelApi.new(@client, @version)
52
+ end
53
+
54
+ def api_key_merchant_level_api
55
+ @api_key_merchant_level_api ||= Adyen::APIKeyMerchantLevelApi.new(@client, @version)
56
+ end
57
+
58
+ def account_company_level_api
59
+ @account_company_level_api ||= Adyen::AccountCompanyLevelApi.new(@client, @version)
60
+ end
61
+
62
+ def account_merchant_level_api
63
+ @account_merchant_level_api ||= Adyen::AccountMerchantLevelApi.new(@client, @version)
64
+ end
65
+
66
+ def account_store_level_api
67
+ @account_store_level_api ||= Adyen::AccountStoreLevelApi.new(@client, @version)
68
+ end
69
+
70
+ def allowed_origins_company_level_api
71
+ @allowed_origins_company_level_api ||= Adyen::AllowedOriginsCompanyLevelApi.new(@client, @version)
72
+ end
73
+
74
+ def allowed_origins_merchant_level_api
75
+ @allowed_origins_merchant_level_api ||= Adyen::AllowedOriginsMerchantLevelApi.new(@client, @version)
76
+ end
77
+
78
+ def client_key_company_level_api
79
+ @client_key_company_level_api ||= Adyen::ClientKeyCompanyLevelApi.new(@client, @version)
80
+ end
81
+
82
+ def client_key_merchant_level_api
83
+ @client_key_merchant_level_api ||= Adyen::ClientKeyMerchantLevelApi.new(@client, @version)
84
+ end
85
+
86
+ def my_api_credential_api
87
+ @my_api_credential_api ||= Adyen::MyAPICredentialApi.new(@client, @version)
88
+ end
89
+
90
+ def payment_methods_merchant_level_api
91
+ @payment_methods_merchant_level_api ||= Adyen::PaymentMethodsMerchantLevelApi.new(@client, @version)
92
+ end
93
+
94
+ def payout_settings_merchant_level_api
95
+ @payout_settings_merchant_level_api ||= Adyen::PayoutSettingsMerchantLevelApi.new(@client, @version)
96
+ end
97
+
98
+ def terminal_actions_company_level_api
99
+ @terminal_actions_company_level_api ||= Adyen::TerminalActionsCompanyLevelApi.new(@client, @version)
100
+ end
101
+
102
+ def terminal_actions_terminal_level_api
103
+ @terminal_actions_terminal_level_api ||= Adyen::TerminalActionsTerminalLevelApi.new(@client, @version)
104
+ end
105
+
106
+ def terminal_orders_company_level_api
107
+ @terminal_orders_company_level_api ||= Adyen::TerminalOrdersCompanyLevelApi.new(@client, @version)
108
+ end
109
+
110
+ def terminal_orders_merchant_level_api
111
+ @terminal_orders_merchant_level_api ||= Adyen::TerminalOrdersMerchantLevelApi.new(@client, @version)
112
+ end
113
+
114
+ def terminal_settings_company_level_api
115
+ @terminal_settings_company_level_api ||= Adyen::TerminalSettingsCompanyLevelApi.new(@client, @version)
116
+ end
117
+
118
+ def terminal_settings_merchant_level_api
119
+ @terminal_settings_merchant_level_api ||= Adyen::TerminalSettingsMerchantLevelApi.new(@client, @version)
120
+ end
121
+
122
+ def terminal_settings_store_level_api
123
+ @terminal_settings_store_level_api ||= Adyen::TerminalSettingsStoreLevelApi.new(@client, @version)
124
+ end
125
+
126
+ def terminal_settings_terminal_level_api
127
+ @terminal_settings_terminal_level_api ||= Adyen::TerminalSettingsTerminalLevelApi.new(@client, @version)
128
+ end
129
+
130
+ def terminals_terminal_level_api
131
+ @terminals_terminal_level_api ||= Adyen::TerminalsTerminalLevelApi.new(@client, @version)
132
+ end
133
+
134
+ def users_company_level_api
135
+ @users_company_level_api ||= Adyen::UsersCompanyLevelApi.new(@client, @version)
136
+ end
137
+
138
+ def users_merchant_level_api
139
+ @users_merchant_level_api ||= Adyen::UsersMerchantLevelApi.new(@client, @version)
140
+ end
141
+
142
+ def webhooks_company_level_api
143
+ @webhooks_company_level_api ||= Adyen::WebhooksCompanyLevelApi.new(@client, @version)
144
+ end
145
+
146
+ def webhooks_merchant_level_api
147
+ @webhooks_merchant_level_api ||= Adyen::WebhooksMerchantLevelApi.new(@client, @version)
148
+ end
149
+
150
+ end
151
+ end
@@ -0,0 +1,172 @@
1
+ require_relative './service'
2
+ module Adyen
3
+
4
+
5
+ class Payment < Service
6
+ attr_accessor :service, :version
7
+ DEFAULT_VERSION = 68
8
+
9
+ def initialize(client, version = DEFAULT_VERSION)
10
+ @service = "Payment"
11
+ @client = client
12
+ @version = version
13
+ end
14
+
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 % []
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)
157
+ end
158
+
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 % []
166
+
167
+ action = { method: "post", url: endpoint}
168
+ @client.call_adyen_api(@service, action, request, headers, @version)
169
+ end
170
+
171
+ end
172
+ end
@@ -0,0 +1,51 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class InitializationApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Payout"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
14
+ def store_detail(request, headers: {} )
15
+ """
16
+ Store payout details
17
+ """
18
+ endpoint = "/storeDetail".gsub(/{.+?}/, '%s')
19
+ endpoint = endpoint.gsub(/^\//, "")
20
+ endpoint = endpoint % []
21
+
22
+ action = { method: "post", url: endpoint}
23
+ @client.call_adyen_api(@service, action, request, headers, @version)
24
+ end
25
+
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 % []
33
+
34
+ action = { method: "post", url: endpoint}
35
+ @client.call_adyen_api(@service, action, request, headers, @version)
36
+ end
37
+
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 % []
45
+
46
+ action = { method: "post", url: endpoint}
47
+ @client.call_adyen_api(@service, action, request, headers, @version)
48
+ end
49
+
50
+ end
51
+ end
@@ -0,0 +1,27 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class InstantPayoutsApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Payout"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
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 % []
21
+
22
+ action = { method: "post", url: endpoint}
23
+ @client.call_adyen_api(@service, action, request, headers, @version)
24
+ end
25
+
26
+ end
27
+ end
@@ -0,0 +1,39 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+
5
+ class ReviewingApi < Service
6
+ attr_accessor :service, :version
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ @service = "Payout"
10
+ @client = client
11
+ @version = version
12
+ end
13
+
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 % []
21
+
22
+ action = { method: "post", url: endpoint}
23
+ @client.call_adyen_api(@service, action, request, headers, @version)
24
+ end
25
+
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 % []
33
+
34
+ action = { method: "post", url: endpoint}
35
+ @client.call_adyen_api(@service, action, request, headers, @version)
36
+ end
37
+
38
+ end
39
+ end
@@ -0,0 +1,31 @@
1
+ require_relative 'payout/initialization_api'
2
+ require_relative 'payout/instant_payouts_api'
3
+ require_relative 'payout/reviewing_api'
4
+
5
+ module Adyen
6
+
7
+
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
21
+
22
+ def instant_payouts_api
23
+ @instant_payouts_api ||= Adyen::InstantPayoutsApi.new(@client, @version)
24
+ end
25
+
26
+ def reviewing_api
27
+ @reviewing_api ||= Adyen::ReviewingApi.new(@client, @version)
28
+ end
29
+
30
+ end
31
+ end
@@ -0,0 +1,76 @@
1
+ require_relative './service'
2
+ module Adyen
3
+
4
+
5
+ class PosTerminalManagement < Service
6
+ attr_accessor :service, :version
7
+ DEFAULT_VERSION = 1
8
+
9
+ def initialize(client, version = DEFAULT_VERSION)
10
+ @service = "PosTerminalManagement"
11
+ @client = client
12
+ @version = version
13
+ end
14
+
15
+ def assign_terminals(request, headers: {} )
16
+ """
17
+ Assign terminals
18
+ """
19
+ endpoint = "/assignTerminals".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 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 % []
34
+
35
+ action = { method: "post", url: endpoint}
36
+ @client.call_adyen_api(@service, action, request, headers, @version)
37
+ end
38
+
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 % []
46
+
47
+ action = { method: "post", url: endpoint}
48
+ @client.call_adyen_api(@service, action, request, headers, @version)
49
+ end
50
+
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 % []
58
+
59
+ action = { method: "post", url: endpoint}
60
+ @client.call_adyen_api(@service, action, request, headers, @version)
61
+ end
62
+
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 % []
70
+
71
+ action = { method: "post", url: endpoint}
72
+ @client.call_adyen_api(@service, action, request, headers, @version)
73
+ end
74
+
75
+ end
76
+ end
@@ -1,20 +1,88 @@
1
- require_relative 'service'
2
-
1
+ require_relative './service'
3
2
  module Adyen
3
+
4
+
4
5
  class Recurring < Service
5
- attr_accessor :version
6
- DEFAULT_VERSION = 49
6
+ attr_accessor :service, :version
7
+ DEFAULT_VERSION = 68
7
8
 
8
9
  def initialize(client, version = DEFAULT_VERSION)
9
- service = 'Recurring'
10
- method_names = [
11
- :list_recurring_details,
12
- :disable,
13
- :store_token,
14
- :schedule_account_updater
15
- ]
16
-
17
- super(client, version, service, method_names)
10
+ @service = "Recurring"
11
+ @client = client
12
+ @version = version
13
+ end
14
+
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 % []
22
+
23
+ action = { method: "post", url: endpoint}
24
+ @client.call_adyen_api(@service, action, request, headers, @version)
25
+ end
26
+
27
+ def disable(request, headers: {} )
28
+ """
29
+ Disable stored payment details
30
+ """
31
+ endpoint = "/disable".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 disable_permit(request, headers: {} )
40
+ """
41
+ Disable an existing permit.
42
+ """
43
+ endpoint = "/disablePermit".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 list_recurring_details(request, headers: {} )
52
+ """
53
+ Get stored payment details
54
+ """
55
+ endpoint = "/listRecurringDetails".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 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 % []
70
+
71
+ action = { method: "post", url: endpoint}
72
+ @client.call_adyen_api(@service, action, request, headers, @version)
73
+ end
74
+
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 % []
82
+
83
+ action = { method: "post", url: endpoint}
84
+ @client.call_adyen_api(@service, action, request, headers, @version)
18
85
  end
86
+
19
87
  end
20
88
  end
@@ -1,6 +1,6 @@
1
1
  module Adyen
2
2
  class Service
3
- attr_accessor :service, :version
3
+ attr_accessor :service, :version, :create_query_string
4
4
 
5
5
  # add snake case to camel case converter to String
6
6
  # to convert rubinic method names to Adyen API methods
@@ -25,7 +25,7 @@ module Adyen
25
25
  end
26
26
  end
27
27
 
28
- # create query parameter from an array
28
+ # create query parameter from a hash
29
29
  def create_query_string(arr)
30
30
  "?" + URI.encode_www_form(arr)
31
31
  end