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
@@ -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 PaymentsAppApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'PaymentsApp')
13
+ end
14
+
15
+ # Create a boarding token - merchant level
16
+ def generate_payments_app_boarding_token_for_merchant(request, merchant_id, headers: {})
17
+ endpoint = '/merchants/{merchantId}/generatePaymentsAppBoardingToken'.gsub(/{.+?}/, '%s')
18
+ endpoint = endpoint.gsub(%r{^/}, '')
19
+ endpoint = format(endpoint, merchant_id)
20
+
21
+ action = { method: 'post', url: endpoint }
22
+ @client.call_adyen_api(@service, action, request, headers, @version)
23
+ end
24
+
25
+ # Create a boarding token - store level
26
+ def generate_payments_app_boarding_token_for_store(request, merchant_id, store_id, headers: {})
27
+ endpoint = '/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken'.gsub(/{.+?}/, '%s')
28
+ endpoint = endpoint.gsub(%r{^/}, '')
29
+ endpoint = format(endpoint, merchant_id, store_id)
30
+
31
+ action = { method: 'post', url: endpoint }
32
+ @client.call_adyen_api(@service, action, request, headers, @version)
33
+ end
34
+
35
+ # Get a list of Payments Apps - merchant level
36
+ def list_payments_app_for_merchant(merchant_id, headers: {}, query_params: {})
37
+ endpoint = '/merchants/{merchantId}/paymentsApps'.gsub(/{.+?}/, '%s')
38
+ endpoint = endpoint.gsub(%r{^/}, '')
39
+ endpoint = format(endpoint, merchant_id)
40
+ endpoint += create_query_string(query_params)
41
+ action = { method: 'get', url: endpoint }
42
+ @client.call_adyen_api(@service, action, {}, headers, @version)
43
+ end
44
+
45
+ # Get a list of Payments Apps - store level
46
+ def list_payments_app_for_store(merchant_id, store_id, headers: {}, query_params: {})
47
+ endpoint = '/merchants/{merchantId}/stores/{storeId}/paymentsApps'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint, merchant_id, store_id)
50
+ endpoint += create_query_string(query_params)
51
+ action = { method: 'get', url: endpoint }
52
+ @client.call_adyen_api(@service, action, {}, headers, @version)
53
+ end
54
+
55
+ # Revoke Payments App instance authentication
56
+ def revoke_payments_app(merchant_id, installation_id, headers: {})
57
+ endpoint = '/merchants/{merchantId}/paymentsApps/{installationId}/revoke'.gsub(/{.+?}/, '%s')
58
+ endpoint = endpoint.gsub(%r{^/}, '')
59
+ endpoint = format(endpoint, merchant_id, installation_id)
60
+
61
+ action = { method: 'post', url: endpoint }
62
+ @client.call_adyen_api(@service, action, {}, headers, @version)
63
+ end
64
+
65
+ end
66
+ end
@@ -1,66 +1,23 @@
1
- require_relative './service'
1
+ require_relative 'paymentsApp/payments_app_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 PaymentsApp < Service
9
+ class PaymentsApp
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, 'PaymentsApp')
14
- end
15
-
16
- # Create a boarding token - merchant level
17
- def generate_payments_app_boarding_token_for_merchant(request, merchant_id, boarding_token_request, headers: {})
18
- endpoint = '/merchants/{merchantId}/generatePaymentsAppBoardingToken'.gsub(/{.+?}/, '%s')
19
- endpoint = endpoint.gsub(%r{^/}, '')
20
- endpoint = format(endpoint,_merchant_id)
21
-
22
- action = { method: 'post', url: endpoint }
23
- @client.call_adyen_api(@service, action, request, headers, @version)
24
- end
25
-
26
- # Create a boarding token - store level
27
- def generate_payments_app_boarding_token_for_store(request, merchant_id, store_id, boarding_token_request, headers: {})
28
- endpoint = '/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken'.gsub(/{.+?}/, '%s')
29
- endpoint = endpoint.gsub(%r{^/}, '')
30
- endpoint = format(endpoint,_merchant_id,_store_id)
31
-
32
- action = { method: 'post', url: endpoint }
33
- @client.call_adyen_api(@service, action, request, headers, @version)
34
- end
35
-
36
- # Get a list of Payments Apps - merchant level
37
- def list_payments_app_for_merchant(merchant_id, headers: {}, query_params: {})
38
- endpoint = '/merchants/{merchantId}/paymentsApps'.gsub(/{.+?}/, '%s')
39
- endpoint = endpoint.gsub(%r{^/}, '')
40
- endpoint = format(endpoint,_merchant_id)
41
- endpoint += create_query_string(query_params)
42
- action = { method: 'get', url: endpoint }
43
- @client.call_adyen_api(@service, action, {}, headers, @version)
44
- end
45
-
46
- # Get a list of Payments Apps - store level
47
- def list_payments_app_for_store(merchant_id, store_id, headers: {}, query_params: {})
48
- endpoint = '/merchants/{merchantId}/stores/{storeId}/paymentsApps'.gsub(/{.+?}/, '%s')
49
- endpoint = endpoint.gsub(%r{^/}, '')
50
- endpoint = format(endpoint,_merchant_id,_store_id)
51
- endpoint += create_query_string(query_params)
52
- action = { method: 'get', url: endpoint }
53
- @client.call_adyen_api(@service, action, {}, headers, @version)
14
+ @service = 'PaymentsApp'
15
+ @client = client
16
+ @version = version
54
17
  end
55
18
 
56
- # Revoke Payments App instance authentication
57
- def revoke_payments_app(merchant_id, installation_id, headers: {})
58
- endpoint = '/merchants/{merchantId}/paymentsApps/{installationId}/revoke'.gsub(/{.+?}/, '%s')
59
- endpoint = endpoint.gsub(%r{^/}, '')
60
- endpoint = format(endpoint,_merchant_id,_installation_id)
61
-
62
- action = { method: 'post', url: endpoint }
63
- @client.call_adyen_api(@service, action, {}, headers, @version)
19
+ def payments_app_api
20
+ @payments_app_api ||= Adyen::PaymentsAppApi.new(@client, @version)
64
21
  end
65
22
 
66
23
  end
@@ -0,0 +1,26 @@
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 PosMobileApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'PosMobile')
13
+ end
14
+
15
+ # Create a communication session
16
+ def create_communication_session(request, headers: {})
17
+ endpoint = '/sessions'.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
+ end
26
+ end
@@ -1,26 +1,23 @@
1
- require_relative './service'
1
+ require_relative 'posMobile/pos_mobile_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 PosMobile < Service
9
+ class PosMobile
9
10
  attr_accessor :service, :version
10
11
 
11
12
  DEFAULT_VERSION = 68
12
13
  def initialize(client, version = DEFAULT_VERSION)
13
- super(client, version, 'PosMobile')
14
+ @service = 'PosMobile'
15
+ @client = client
16
+ @version = version
14
17
  end
15
18
 
16
- # Create a communication session
17
- def create_communication_session(request, headers: {})
18
- endpoint = '/sessions'.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 pos_mobile_api
20
+ @pos_mobile_api ||= Adyen::PosMobileApi.new(@client, @version)
24
21
  end
25
22
 
26
23
  end
@@ -0,0 +1,80 @@
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 RecurringApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'Recurring')
13
+ end
14
+
15
+ # Create new permits linked to a recurring contract.
16
+ #
17
+ # Deprecated since Adyen Recurring API v68
18
+ def create_permit(request, headers: {})
19
+ endpoint = '/createPermit'.gsub(/{.+?}/, '%s')
20
+ endpoint = endpoint.gsub(%r{^/}, '')
21
+ endpoint = format(endpoint)
22
+
23
+ action = { method: 'post', url: endpoint }
24
+ @client.call_adyen_api(@service, action, request, headers, @version)
25
+ end
26
+
27
+ # Disable stored payment details
28
+ def disable(request, headers: {})
29
+ endpoint = '/disable'.gsub(/{.+?}/, '%s')
30
+ endpoint = endpoint.gsub(%r{^/}, '')
31
+ endpoint = format(endpoint)
32
+
33
+ action = { method: 'post', url: endpoint }
34
+ @client.call_adyen_api(@service, action, request, headers, @version)
35
+ end
36
+
37
+ # Disable an existing permit.
38
+ #
39
+ # Deprecated since Adyen Recurring API v68
40
+ def disable_permit(request, headers: {})
41
+ endpoint = '/disablePermit'.gsub(/{.+?}/, '%s')
42
+ endpoint = endpoint.gsub(%r{^/}, '')
43
+ endpoint = format(endpoint)
44
+
45
+ action = { method: 'post', url: endpoint }
46
+ @client.call_adyen_api(@service, action, request, headers, @version)
47
+ end
48
+
49
+ # Get stored payment details
50
+ def list_recurring_details(request, headers: {})
51
+ endpoint = '/listRecurringDetails'.gsub(/{.+?}/, '%s')
52
+ endpoint = endpoint.gsub(%r{^/}, '')
53
+ endpoint = format(endpoint)
54
+
55
+ action = { method: 'post', url: endpoint }
56
+ @client.call_adyen_api(@service, action, request, headers, @version)
57
+ end
58
+
59
+ # Ask issuer to notify the shopper
60
+ def notify_shopper(request, headers: {})
61
+ endpoint = '/notifyShopper'.gsub(/{.+?}/, '%s')
62
+ endpoint = endpoint.gsub(%r{^/}, '')
63
+ endpoint = format(endpoint)
64
+
65
+ action = { method: 'post', url: endpoint }
66
+ @client.call_adyen_api(@service, action, request, headers, @version)
67
+ end
68
+
69
+ # Schedule running the Account Updater
70
+ def schedule_account_updater(request, headers: {})
71
+ endpoint = '/scheduleAccountUpdater'.gsub(/{.+?}/, '%s')
72
+ endpoint = endpoint.gsub(%r{^/}, '')
73
+ endpoint = format(endpoint)
74
+
75
+ action = { method: 'post', url: endpoint }
76
+ @client.call_adyen_api(@service, action, request, headers, @version)
77
+ end
78
+
79
+ end
80
+ end
@@ -1,76 +1,23 @@
1
- require_relative './service'
1
+ require_relative 'recurring/recurring_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 Recurring < Service
9
+ class Recurring
9
10
  attr_accessor :service, :version
10
11
 
11
12
  DEFAULT_VERSION = 68
12
13
  def initialize(client, version = DEFAULT_VERSION)
13
- super(client, version, 'Recurring')
14
- end
15
-
16
- # Create new permits linked to a recurring contract.
17
- def create_permit(request, headers: {})
18
- endpoint = '/createPermit'.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
- # Disable stored payment details
27
- def disable(request, headers: {})
28
- endpoint = '/disable'.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
- # Disable an existing permit.
37
- def disable_permit(request, headers: {})
38
- endpoint = '/disablePermit'.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 stored payment details
47
- def list_recurring_details(request, headers: {})
48
- endpoint = '/listRecurringDetails'.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
- # Ask issuer to notify the shopper
57
- def notify_shopper(request, headers: {})
58
- endpoint = '/notifyShopper'.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)
14
+ @service = 'Recurring'
15
+ @client = client
16
+ @version = version
64
17
  end
65
18
 
66
- # Schedule running the Account Updater
67
- def schedule_account_updater(request, headers: {})
68
- endpoint = '/scheduleAccountUpdater'.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)
19
+ def recurring_api
20
+ @recurring_api ||= Adyen::RecurringApi.new(@client, @version)
74
21
  end
75
22
 
76
23
  end
@@ -13,7 +13,7 @@ module Adyen
13
13
  end
14
14
 
15
15
  # Create a session token
16
- def create_authentication_session(request, authentication_session_request, headers: {})
16
+ def create_authentication_session(request, headers: {})
17
17
  endpoint = '/sessions'.gsub(/{.+?}/, '%s')
18
18
  endpoint = endpoint.gsub(%r{^/}, '')
19
19
  endpoint = format(endpoint)
@@ -0,0 +1,76 @@
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 StoredValueApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'StoredValue')
13
+ end
14
+
15
+ # Changes the status of the payment method.
16
+ def change_status(request, headers: {})
17
+ endpoint = '/changeStatus'.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
+ # Checks the balance.
26
+ def check_balance(request, headers: {})
27
+ endpoint = '/checkBalance'.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
+ # Issues a new card.
36
+ def issue(request, headers: {})
37
+ endpoint = '/issue'.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
+ # Loads the payment method.
46
+ def load(request, headers: {})
47
+ endpoint = '/load'.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
+ # Merge the balance of two cards.
56
+ def merge_balance(request, headers: {})
57
+ endpoint = '/mergeBalance'.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
+ # Voids a transaction.
66
+ def void_transaction(request, headers: {})
67
+ endpoint = '/voidTransaction'.gsub(/{.+?}/, '%s')
68
+ endpoint = endpoint.gsub(%r{^/}, '')
69
+ endpoint = format(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,76 +1,23 @@
1
- require_relative './service'
1
+ require_relative 'storedValue/stored_value_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 StoredValue < Service
9
+ class StoredValue
9
10
  attr_accessor :service, :version
10
11
 
11
12
  DEFAULT_VERSION = 46
12
13
  def initialize(client, version = DEFAULT_VERSION)
13
- super(client, version, 'StoredValue')
14
- end
15
-
16
- # Changes the status of the payment method.
17
- def change_status(request, headers: {})
18
- endpoint = '/changeStatus'.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
- # Checks the balance.
27
- def check_balance(request, headers: {})
28
- endpoint = '/checkBalance'.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
- # Issues a new card.
37
- def issue(request, headers: {})
38
- endpoint = '/issue'.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
- # Loads the payment method.
47
- def load(request, headers: {})
48
- endpoint = '/load'.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
- # Merge the balance of two cards.
57
- def merge_balance(request, headers: {})
58
- endpoint = '/mergeBalance'.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)
14
+ @service = 'StoredValue'
15
+ @client = client
16
+ @version = version
64
17
  end
65
18
 
66
- # Voids a transaction.
67
- def void_transaction(request, headers: {})
68
- endpoint = '/voidTransaction'.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)
19
+ def stored_value_api
20
+ @stored_value_api ||= Adyen::StoredValueApi.new(@client, @version)
74
21
  end
75
22
 
76
23
  end
data/lib/adyen/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Adyen
2
2
  NAME = 'adyen-ruby-api-library'.freeze
3
- VERSION = '10.4.0'.freeze
3
+ VERSION = '11.0.0'.freeze
4
4
  end
@@ -18,6 +18,9 @@ require_relative 'adyen/services/balancePlatform'
18
18
  require_relative 'adyen/services/transfers'
19
19
  require_relative 'adyen/services/management'
20
20
  require_relative 'adyen/services/storedValue'
21
- require_relative 'adyen/services/balanceControlService'
22
21
  require_relative 'adyen/services/terminalCloudAPI'
23
22
  require_relative 'adyen/services/posMobile'
23
+ require_relative 'adyen/services/openBanking'
24
+ require_relative 'adyen/services/sessionAuthentication'
25
+ require_relative 'adyen/services/balanceControl'
26
+
@@ -1,11 +1,11 @@
1
1
  require 'spec_helper'
2
2
  require 'json'
3
3
 
4
- RSpec.describe Adyen::BalancePlatform, service: 'balancePlatform' do
4
+ RSpec.describe Adyen::BalanceControl, service: 'balanceControl' do
5
5
  before(:all) do
6
6
  @shared_values = {
7
7
  client: create_client(:api_key),
8
- service: 'BalancePlatform'
8
+ service: 'BalanceControl'
9
9
  }
10
10
  end
11
11
 
@@ -15,8 +15,10 @@ RSpec.describe Adyen::BalancePlatform, service: 'balancePlatform' do
15
15
 
16
16
  response_body = json_from_file('mocks/responses/BalanceControl/balance_transfer.json')
17
17
 
18
- url = @shared_values[:client].service_url(@shared_values[:service], 'balanceTransfer',
19
- @shared_values[:client].balance_control_service.version)
18
+ url = @shared_values[:client].service_url(
19
+ @shared_values[:service],
20
+ 'balanceTransfer',
21
+ @shared_values[:client].balance_control.version)
20
22
  WebMock.stub_request(:post, url)
21
23
  .with(
22
24
  body: request_body,
@@ -28,7 +30,7 @@ RSpec.describe Adyen::BalancePlatform, service: 'balancePlatform' do
28
30
  body: response_body
29
31
  )
30
32
 
31
- result = @shared_values[:client].balance_control_service.balance_transfer(request_body)
33
+ result = @shared_values[:client].balance_control.balance_control_api.balance_transfer(request_body)
32
34
  response_hash = result.response
33
35
 
34
36
  expect(result.status)