adyen-ruby-api-library 10.4.0 → 11.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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -1
  3. data/.github/workflows/codeql.yml +1 -1
  4. data/.github/workflows/release.yml +3 -2
  5. data/.github/workflows/ruby.yml +1 -1
  6. data/.github/workflows/rubygems_release.yml +1 -1
  7. data/README.md +4 -10
  8. data/VERSION +1 -1
  9. data/lib/adyen/client.rb +49 -14
  10. data/lib/adyen/errors.rb +8 -6
  11. data/lib/adyen/services/{balanceControlService.rb → balanceControl/balance_control_api.rb} +5 -4
  12. data/lib/adyen/services/balanceControl.rb +24 -0
  13. data/lib/adyen/services/balancePlatform/authorized_card_users_api.rb +2 -2
  14. data/lib/adyen/services/balancePlatform/balances_api.rb +2 -2
  15. data/lib/adyen/services/balancePlatform/transfer_limits_balance_account_level_api.rb +76 -0
  16. data/lib/adyen/services/balancePlatform/transfer_limits_balance_platform_level_api.rb +56 -0
  17. data/lib/adyen/services/balancePlatform.rb +10 -0
  18. data/lib/adyen/services/binLookup/bin_lookup_api.rb +36 -0
  19. data/lib/adyen/services/binLookup.rb +8 -21
  20. data/lib/adyen/services/checkout/donations_api.rb +1 -1
  21. data/lib/adyen/services/checkout/utility_api.rb +10 -0
  22. data/lib/adyen/services/dataProtection/data_protection_api.rb +26 -0
  23. data/lib/adyen/services/dataProtection.rb +8 -11
  24. data/lib/adyen/services/disputes/disputes_api.rb +66 -0
  25. data/lib/adyen/services/disputes.rb +8 -51
  26. data/lib/adyen/services/legalEntityManagement.rb +1 -1
  27. data/lib/adyen/services/management/split_configuration_merchant_level_api.rb +7 -7
  28. data/lib/adyen/services/openBanking/account_verification_api.rb +36 -0
  29. data/lib/adyen/services/openBanking.rb +24 -0
  30. data/lib/adyen/services/payment/modifications_api.rb +98 -0
  31. data/lib/adyen/services/payment/payments_api.rb +66 -0
  32. data/lib/adyen/services/payment.rb +11 -131
  33. data/lib/adyen/services/paymentsApp/payments_app_api.rb +66 -0
  34. data/lib/adyen/services/paymentsApp.rb +8 -51
  35. data/lib/adyen/services/posMobile/pos_mobile_api.rb +26 -0
  36. data/lib/adyen/services/posMobile.rb +8 -11
  37. data/lib/adyen/services/recurring/recurring_api.rb +80 -0
  38. data/lib/adyen/services/recurring.rb +8 -61
  39. data/lib/adyen/services/sessionAuthentication/session_authentication_api.rb +1 -1
  40. data/lib/adyen/services/storedValue/stored_value_api.rb +76 -0
  41. data/lib/adyen/services/storedValue.rb +8 -61
  42. data/lib/adyen/version.rb +1 -1
  43. data/lib/adyen-ruby-api-library.rb +4 -1
  44. data/spec/balance_control_spec.rb +7 -5
  45. data/spec/balance_platform_spec.rb +344 -63
  46. data/spec/bin_lookup_spec.rb +4 -3
  47. data/spec/client_spec.rb +101 -2
  48. data/spec/data_protection_spec.rb +1 -1
  49. data/spec/disputes_spec.rb +2 -1
  50. data/spec/mocks/requests/BalancePlatform/create_transfer_limit.json +14 -0
  51. data/spec/mocks/requests/BalancePlatform/create_webhook_setting.json +16 -0
  52. data/spec/mocks/requests/OpenBanking/create_account_verification_routes.json +6 -0
  53. data/spec/mocks/requests/SessionAuthentication/create_authentication_session.json +16 -0
  54. data/spec/mocks/responses/BalancePlatform/create_transfer_limit.json +16 -0
  55. data/spec/mocks/responses/BalancePlatform/create_webhook_setting.json +17 -0
  56. data/spec/mocks/responses/BalancePlatform/get_all_authorised_card_users.json +6 -0
  57. data/spec/mocks/responses/BalancePlatform/get_all_webhook_settings.json +38 -0
  58. data/spec/mocks/responses/BalancePlatform/get_specific_transfer_limit.json +17 -0
  59. data/spec/mocks/responses/BalancePlatform/get_transfer_limits.json +38 -0
  60. data/spec/mocks/responses/OpenBanking/create_account_verification_routes.json +11 -0
  61. data/spec/mocks/responses/OpenBanking/get_account_verification_report.json +30 -0
  62. data/spec/mocks/responses/SessionAuthentication/create_authentication_session.json +4 -0
  63. data/spec/open_banking_spec.rb +68 -0
  64. data/spec/payments_spec.rb +1 -1
  65. data/spec/recurring_spec.rb +1 -1
  66. data/spec/session_authentication_spec.rb +40 -0
  67. data/spec/stored_value_spec.rb +1 -1
  68. data/templates/api.mustache +1 -1
  69. metadata +31 -2
@@ -1,26 +1,23 @@
1
- require_relative './service'
1
+ require_relative 'dataProtection/data_protection_api'
2
+
2
3
  module Adyen
3
4
 
4
5
  # NOTE: This class is auto generated by OpenAPI Generator
5
6
  # Ref: https://openapi-generator.tech
6
7
  #
7
8
  # Do not edit the class manually.
8
- class DataProtection < Service
9
+ class DataProtection
9
10
  attr_accessor :service, :version
10
11
 
11
12
  DEFAULT_VERSION = 1
12
13
  def initialize(client, version = DEFAULT_VERSION)
13
- super(client, version, 'DataProtectionService')
14
+ @service = 'DataProtection'
15
+ @client = client
16
+ @version = version
14
17
  end
15
18
 
16
- # Submit a Subject Erasure Request.
17
- def request_subject_erasure(request, headers: {})
18
- endpoint = '/requestSubjectErasure'.gsub(/{.+?}/, '%s')
19
- endpoint = endpoint.gsub(%r{^/}, '')
20
- endpoint = format(endpoint)
21
-
22
- action = { method: 'post', url: endpoint }
23
- @client.call_adyen_api(@service, action, request, headers, @version)
19
+ def data_protection_api
20
+ @data_protection_api ||= Adyen::DataProtectionApi.new(@client, @version)
24
21
  end
25
22
 
26
23
  end
@@ -0,0 +1,66 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+ # NOTE: This class is auto generated by OpenAPI Generator
5
+ # Ref: https://openapi-generator.tech
6
+ #
7
+ # Do not edit the class manually.
8
+ class DisputesApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'Disputes')
13
+ end
14
+
15
+ # Accept a dispute
16
+ def accept_dispute(request, headers: {})
17
+ endpoint = '/acceptDispute'.gsub(/{.+?}/, '%s')
18
+ endpoint = endpoint.gsub(%r{^/}, '')
19
+ endpoint = format(endpoint)
20
+
21
+ action = { method: 'post', url: endpoint }
22
+ @client.call_adyen_api(@service, action, request, headers, @version)
23
+ end
24
+
25
+ # Defend a dispute
26
+ def defend_dispute(request, headers: {})
27
+ endpoint = '/defendDispute'.gsub(/{.+?}/, '%s')
28
+ endpoint = endpoint.gsub(%r{^/}, '')
29
+ endpoint = format(endpoint)
30
+
31
+ action = { method: 'post', url: endpoint }
32
+ @client.call_adyen_api(@service, action, request, headers, @version)
33
+ end
34
+
35
+ # Delete a defense document
36
+ def delete_dispute_defense_document(request, headers: {})
37
+ endpoint = '/deleteDisputeDefenseDocument'.gsub(/{.+?}/, '%s')
38
+ endpoint = endpoint.gsub(%r{^/}, '')
39
+ endpoint = format(endpoint)
40
+
41
+ action = { method: 'post', url: endpoint }
42
+ @client.call_adyen_api(@service, action, request, headers, @version)
43
+ end
44
+
45
+ # Get applicable defense reasons
46
+ def retrieve_applicable_defense_reasons(request, headers: {})
47
+ endpoint = '/retrieveApplicableDefenseReasons'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint)
50
+
51
+ action = { method: 'post', url: endpoint }
52
+ @client.call_adyen_api(@service, action, request, headers, @version)
53
+ end
54
+
55
+ # Supply a defense document
56
+ def supply_defense_document(request, headers: {})
57
+ endpoint = '/supplyDefenseDocument'.gsub(/{.+?}/, '%s')
58
+ endpoint = endpoint.gsub(%r{^/}, '')
59
+ endpoint = format(endpoint)
60
+
61
+ action = { method: 'post', url: endpoint }
62
+ @client.call_adyen_api(@service, action, request, headers, @version)
63
+ end
64
+
65
+ end
66
+ end
@@ -1,66 +1,23 @@
1
- require_relative './service'
1
+ require_relative 'disputes/disputes_api'
2
+
2
3
  module Adyen
3
4
 
4
5
  # NOTE: This class is auto generated by OpenAPI Generator
5
6
  # Ref: https://openapi-generator.tech
6
7
  #
7
8
  # Do not edit the class manually.
8
- class Disputes < Service
9
+ class Disputes
9
10
  attr_accessor :service, :version
10
11
 
11
12
  DEFAULT_VERSION = 30
12
13
  def initialize(client, version = DEFAULT_VERSION)
13
- super(client, version, 'Disputes')
14
- end
15
-
16
- # Accept a dispute
17
- def accept_dispute(request, headers: {})
18
- endpoint = '/acceptDispute'.gsub(/{.+?}/, '%s')
19
- endpoint = endpoint.gsub(%r{^/}, '')
20
- endpoint = format(endpoint)
21
-
22
- action = { method: 'post', url: endpoint }
23
- @client.call_adyen_api(@service, action, request, headers, @version)
24
- end
25
-
26
- # Defend a dispute
27
- def defend_dispute(request, headers: {})
28
- endpoint = '/defendDispute'.gsub(/{.+?}/, '%s')
29
- endpoint = endpoint.gsub(%r{^/}, '')
30
- endpoint = format(endpoint)
31
-
32
- action = { method: 'post', url: endpoint }
33
- @client.call_adyen_api(@service, action, request, headers, @version)
34
- end
35
-
36
- # Delete a defense document
37
- def delete_dispute_defense_document(request, headers: {})
38
- endpoint = '/deleteDisputeDefenseDocument'.gsub(/{.+?}/, '%s')
39
- endpoint = endpoint.gsub(%r{^/}, '')
40
- endpoint = format(endpoint)
41
-
42
- action = { method: 'post', url: endpoint }
43
- @client.call_adyen_api(@service, action, request, headers, @version)
44
- end
45
-
46
- # Get applicable defense reasons
47
- def retrieve_applicable_defense_reasons(request, headers: {})
48
- endpoint = '/retrieveApplicableDefenseReasons'.gsub(/{.+?}/, '%s')
49
- endpoint = endpoint.gsub(%r{^/}, '')
50
- endpoint = format(endpoint)
51
-
52
- action = { method: 'post', url: endpoint }
53
- @client.call_adyen_api(@service, action, request, headers, @version)
14
+ @service = 'Disputes'
15
+ @client = client
16
+ @version = version
54
17
  end
55
18
 
56
- # Supply a defense document
57
- def supply_defense_document(request, headers: {})
58
- endpoint = '/supplyDefenseDocument'.gsub(/{.+?}/, '%s')
59
- endpoint = endpoint.gsub(%r{^/}, '')
60
- endpoint = format(endpoint)
61
-
62
- action = { method: 'post', url: endpoint }
63
- @client.call_adyen_api(@service, action, request, headers, @version)
19
+ def disputes_api
20
+ @disputes_api ||= Adyen::DisputesApi.new(@client, @version)
64
21
  end
65
22
 
66
23
  end
@@ -16,7 +16,7 @@ module Adyen
16
16
  class LegalEntityManagement
17
17
  attr_accessor :service, :version
18
18
 
19
- DEFAULT_VERSION = 3
19
+ DEFAULT_VERSION = 4
20
20
  def initialize(client, version = DEFAULT_VERSION)
21
21
  @service = 'LegalEntityManagement'
22
22
  @client = client
@@ -22,7 +22,7 @@ module Adyen
22
22
  @client.call_adyen_api(@service, action, request, headers, @version)
23
23
  end
24
24
 
25
- # Create a split configuration
25
+ # Create a split configuration profile
26
26
  def create_split_configuration(request, merchant_id, headers: {})
27
27
  endpoint = '/merchants/{merchantId}/splitConfigurations'.gsub(/{.+?}/, '%s')
28
28
  endpoint = endpoint.gsub(%r{^/}, '')
@@ -32,7 +32,7 @@ module Adyen
32
32
  @client.call_adyen_api(@service, action, request, headers, @version)
33
33
  end
34
34
 
35
- # Delete a split configuration
35
+ # Delete a split configuration profile
36
36
  def delete_split_configuration(merchant_id, split_configuration_id, headers: {})
37
37
  endpoint = '/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}'.gsub(/{.+?}/, '%s')
38
38
  endpoint = endpoint.gsub(%r{^/}, '')
@@ -42,7 +42,7 @@ module Adyen
42
42
  @client.call_adyen_api(@service, action, {}, headers, @version)
43
43
  end
44
44
 
45
- # Delete a split configuration rule
45
+ # Delete a rule
46
46
  def delete_split_configuration_rule(merchant_id, split_configuration_id, rule_id, headers: {})
47
47
  endpoint = '/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}'.gsub(/{.+?}/, '%s')
48
48
  endpoint = endpoint.gsub(%r{^/}, '')
@@ -52,7 +52,7 @@ module Adyen
52
52
  @client.call_adyen_api(@service, action, {}, headers, @version)
53
53
  end
54
54
 
55
- # Get a split configuration
55
+ # Get a split configuration profile
56
56
  def get_split_configuration(merchant_id, split_configuration_id, headers: {})
57
57
  endpoint = '/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}'.gsub(/{.+?}/, '%s')
58
58
  endpoint = endpoint.gsub(%r{^/}, '')
@@ -62,7 +62,7 @@ module Adyen
62
62
  @client.call_adyen_api(@service, action, {}, headers, @version)
63
63
  end
64
64
 
65
- # Get a list of split configurations
65
+ # Get a list of split configuration profiles
66
66
  def list_split_configurations(merchant_id, headers: {})
67
67
  endpoint = '/merchants/{merchantId}/splitConfigurations'.gsub(/{.+?}/, '%s')
68
68
  endpoint = endpoint.gsub(%r{^/}, '')
@@ -72,7 +72,7 @@ module Adyen
72
72
  @client.call_adyen_api(@service, action, {}, headers, @version)
73
73
  end
74
74
 
75
- # Update split conditions
75
+ # Update the split conditions
76
76
  def update_split_conditions(request, merchant_id, split_configuration_id, rule_id, headers: {})
77
77
  endpoint = '/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}'.gsub(/{.+?}/, '%s')
78
78
  endpoint = endpoint.gsub(%r{^/}, '')
@@ -82,7 +82,7 @@ module Adyen
82
82
  @client.call_adyen_api(@service, action, request, headers, @version)
83
83
  end
84
84
 
85
- # Update split configuration description
85
+ # Update the description of the split configuration profile
86
86
  def update_split_configuration_description(request, merchant_id, split_configuration_id, headers: {})
87
87
  endpoint = '/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}'.gsub(/{.+?}/, '%s')
88
88
  endpoint = endpoint.gsub(%r{^/}, '')
@@ -0,0 +1,36 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+ # NOTE: This class is auto generated by OpenAPI Generator
5
+ # Ref: https://openapi-generator.tech
6
+ #
7
+ # Do not edit the class manually.
8
+ class AccountVerificationApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'OpenBanking')
13
+ end
14
+
15
+ # Create routes for account verification
16
+ def create_account_verification_routes(request, headers: {})
17
+ endpoint = '/accountVerification/routes'.gsub(/{.+?}/, '%s')
18
+ endpoint = endpoint.gsub(%r{^/}, '')
19
+ endpoint = format(endpoint)
20
+
21
+ action = { method: 'post', url: endpoint }
22
+ @client.call_adyen_api(@service, action, request, headers, @version)
23
+ end
24
+
25
+ # Get account verification report
26
+ def get_account_verification_report(code, headers: {})
27
+ endpoint = '/accountVerification/reports/{code}'.gsub(/{.+?}/, '%s')
28
+ endpoint = endpoint.gsub(%r{^/}, '')
29
+ endpoint = format(endpoint, code)
30
+
31
+ action = { method: 'get', url: endpoint }
32
+ @client.call_adyen_api(@service, action, {}, headers, @version)
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,24 @@
1
+ require_relative 'openBanking/account_verification_api'
2
+
3
+ module Adyen
4
+
5
+ # NOTE: This class is auto generated by OpenAPI Generator
6
+ # Ref: https://openapi-generator.tech
7
+ #
8
+ # Do not edit the class manually.
9
+ class OpenBanking
10
+ attr_accessor :service, :version
11
+
12
+ DEFAULT_VERSION = 1
13
+ def initialize(client, version = DEFAULT_VERSION)
14
+ @service = 'OpenBanking'
15
+ @client = client
16
+ @version = version
17
+ end
18
+
19
+ def account_verification_api
20
+ @account_verification_api ||= Adyen::AccountVerificationApi.new(@client, @version)
21
+ end
22
+
23
+ end
24
+ end
@@ -0,0 +1,98 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+ # NOTE: This class is auto generated by OpenAPI Generator
5
+ # Ref: https://openapi-generator.tech
6
+ #
7
+ # Do not edit the class manually.
8
+ class ModificationsApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'Payment')
13
+ end
14
+
15
+ # Change the authorised amount
16
+ def adjust_authorisation(request, headers: {})
17
+ endpoint = '/adjustAuthorisation'.gsub(/{.+?}/, '%s')
18
+ endpoint = endpoint.gsub(%r{^/}, '')
19
+ endpoint = format(endpoint)
20
+
21
+ action = { method: 'post', url: endpoint }
22
+ @client.call_adyen_api(@service, action, request, headers, @version)
23
+ end
24
+
25
+ # Cancel an authorisation
26
+ def cancel(request, headers: {})
27
+ endpoint = '/cancel'.gsub(/{.+?}/, '%s')
28
+ endpoint = endpoint.gsub(%r{^/}, '')
29
+ endpoint = format(endpoint)
30
+
31
+ action = { method: 'post', url: endpoint }
32
+ @client.call_adyen_api(@service, action, request, headers, @version)
33
+ end
34
+
35
+ # Cancel or refund a payment
36
+ def cancel_or_refund(request, headers: {})
37
+ endpoint = '/cancelOrRefund'.gsub(/{.+?}/, '%s')
38
+ endpoint = endpoint.gsub(%r{^/}, '')
39
+ endpoint = format(endpoint)
40
+
41
+ action = { method: 'post', url: endpoint }
42
+ @client.call_adyen_api(@service, action, request, headers, @version)
43
+ end
44
+
45
+ # Capture an authorisation
46
+ def capture(request, headers: {})
47
+ endpoint = '/capture'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint)
50
+
51
+ action = { method: 'post', url: endpoint }
52
+ @client.call_adyen_api(@service, action, request, headers, @version)
53
+ end
54
+
55
+ # Create a donation
56
+ #
57
+ # Deprecated
58
+ def donate(request, headers: {})
59
+ endpoint = '/donate'.gsub(/{.+?}/, '%s')
60
+ endpoint = endpoint.gsub(%r{^/}, '')
61
+ endpoint = format(endpoint)
62
+
63
+ action = { method: 'post', url: endpoint }
64
+ @client.call_adyen_api(@service, action, request, headers, @version)
65
+ end
66
+
67
+ # Refund a captured payment
68
+ def refund(request, headers: {})
69
+ endpoint = '/refund'.gsub(/{.+?}/, '%s')
70
+ endpoint = endpoint.gsub(%r{^/}, '')
71
+ endpoint = format(endpoint)
72
+
73
+ action = { method: 'post', url: endpoint }
74
+ @client.call_adyen_api(@service, action, request, headers, @version)
75
+ end
76
+
77
+ # Cancel an authorisation using your reference
78
+ def technical_cancel(request, headers: {})
79
+ endpoint = '/technicalCancel'.gsub(/{.+?}/, '%s')
80
+ endpoint = endpoint.gsub(%r{^/}, '')
81
+ endpoint = format(endpoint)
82
+
83
+ action = { method: 'post', url: endpoint }
84
+ @client.call_adyen_api(@service, action, request, headers, @version)
85
+ end
86
+
87
+ # Cancel an in-person refund
88
+ def void_pending_refund(request, headers: {})
89
+ endpoint = '/voidPendingRefund'.gsub(/{.+?}/, '%s')
90
+ endpoint = endpoint.gsub(%r{^/}, '')
91
+ endpoint = format(endpoint)
92
+
93
+ action = { method: 'post', url: endpoint }
94
+ @client.call_adyen_api(@service, action, request, headers, @version)
95
+ end
96
+
97
+ end
98
+ end
@@ -0,0 +1,66 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+ # NOTE: This class is auto generated by OpenAPI Generator
5
+ # Ref: https://openapi-generator.tech
6
+ #
7
+ # Do not edit the class manually.
8
+ class PaymentsApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'Payment')
13
+ end
14
+
15
+ # Create an authorisation
16
+ def authorise(request, headers: {})
17
+ endpoint = '/authorise'.gsub(/{.+?}/, '%s')
18
+ endpoint = endpoint.gsub(%r{^/}, '')
19
+ endpoint = format(endpoint)
20
+
21
+ action = { method: 'post', url: endpoint }
22
+ @client.call_adyen_api(@service, action, request, headers, @version)
23
+ end
24
+
25
+ # Complete a 3DS authorisation
26
+ def authorise3d(request, headers: {})
27
+ endpoint = '/authorise3d'.gsub(/{.+?}/, '%s')
28
+ endpoint = endpoint.gsub(%r{^/}, '')
29
+ endpoint = format(endpoint)
30
+
31
+ action = { method: 'post', url: endpoint }
32
+ @client.call_adyen_api(@service, action, request, headers, @version)
33
+ end
34
+
35
+ # Complete a 3DS2 authorisation
36
+ def authorise3ds2(request, headers: {})
37
+ endpoint = '/authorise3ds2'.gsub(/{.+?}/, '%s')
38
+ endpoint = endpoint.gsub(%r{^/}, '')
39
+ endpoint = format(endpoint)
40
+
41
+ action = { method: 'post', url: endpoint }
42
+ @client.call_adyen_api(@service, action, request, headers, @version)
43
+ end
44
+
45
+ # Get the 3DS authentication result
46
+ def get_authentication_result(request, headers: {})
47
+ endpoint = '/getAuthenticationResult'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint)
50
+
51
+ action = { method: 'post', url: endpoint }
52
+ @client.call_adyen_api(@service, action, request, headers, @version)
53
+ end
54
+
55
+ # Get the 3DS2 authentication result
56
+ def retrieve3ds2_result(request, headers: {})
57
+ endpoint = '/retrieve3ds2Result'.gsub(/{.+?}/, '%s')
58
+ endpoint = endpoint.gsub(%r{^/}, '')
59
+ endpoint = format(endpoint)
60
+
61
+ action = { method: 'post', url: endpoint }
62
+ @client.call_adyen_api(@service, action, request, headers, @version)
63
+ end
64
+
65
+ end
66
+ end
@@ -1,148 +1,28 @@
1
- require_relative './service'
1
+ require_relative 'payment/modifications_api'
2
+ require_relative 'payment/payments_api'
3
+
2
4
  module Adyen
3
5
 
4
6
  # NOTE: This class is auto generated by OpenAPI Generator
5
7
  # Ref: https://openapi-generator.tech
6
8
  #
7
9
  # Do not edit the class manually.
8
- class Payment < Service
10
+ class Payment
9
11
  attr_accessor :service, :version
10
12
 
11
13
  DEFAULT_VERSION = 68
12
14
  def initialize(client, version = DEFAULT_VERSION)
13
- super(client, version, 'Payment')
14
- end
15
-
16
- # Change the authorised amount
17
- def adjust_authorisation(request, headers: {})
18
- endpoint = '/adjustAuthorisation'.gsub(/{.+?}/, '%s')
19
- endpoint = endpoint.gsub(%r{^/}, '')
20
- endpoint = format(endpoint)
21
-
22
- action = { method: 'post', url: endpoint }
23
- @client.call_adyen_api(@service, action, request, headers, @version)
24
- end
25
-
26
- # Create an authorisation
27
- def authorise(request, headers: {})
28
- endpoint = '/authorise'.gsub(/{.+?}/, '%s')
29
- endpoint = endpoint.gsub(%r{^/}, '')
30
- endpoint = format(endpoint)
31
-
32
- action = { method: 'post', url: endpoint }
33
- @client.call_adyen_api(@service, action, request, headers, @version)
34
- end
35
-
36
- # Complete a 3DS authorisation
37
- def authorise3d(request, headers: {})
38
- endpoint = '/authorise3d'.gsub(/{.+?}/, '%s')
39
- endpoint = endpoint.gsub(%r{^/}, '')
40
- endpoint = format(endpoint)
41
-
42
- action = { method: 'post', url: endpoint }
43
- @client.call_adyen_api(@service, action, request, headers, @version)
44
- end
45
-
46
- # Complete a 3DS2 authorisation
47
- def authorise3ds2(request, headers: {})
48
- endpoint = '/authorise3ds2'.gsub(/{.+?}/, '%s')
49
- endpoint = endpoint.gsub(%r{^/}, '')
50
- endpoint = format(endpoint)
51
-
52
- action = { method: 'post', url: endpoint }
53
- @client.call_adyen_api(@service, action, request, headers, @version)
54
- end
55
-
56
- # Cancel an authorisation
57
- def cancel(request, headers: {})
58
- endpoint = '/cancel'.gsub(/{.+?}/, '%s')
59
- endpoint = endpoint.gsub(%r{^/}, '')
60
- endpoint = format(endpoint)
61
-
62
- action = { method: 'post', url: endpoint }
63
- @client.call_adyen_api(@service, action, request, headers, @version)
64
- end
65
-
66
- # Cancel or refund a payment
67
- def cancel_or_refund(request, headers: {})
68
- endpoint = '/cancelOrRefund'.gsub(/{.+?}/, '%s')
69
- endpoint = endpoint.gsub(%r{^/}, '')
70
- endpoint = format(endpoint)
71
-
72
- action = { method: 'post', url: endpoint }
73
- @client.call_adyen_api(@service, action, request, headers, @version)
74
- end
75
-
76
- # Capture an authorisation
77
- def capture(request, headers: {})
78
- endpoint = '/capture'.gsub(/{.+?}/, '%s')
79
- endpoint = endpoint.gsub(%r{^/}, '')
80
- endpoint = format(endpoint)
81
-
82
- action = { method: 'post', url: endpoint }
83
- @client.call_adyen_api(@service, action, request, headers, @version)
84
- end
85
-
86
- # Create a donation
87
- #
88
- # Deprecated
89
- def donate(request, headers: {})
90
- endpoint = '/donate'.gsub(/{.+?}/, '%s')
91
- endpoint = endpoint.gsub(%r{^/}, '')
92
- endpoint = format(endpoint)
93
-
94
- action = { method: 'post', url: endpoint }
95
- @client.call_adyen_api(@service, action, request, headers, @version)
96
- end
97
-
98
- # Get the 3DS authentication result
99
- def get_authentication_result(request, headers: {})
100
- endpoint = '/getAuthenticationResult'.gsub(/{.+?}/, '%s')
101
- endpoint = endpoint.gsub(%r{^/}, '')
102
- endpoint = format(endpoint)
103
-
104
- action = { method: 'post', url: endpoint }
105
- @client.call_adyen_api(@service, action, request, headers, @version)
106
- end
107
-
108
- # Refund a captured payment
109
- def refund(request, headers: {})
110
- endpoint = '/refund'.gsub(/{.+?}/, '%s')
111
- endpoint = endpoint.gsub(%r{^/}, '')
112
- endpoint = format(endpoint)
113
-
114
- action = { method: 'post', url: endpoint }
115
- @client.call_adyen_api(@service, action, request, headers, @version)
116
- end
117
-
118
- # Get the 3DS2 authentication result
119
- def retrieve3ds2_result(request, headers: {})
120
- endpoint = '/retrieve3ds2Result'.gsub(/{.+?}/, '%s')
121
- endpoint = endpoint.gsub(%r{^/}, '')
122
- endpoint = format(endpoint)
123
-
124
- action = { method: 'post', url: endpoint }
125
- @client.call_adyen_api(@service, action, request, headers, @version)
15
+ @service = 'Payment'
16
+ @client = client
17
+ @version = version
126
18
  end
127
19
 
128
- # Cancel an authorisation using your reference
129
- def technical_cancel(request, headers: {})
130
- endpoint = '/technicalCancel'.gsub(/{.+?}/, '%s')
131
- endpoint = endpoint.gsub(%r{^/}, '')
132
- endpoint = format(endpoint)
133
-
134
- action = { method: 'post', url: endpoint }
135
- @client.call_adyen_api(@service, action, request, headers, @version)
20
+ def modifications_api
21
+ @modifications_api ||= Adyen::ModificationsApi.new(@client, @version)
136
22
  end
137
23
 
138
- # Cancel an in-person refund
139
- def void_pending_refund(request, headers: {})
140
- endpoint = '/voidPendingRefund'.gsub(/{.+?}/, '%s')
141
- endpoint = endpoint.gsub(%r{^/}, '')
142
- endpoint = format(endpoint)
143
-
144
- action = { method: 'post', url: endpoint }
145
- @client.call_adyen_api(@service, action, request, headers, @version)
24
+ def payments_api
25
+ @payments_api ||= Adyen::PaymentsApi.new(@client, @version)
146
26
  end
147
27
 
148
28
  end