From 53a7578f230ff902444e8f1adeaddc271f228283 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Fri, 31 Jul 2026 12:01:02 +0000 Subject: [PATCH 1/2] [balanceplatform] Automated update from Adyen/adyen-openapi@425d65d --- lib/adyen/services/balancePlatform.rb | 15 ++++ .../balancePlatform/balance_accounts_api.rb | 40 ---------- .../custom_payout_schedules_sweeps_api.rb | 56 +++++++++++++ .../managed_payout_schedules_api.rb | 80 +++++++++++++++++++ .../balancePlatform/recurring_top_ups_api.rb | 48 +++++++++++ .../sca_device_management_api.rb | 8 ++ sdk-generation-log/balanceplatform.json | 8 +- 7 files changed, 211 insertions(+), 44 deletions(-) create mode 100644 lib/adyen/services/balancePlatform/custom_payout_schedules_sweeps_api.rb create mode 100644 lib/adyen/services/balancePlatform/managed_payout_schedules_api.rb create mode 100644 lib/adyen/services/balancePlatform/recurring_top_ups_api.rb diff --git a/lib/adyen/services/balancePlatform.rb b/lib/adyen/services/balancePlatform.rb index 79525496..c80639ed 100644 --- a/lib/adyen/services/balancePlatform.rb +++ b/lib/adyen/services/balancePlatform.rb @@ -4,15 +4,18 @@ require_relative 'balancePlatform/balances_api' require_relative 'balancePlatform/bank_account_validation_api' require_relative 'balancePlatform/card_orders_api' +require_relative 'balancePlatform/custom_payout_schedules_sweeps_api' require_relative 'balancePlatform/direct_debit_mandates_api' require_relative 'balancePlatform/grant_accounts_api' require_relative 'balancePlatform/grant_offers_api' require_relative 'balancePlatform/manage_card_pin_api' require_relative 'balancePlatform/manage_sca_devices_api' +require_relative 'balancePlatform/managed_payout_schedules_api' require_relative 'balancePlatform/network_tokens_api' require_relative 'balancePlatform/payment_instrument_groups_api' require_relative 'balancePlatform/payment_instruments_api' require_relative 'balancePlatform/platform_api' +require_relative 'balancePlatform/recurring_top_ups_api' require_relative 'balancePlatform/sca_association_management_api' require_relative 'balancePlatform/sca_device_management_api' require_relative 'balancePlatform/transaction_rules_api' @@ -60,6 +63,10 @@ def card_orders_api @card_orders_api ||= Adyen::CardOrdersApi.new(@client, @version) end + def custom_payout_schedules_sweeps_api + @custom_payout_schedules_sweeps_api ||= Adyen::CustomPayoutSchedulesSweepsApi.new(@client, @version) + end + def direct_debit_mandates_api @direct_debit_mandates_api ||= Adyen::DirectDebitMandatesApi.new(@client, @version) end @@ -80,6 +87,10 @@ def manage_sca_devices_api @manage_sca_devices_api ||= Adyen::ManageSCADevicesApi.new(@client, @version) end + def managed_payout_schedules_api + @managed_payout_schedules_api ||= Adyen::ManagedPayoutSchedulesApi.new(@client, @version) + end + def network_tokens_api @network_tokens_api ||= Adyen::NetworkTokensApi.new(@client, @version) end @@ -96,6 +107,10 @@ def platform_api @platform_api ||= Adyen::PlatformApi.new(@client, @version) end + def recurring_top_ups_api + @recurring_top_ups_api ||= Adyen::RecurringTopUpsApi.new(@client, @version) + end + def sca_association_management_api @sca_association_management_api ||= Adyen::SCAAssociationManagementApi.new(@client, @version) end diff --git a/lib/adyen/services/balancePlatform/balance_accounts_api.rb b/lib/adyen/services/balancePlatform/balance_accounts_api.rb index b616502f..b54beb27 100644 --- a/lib/adyen/services/balancePlatform/balance_accounts_api.rb +++ b/lib/adyen/services/balancePlatform/balance_accounts_api.rb @@ -20,30 +20,6 @@ def create_balance_account(request, headers: {}) @client.call_adyen_api(@service, action, request, headers, @version) end - # Create a sweep - def create_sweep(request, balance_account_id, headers: {}) - endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps', balance_account_id) - - action = { method: 'post', url: endpoint } - @client.call_adyen_api(@service, action, request, headers, @version) - end - - # Delete a sweep - def delete_sweep(balance_account_id, sweep_id, headers: {}) - endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}', balance_account_id, sweep_id) - - action = { method: 'delete', url: endpoint } - @client.call_adyen_api(@service, action, {}, headers, @version) - end - - # Get all sweeps for a balance account - def get_all_sweeps_for_balance_account(balance_account_id, headers: {}, query_params: {}) - endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps', balance_account_id) - endpoint += create_query_string(query_params) - action = { method: 'get', url: endpoint } - @client.call_adyen_api(@service, action, {}, headers, @version) - end - # Get all transaction rules for a balance account def get_all_transaction_rules_for_balance_account(id, headers: {}) endpoint = build_endpoint('/balanceAccounts/{id}/transactionRules', id) @@ -68,14 +44,6 @@ def get_payment_instruments_linked_to_balance_account(id, headers: {}, query_par @client.call_adyen_api(@service, action, {}, headers, @version) end - # Get a sweep - def get_sweep(balance_account_id, sweep_id, headers: {}) - endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}', balance_account_id, sweep_id) - - action = { method: 'get', url: endpoint } - @client.call_adyen_api(@service, action, {}, headers, @version) - end - # Update a balance account def update_balance_account(request, id, headers: {}) endpoint = build_endpoint('/balanceAccounts/{id}', id) @@ -84,13 +52,5 @@ def update_balance_account(request, id, headers: {}) @client.call_adyen_api(@service, action, request, headers, @version) end - # Update a sweep - def update_sweep(request, balance_account_id, sweep_id, headers: {}) - endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}', balance_account_id, sweep_id) - - action = { method: 'patch', url: endpoint } - @client.call_adyen_api(@service, action, request, headers, @version) - end - end end diff --git a/lib/adyen/services/balancePlatform/custom_payout_schedules_sweeps_api.rb b/lib/adyen/services/balancePlatform/custom_payout_schedules_sweeps_api.rb new file mode 100644 index 00000000..3070beec --- /dev/null +++ b/lib/adyen/services/balancePlatform/custom_payout_schedules_sweeps_api.rb @@ -0,0 +1,56 @@ +require_relative '../service' +module Adyen + + # NOTE: This class is auto generated by OpenAPI Generator + # Ref: https://openapi-generator.tech + # + # Do not edit the class manually. + class CustomPayoutSchedulesSweepsApi < Service + attr_accessor :service, :version + + def initialize(client, version = DEFAULT_VERSION) + super(client, version, 'BalancePlatform') + end + + # Create a sweep + def create_sweep(request, balance_account_id, headers: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps', balance_account_id) + + action = { method: 'post', url: endpoint } + @client.call_adyen_api(@service, action, request, headers, @version) + end + + # Delete a sweep + def delete_sweep(balance_account_id, sweep_id, headers: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}', balance_account_id, sweep_id) + + action = { method: 'delete', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Get all sweeps for a balance account + def get_all_sweeps_for_balance_account(balance_account_id, headers: {}, query_params: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps', balance_account_id) + endpoint += create_query_string(query_params) + action = { method: 'get', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Get a sweep + def get_sweep(balance_account_id, sweep_id, headers: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}', balance_account_id, sweep_id) + + action = { method: 'get', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Update a sweep + def update_sweep(request, balance_account_id, sweep_id, headers: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}', balance_account_id, sweep_id) + + action = { method: 'patch', url: endpoint } + @client.call_adyen_api(@service, action, request, headers, @version) + end + + end +end diff --git a/lib/adyen/services/balancePlatform/managed_payout_schedules_api.rb b/lib/adyen/services/balancePlatform/managed_payout_schedules_api.rb new file mode 100644 index 00000000..dc7949cb --- /dev/null +++ b/lib/adyen/services/balancePlatform/managed_payout_schedules_api.rb @@ -0,0 +1,80 @@ +require_relative '../service' +module Adyen + + # NOTE: This class is auto generated by OpenAPI Generator + # Ref: https://openapi-generator.tech + # + # Do not edit the class manually. + class ManagedPayoutSchedulesApi < Service + attr_accessor :service, :version + + def initialize(client, version = DEFAULT_VERSION) + super(client, version, 'BalancePlatform') + end + + # Apply a managed payout schedule to a balance account + def apply_managed_schedule(request, balance_account_id, headers: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/payoutSchedules', balance_account_id) + + action = { method: 'post', url: endpoint } + @client.call_adyen_api(@service, action, request, headers, @version) + end + + # Delete a managed payout schedule on a balance account + def delete_balance_account_managed_schedule(balance_account_id, id, headers: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/payoutSchedules/{id}', balance_account_id, id) + + action = { method: 'delete', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Get a specific managed payout schedule on a balance account + def get_balance_account_managed_schedule_by_id(balance_account_id, id, headers: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/payoutSchedules/{id}', balance_account_id, id) + + action = { method: 'get', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Get all managed payout schedules on a balance account + def get_balance_account_managed_schedules(balance_account_id, headers: {}, query_params: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/payoutSchedules', balance_account_id) + endpoint += create_query_string(query_params) + action = { method: 'get', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Get a specific managed payout schedule on your balance platform + def get_balance_platform_managed_schedule_by_id(balance_platform_id, id, headers: {}) + endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/payoutSchedules/{id}', balance_platform_id, id) + + action = { method: 'get', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Get all managed payout schedules on your balance platform + def get_balance_platform_managed_schedules(balance_platform_id, headers: {}, query_params: {}) + endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/payoutSchedules', balance_platform_id) + endpoint += create_query_string(query_params) + action = { method: 'get', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # View executions of a managed payout schedule + def get_payout_schedule_executions(balance_account_id, id, headers: {}, query_params: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/payoutSchedules/{id}/executions', balance_account_id, id) + endpoint += create_query_string(query_params) + action = { method: 'get', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Update a managed payout schedule on a balance account + def update_balance_account_managed_schedule(request, balance_account_id, id, headers: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/payoutSchedules/{id}', balance_account_id, id) + + action = { method: 'patch', url: endpoint } + @client.call_adyen_api(@service, action, request, headers, @version) + end + + end +end diff --git a/lib/adyen/services/balancePlatform/recurring_top_ups_api.rb b/lib/adyen/services/balancePlatform/recurring_top_ups_api.rb new file mode 100644 index 00000000..206cceb4 --- /dev/null +++ b/lib/adyen/services/balancePlatform/recurring_top_ups_api.rb @@ -0,0 +1,48 @@ +require_relative '../service' +module Adyen + + # NOTE: This class is auto generated by OpenAPI Generator + # Ref: https://openapi-generator.tech + # + # Do not edit the class manually. + class RecurringTopUpsApi < Service + attr_accessor :service, :version + + def initialize(client, version = DEFAULT_VERSION) + super(client, version, 'BalancePlatform') + end + + # Create recurring top up + def create_recurring_top_up(request, balance_account_id, headers: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/recurringTopUps', balance_account_id) + + action = { method: 'post', url: endpoint } + @client.call_adyen_api(@service, action, request, headers, @version) + end + + # Delete a recurring top up + def delete_recurring_top_up(balance_account_id, top_up_id, headers: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/recurringTopUps/{topUpId}', balance_account_id, top_up_id) + + action = { method: 'delete', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Get recurring top ups for a specific balanceAccountId + def get_recurring_top_ups(balance_account_id, headers: {}, query_params: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/recurringTopUps', balance_account_id) + endpoint += create_query_string(query_params) + action = { method: 'get', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Update a RecurringTopUp + def update_recurring_top_ups(request, balance_account_id, top_up_id, headers: {}) + endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/recurringTopUps/{topUpId}', balance_account_id, top_up_id) + + action = { method: 'patch', url: endpoint } + @client.call_adyen_api(@service, action, request, headers, @version) + end + + end +end diff --git a/lib/adyen/services/balancePlatform/sca_device_management_api.rb b/lib/adyen/services/balancePlatform/sca_device_management_api.rb index 74fc56f9..976282f7 100644 --- a/lib/adyen/services/balancePlatform/sca_device_management_api.rb +++ b/lib/adyen/services/balancePlatform/sca_device_management_api.rb @@ -20,6 +20,14 @@ def begin_sca_device_registration(request, headers: {}) @client.call_adyen_api(@service, action, request, headers, @version) end + # Delete an SCA device + def delete_sca_device(device_id, headers: {}) + endpoint = build_endpoint('/scaDevices/{deviceId}', device_id) + + action = { method: 'delete', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + # Finish registration process for a SCA device def finish_sca_device_registration(request, device_id, headers: {}) endpoint = build_endpoint('/scaDevices/{deviceId}', device_id) diff --git a/sdk-generation-log/balanceplatform.json b/sdk-generation-log/balanceplatform.json index d05a80fe..2a6ae464 100644 --- a/sdk-generation-log/balanceplatform.json +++ b/sdk-generation-log/balanceplatform.json @@ -1,8 +1,8 @@ { "service": "balanceplatform", "project": "ruby", - "generatedAt": "2026-04-20T13:40:00Z", - "openapiCommitSha": "3550ecd3f320efaad6bee55ffed5122cb9ba09d5", - "automationCommitSha": "4ad0c0c7e87bc0e5994a9a3350a991d0691350bb", - "libraryCommitSha": "60ccdbdbbb7069d54600a8a8cd19eea245661134" + "generatedAt": "2026-07-31T12:01:02Z", + "openapiCommitSha": "425d65d12163ebd4fe6fa6d2f859075817c81cba", + "automationCommitSha": "0c108bd8050cf480d2710b78b770afdfbdd89397", + "libraryCommitSha": "7f77a7b7aca2c2b22147ba4b996ada979f9decd9" } From 825fbbe4449c63c1f71adc5afd8d7147c033cfa2 Mon Sep 17 00:00:00 2001 From: marcor Date: Thu, 30 Jul 2026 15:43:57 +0200 Subject: [PATCH 2/2] Fix(balanceplatform): add and update tests for balanceplatform changes --- spec/balance_platform_spec.rb | 502 +++++++++++++++++- .../apply_managed_schedule.json | 14 + .../begin_sca_device_registration.json | 4 + .../create_recurring_top_up.json | 21 + .../BalancePlatform/create_sweep.json | 10 + .../finish_sca_device_registration.json | 3 + .../submit_sca_association.json | 8 + ...date_balance_account_managed_schedule.json | 5 + .../update_recurring_top_ups.json | 3 + .../BalancePlatform/update_sweep.json | 6 + .../apply_managed_schedule.json | 17 + .../begin_sca_device_registration.json | 8 + .../create_recurring_top_up.json | 23 + .../BalancePlatform/create_sweep.json | 12 + .../finish_sca_device_registration.json | 7 + .../get_all_sweeps_for_balance_account.json | 31 ++ ...alance_account_managed_schedule_by_id.json | 17 + ...get_balance_account_managed_schedules.json | 26 + ...lance_platform_managed_schedule_by_id.json | 27 + ...et_balance_platform_managed_schedules.json | 31 ++ .../get_payout_schedule_executions.json | 21 + .../get_recurring_top_ups.json | 35 ++ .../responses/BalancePlatform/get_sweep.json | 12 + .../submit_sca_association.json | 10 + ...date_balance_account_managed_schedule.json | 18 + .../update_recurring_top_ups.json | 23 + .../BalancePlatform/update_sweep.json | 12 + 27 files changed, 902 insertions(+), 4 deletions(-) create mode 100644 spec/mocks/requests/BalancePlatform/apply_managed_schedule.json create mode 100644 spec/mocks/requests/BalancePlatform/begin_sca_device_registration.json create mode 100644 spec/mocks/requests/BalancePlatform/create_recurring_top_up.json create mode 100644 spec/mocks/requests/BalancePlatform/create_sweep.json create mode 100644 spec/mocks/requests/BalancePlatform/finish_sca_device_registration.json create mode 100644 spec/mocks/requests/BalancePlatform/submit_sca_association.json create mode 100644 spec/mocks/requests/BalancePlatform/update_balance_account_managed_schedule.json create mode 100644 spec/mocks/requests/BalancePlatform/update_recurring_top_ups.json create mode 100644 spec/mocks/requests/BalancePlatform/update_sweep.json create mode 100644 spec/mocks/responses/BalancePlatform/apply_managed_schedule.json create mode 100644 spec/mocks/responses/BalancePlatform/begin_sca_device_registration.json create mode 100644 spec/mocks/responses/BalancePlatform/create_recurring_top_up.json create mode 100644 spec/mocks/responses/BalancePlatform/create_sweep.json create mode 100644 spec/mocks/responses/BalancePlatform/finish_sca_device_registration.json create mode 100644 spec/mocks/responses/BalancePlatform/get_all_sweeps_for_balance_account.json create mode 100644 spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedule_by_id.json create mode 100644 spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedules.json create mode 100644 spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedule_by_id.json create mode 100644 spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedules.json create mode 100644 spec/mocks/responses/BalancePlatform/get_payout_schedule_executions.json create mode 100644 spec/mocks/responses/BalancePlatform/get_recurring_top_ups.json create mode 100644 spec/mocks/responses/BalancePlatform/get_sweep.json create mode 100644 spec/mocks/responses/BalancePlatform/submit_sca_association.json create mode 100644 spec/mocks/responses/BalancePlatform/update_balance_account_managed_schedule.json create mode 100644 spec/mocks/responses/BalancePlatform/update_recurring_top_ups.json create mode 100644 spec/mocks/responses/BalancePlatform/update_sweep.json diff --git a/spec/balance_platform_spec.rb b/spec/balance_platform_spec.rb index 2ec9a248..f7fd9d25 100644 --- a/spec/balance_platform_spec.rb +++ b/spec/balance_platform_spec.rb @@ -2,6 +2,8 @@ require 'json' RSpec.describe Adyen::BalancePlatform, service: 'balancePlatform' do + SWEEPS_ENDPOINT = 'balanceAccounts/balanceAccountID/sweeps/sweepID' + before(:all) do @shared_values = { client: create_client(:api_key), @@ -88,17 +90,112 @@ it 'makes a balance_account/sweeps DELETE call' do url = @shared_values[:client].service_url( @shared_values[:service], - 'balanceAccounts/balanceAccountID/sweeps/sweepID', + SWEEPS_ENDPOINT, @shared_values[:client].balance_platform.version ) WebMock.stub_request(:delete, url) .with(headers: { 'x-api-key' => @shared_values[:client].api_key }) - .to_return(body: '{}') + .to_return(status: 204, body: '') + + result = @shared_values[:client].balance_platform.custom_payout_schedules_sweeps_api.delete_sweep('balanceAccountID', 'sweepID') + + expect(result.status).to eq(204) + end + + it 'makes a create_sweep POST call' do + request_body = JSON.parse(json_from_file('mocks/requests/BalancePlatform/create_sweep.json')) + response_body = json_from_file('mocks/responses/BalancePlatform/create_sweep.json') + + url = @shared_values[:client].service_url( + @shared_values[:service], + 'balanceAccounts/balanceAccountID/sweeps', + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:post, url) + .with( + body: request_body, + headers: { 'x-api-key' => @shared_values[:client].api_key } + ) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.custom_payout_schedules_sweeps_api.create_sweep(request_body, 'balanceAccountID') + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes a get_all_sweeps_for_balance_account GET call' do + response_body = json_from_file('mocks/responses/BalancePlatform/get_all_sweeps_for_balance_account.json') + + url = @shared_values[:client].service_url( + @shared_values[:service], + 'balanceAccounts/balanceAccountID/sweeps', + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:get, url) + .with( + query: { 'limit' => 5, 'offset' => 10 }, + headers: { 'x-api-key' => @shared_values[:client].api_key } + ) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.custom_payout_schedules_sweeps_api + .get_all_sweeps_for_balance_account('balanceAccountID', query_params: { 'limit' => 5, 'offset' => 10 }) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes a get_sweep GET call' do + response_body = json_from_file('mocks/responses/BalancePlatform/get_sweep.json') + + url = @shared_values[:client].service_url( + @shared_values[:service], + SWEEPS_ENDPOINT, + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:get, url) + .with(headers: { 'x-api-key' => @shared_values[:client].api_key }) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.custom_payout_schedules_sweeps_api.get_sweep('balanceAccountID', 'sweepID') + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes an update_sweep PATCH call' do + request_body = JSON.parse(json_from_file('mocks/requests/BalancePlatform/update_sweep.json')) + response_body = json_from_file('mocks/responses/BalancePlatform/update_sweep.json') + + url = @shared_values[:client].service_url( + @shared_values[:service], + SWEEPS_ENDPOINT, + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:patch, url) + .with( + body: request_body, + headers: { 'x-api-key' => @shared_values[:client].api_key } + ) + .to_return(body: response_body) - result = @shared_values[:client].balance_platform.balance_accounts_api.delete_sweep('balanceAccountID', 'sweepID') - result.response + result = @shared_values[:client].balance_platform.custom_payout_schedules_sweeps_api.update_sweep(request_body, 'balanceAccountID', 'sweepID') + response_hash = result.response expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash end ## balancePlatform level transferLimits @@ -518,4 +615,401 @@ expect(response_hash).to be_a Adyen::HashWithAccessors expect(response_hash).to be_a_kind_of Hash end + + ## managed payout schedules + it 'makes an apply_managed_schedule POST call' do + request_body = JSON.parse(json_from_file('mocks/requests/BalancePlatform/apply_managed_schedule.json')) + response_body = json_from_file('mocks/responses/BalancePlatform/apply_managed_schedule.json') + balance_account_id = 'YOUR_BALANCE_ACCOUNT_ID' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balanceAccounts/#{balance_account_id}/payoutSchedules", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:post, url) + .with( + body: request_body, + headers: { 'x-api-key' => @shared_values[:client].api_key } + ) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.managed_payout_schedules_api + .apply_managed_schedule(request_body, balance_account_id) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes a get_balance_account_managed_schedules GET call' do + response_body = json_from_file('mocks/responses/BalancePlatform/get_balance_account_managed_schedules.json') + balance_account_id = 'YOUR_BALANCE_ACCOUNT_ID' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balanceAccounts/#{balance_account_id}/payoutSchedules", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:get, url) + .with(headers: { 'x-api-key' => @shared_values[:client].api_key }) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.managed_payout_schedules_api + .get_balance_account_managed_schedules(balance_account_id) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes a get_balance_account_managed_schedule_by_id GET call' do + response_body = json_from_file('mocks/responses/BalancePlatform/get_balance_account_managed_schedule_by_id.json') + balance_account_id = 'YOUR_BALANCE_ACCOUNT_ID' + payout_schedule_id = 'PSAC00000000000000000000000001' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balanceAccounts/#{balance_account_id}/payoutSchedules/#{payout_schedule_id}", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:get, url) + .with(headers: { 'x-api-key' => @shared_values[:client].api_key }) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.managed_payout_schedules_api + .get_balance_account_managed_schedule_by_id(balance_account_id, payout_schedule_id) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes an update_balance_account_managed_schedule PATCH call' do + request_body = JSON.parse(json_from_file('mocks/requests/BalancePlatform/update_balance_account_managed_schedule.json')) + response_body = json_from_file('mocks/responses/BalancePlatform/update_balance_account_managed_schedule.json') + balance_account_id = 'YOUR_BALANCE_ACCOUNT_ID' + payout_schedule_id = 'PSAC00000000000000000000000001' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balanceAccounts/#{balance_account_id}/payoutSchedules/#{payout_schedule_id}", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:patch, url) + .with( + body: request_body, + headers: { 'x-api-key' => @shared_values[:client].api_key } + ) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.managed_payout_schedules_api + .update_balance_account_managed_schedule(request_body, balance_account_id, payout_schedule_id) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes a delete_balance_account_managed_schedule DELETE call' do + balance_account_id = 'YOUR_BALANCE_ACCOUNT_ID' + payout_schedule_id = 'PSAC00000000000000000000000001' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balanceAccounts/#{balance_account_id}/payoutSchedules/#{payout_schedule_id}", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:delete, url) + .with(headers: { 'x-api-key' => @shared_values[:client].api_key }) + .to_return(status: 204, body: '') + + result = @shared_values[:client].balance_platform.managed_payout_schedules_api + .delete_balance_account_managed_schedule(balance_account_id, payout_schedule_id) + + expect(result.status).to eq(204) + end + + it 'makes a get_payout_schedule_executions GET call' do + response_body = json_from_file('mocks/responses/BalancePlatform/get_payout_schedule_executions.json') + balance_account_id = 'YOUR_BALANCE_ACCOUNT_ID' + payout_schedule_id = 'PSAC00000000000000000000000001' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balanceAccounts/#{balance_account_id}/payoutSchedules/#{payout_schedule_id}/executions", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:get, url) + .with( + query: { 'results' => 'succeeded,failed', 'offset' => 0 }, + headers: { 'x-api-key' => @shared_values[:client].api_key } + ) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.managed_payout_schedules_api + .get_payout_schedule_executions( + balance_account_id, + payout_schedule_id, + query_params: { 'results' => 'succeeded,failed', 'offset' => 0 } + ) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes a get_balance_platform_managed_schedules GET call' do + response_body = json_from_file('mocks/responses/BalancePlatform/get_balance_platform_managed_schedules.json') + balance_platform_id = 'YOUR_BALANCE_PLATFORM_ID' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balancePlatforms/#{balance_platform_id}/payoutSchedules", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:get, url) + .with(headers: { 'x-api-key' => @shared_values[:client].api_key }) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.managed_payout_schedules_api + .get_balance_platform_managed_schedules(balance_platform_id) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes a get_balance_platform_managed_schedule_by_id GET call' do + response_body = json_from_file('mocks/responses/BalancePlatform/get_balance_platform_managed_schedule_by_id.json') + balance_platform_id = 'YOUR_BALANCE_PLATFORM_ID' + payout_schedule_id = 'PSPC00000000000000000000000001' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balancePlatforms/#{balance_platform_id}/payoutSchedules/#{payout_schedule_id}", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:get, url) + .with(headers: { 'x-api-key' => @shared_values[:client].api_key }) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.managed_payout_schedules_api + .get_balance_platform_managed_schedule_by_id(balance_platform_id, payout_schedule_id) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + ## recurringTopUps + it 'makes a create_recurring_top_up POST call' do + request_body = JSON.parse(json_from_file('mocks/requests/BalancePlatform/create_recurring_top_up.json')) + response_body = json_from_file('mocks/responses/BalancePlatform/create_recurring_top_up.json') + balance_account_id = 'BA3227C223222B5BLP6JQC3FD' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balanceAccounts/#{balance_account_id}/recurringTopUps", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:post, url) + .with( + body: request_body, + headers: { 'x-api-key' => @shared_values[:client].api_key } + ) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.recurring_top_ups_api + .create_recurring_top_up(request_body, balance_account_id) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes a get_recurring_top_ups GET call' do + response_body = json_from_file('mocks/responses/BalancePlatform/get_recurring_top_ups.json') + balance_account_id = 'BA3227C223222B5BLP6JQC3FD' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balanceAccounts/#{balance_account_id}/recurringTopUps", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:get, url) + .with(headers: { 'x-api-key' => @shared_values[:client].api_key }) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.recurring_top_ups_api + .get_recurring_top_ups(balance_account_id) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes an update_recurring_top_ups PATCH call' do + request_body = JSON.parse(json_from_file('mocks/requests/BalancePlatform/update_recurring_top_ups.json')) + response_body = json_from_file('mocks/responses/BalancePlatform/update_recurring_top_ups.json') + balance_account_id = 'BA3227C223222B5BLP6JQC3FD' + top_up_id = 'TUPC0000000000000000000001' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balanceAccounts/#{balance_account_id}/recurringTopUps/#{top_up_id}", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:patch, url) + .with( + body: request_body, + headers: { 'x-api-key' => @shared_values[:client].api_key } + ) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.recurring_top_ups_api + .update_recurring_top_ups(request_body, balance_account_id, top_up_id) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes a delete_recurring_top_up DELETE call' do + balance_account_id = 'BA3227C223222B5BLP6JQC3FD' + top_up_id = 'TUPC0000000000000000000001' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "balanceAccounts/#{balance_account_id}/recurringTopUps/#{top_up_id}", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:delete, url) + .with(headers: { 'x-api-key' => @shared_values[:client].api_key }) + .to_return(status: 204, body: '') + + result = @shared_values[:client].balance_platform.recurring_top_ups_api + .delete_recurring_top_up(balance_account_id, top_up_id) + + expect(result.status).to eq(204) + end + + ## scaDeviceManagement + it 'makes a begin_sca_device_registration POST call' do + request_body = JSON.parse(json_from_file('mocks/requests/BalancePlatform/begin_sca_device_registration.json')) + response_body = json_from_file('mocks/responses/BalancePlatform/begin_sca_device_registration.json') + + url = @shared_values[:client].service_url( + @shared_values[:service], + 'scaDevices', + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:post, url) + .with( + body: request_body, + headers: { 'x-api-key' => @shared_values[:client].api_key } + ) + .to_return(status: 201, body: response_body) + + result = @shared_values[:client].balance_platform.sca_device_management_api + .begin_sca_device_registration(request_body) + response_hash = result.response + + expect(result.status).to eq(201) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes a delete_sca_device DELETE call' do + device_id = 'BSDR42XV3223223S5N6CDQDGH53M8H' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "scaDevices/#{device_id}", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:delete, url) + .with(headers: { 'x-api-key' => @shared_values[:client].api_key }) + .to_return(status: 204, body: '') + + result = @shared_values[:client].balance_platform.sca_device_management_api + .delete_sca_device(device_id) + + expect(result.status).to eq(204) + end + + it 'makes a finish_sca_device_registration PATCH call' do + request_body = JSON.parse(json_from_file('mocks/requests/BalancePlatform/finish_sca_device_registration.json')) + response_body = json_from_file('mocks/responses/BalancePlatform/finish_sca_device_registration.json') + device_id = 'BSDR42XV3223223S5N6CDQDGH53M8H' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "scaDevices/#{device_id}", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:patch, url) + .with( + body: request_body, + headers: { 'x-api-key' => @shared_values[:client].api_key } + ) + .to_return(body: response_body) + + result = @shared_values[:client].balance_platform.sca_device_management_api + .finish_sca_device_registration(request_body, device_id) + response_hash = result.response + + expect(result.status).to eq(200) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end + + it 'makes a submit_sca_association POST call' do + request_body = JSON.parse(json_from_file('mocks/requests/BalancePlatform/submit_sca_association.json')) + response_body = json_from_file('mocks/responses/BalancePlatform/submit_sca_association.json') + device_id = 'BSDR42XV3223223S5N6CDQDGH53M8H' + + url = @shared_values[:client].service_url( + @shared_values[:service], + "scaDevices/#{device_id}/scaAssociations", + @shared_values[:client].balance_platform.version + ) + WebMock.stub_request(:post, url) + .with( + body: request_body, + headers: { 'x-api-key' => @shared_values[:client].api_key } + ) + .to_return(status: 201, body: response_body) + + result = @shared_values[:client].balance_platform.sca_device_management_api + .submit_sca_association(request_body, device_id) + response_hash = result.response + + expect(result.status).to eq(201) + expect(response_hash).to eq(JSON.parse(response_body)) + expect(response_hash).to be_a Adyen::HashWithAccessors + expect(response_hash).to be_a_kind_of Hash + end end diff --git a/spec/mocks/requests/BalancePlatform/apply_managed_schedule.json b/spec/mocks/requests/BalancePlatform/apply_managed_schedule.json new file mode 100644 index 00000000..7d345534 --- /dev/null +++ b/spec/mocks/requests/BalancePlatform/apply_managed_schedule.json @@ -0,0 +1,14 @@ +{ + "balancePlatformPayoutScheduleId": "PSPC00000000000000000000000001", + "transferInstrumentId": "SE00000000000000000000001", + "currency": "EUR", + "reference": "Monthly payout", + "description": "Scheduled payout to merchant bank account", + "referenceForBeneficiary": "PAYOUT-REF-001", + "retainedAmount": 10000, + "minPayoutAmount": 1000, + "maxPayoutAmount": 100000000, + "enabled": true, + "frequency": "monthly", + "frequencyValue": 1 +} diff --git a/spec/mocks/requests/BalancePlatform/begin_sca_device_registration.json b/spec/mocks/requests/BalancePlatform/begin_sca_device_registration.json new file mode 100644 index 00000000..ca7a7502 --- /dev/null +++ b/spec/mocks/requests/BalancePlatform/begin_sca_device_registration.json @@ -0,0 +1,4 @@ +{ + "name": "My Device", + "sdkOutput": "eyJjaGFsbGVuZ2UiOiJVWEZaTURONGNXWjZUVFExUlhWV2JuaEJPVzVzTm05cVVEUktUbFZtZGtrPSJ9" +} diff --git a/spec/mocks/requests/BalancePlatform/create_recurring_top_up.json b/spec/mocks/requests/BalancePlatform/create_recurring_top_up.json new file mode 100644 index 00000000..eaf582b7 --- /dev/null +++ b/spec/mocks/requests/BalancePlatform/create_recurring_top_up.json @@ -0,0 +1,21 @@ +{ + "counterparty": { + "transferInstrumentId": "SE000000000000000000000001" + }, + "description": "My description", + "topUpAmount": { + "fixed": { + "value": 1000, + "currency": "EUR" + } + }, + "trigger": { + "schedule": { + "type": "weekdays" + }, + "threshold": { + "value": 100, + "currency": "EUR" + } + } +} diff --git a/spec/mocks/requests/BalancePlatform/create_sweep.json b/spec/mocks/requests/BalancePlatform/create_sweep.json new file mode 100644 index 00000000..4d1fab13 --- /dev/null +++ b/spec/mocks/requests/BalancePlatform/create_sweep.json @@ -0,0 +1,10 @@ +{ + "counterparty": { + "balanceAccountId": "BA3227C223222B5BLP6JQC3FD" + }, + "currency": "EUR", + "schedule": { + "type": "daily" + }, + "type": "push" +} diff --git a/spec/mocks/requests/BalancePlatform/finish_sca_device_registration.json b/spec/mocks/requests/BalancePlatform/finish_sca_device_registration.json new file mode 100644 index 00000000..8977304f --- /dev/null +++ b/spec/mocks/requests/BalancePlatform/finish_sca_device_registration.json @@ -0,0 +1,3 @@ +{ + "sdkOutput": "eyJjaGFsbGVuZ2UiOiJVWEZaTURONGNXWjZUVFExUlhWV2JuaEJPVzVzTm05cVVEUktUbFZtZGtrPSJ9" +} diff --git a/spec/mocks/requests/BalancePlatform/submit_sca_association.json b/spec/mocks/requests/BalancePlatform/submit_sca_association.json new file mode 100644 index 00000000..344814be --- /dev/null +++ b/spec/mocks/requests/BalancePlatform/submit_sca_association.json @@ -0,0 +1,8 @@ +{ + "entities": [ + { + "type": "accountHolder", + "id": "AH00000000000000000000001" + } + ] +} diff --git a/spec/mocks/requests/BalancePlatform/update_balance_account_managed_schedule.json b/spec/mocks/requests/BalancePlatform/update_balance_account_managed_schedule.json new file mode 100644 index 00000000..5ee0a7b0 --- /dev/null +++ b/spec/mocks/requests/BalancePlatform/update_balance_account_managed_schedule.json @@ -0,0 +1,5 @@ +{ + "description": "Updated payout description", + "enabled": false, + "retainedAmount": 20000 +} diff --git a/spec/mocks/requests/BalancePlatform/update_recurring_top_ups.json b/spec/mocks/requests/BalancePlatform/update_recurring_top_ups.json new file mode 100644 index 00000000..19ae44b5 --- /dev/null +++ b/spec/mocks/requests/BalancePlatform/update_recurring_top_ups.json @@ -0,0 +1,3 @@ +{ + "description": "new description" +} diff --git a/spec/mocks/requests/BalancePlatform/update_sweep.json b/spec/mocks/requests/BalancePlatform/update_sweep.json new file mode 100644 index 00000000..017e9960 --- /dev/null +++ b/spec/mocks/requests/BalancePlatform/update_sweep.json @@ -0,0 +1,6 @@ +{ + "schedule": { + "type": "weekly" + }, + "status": "inactive" +} diff --git a/spec/mocks/responses/BalancePlatform/apply_managed_schedule.json b/spec/mocks/responses/BalancePlatform/apply_managed_schedule.json new file mode 100644 index 00000000..32a7ed76 --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/apply_managed_schedule.json @@ -0,0 +1,17 @@ +{ + "id": "PSAC00000000000000000000000001", + "balancePlatformPayoutScheduleId": "PSPC00000000000000000000000001", + "balanceAccountId": "BA000000000000000000001", + "transferInstrumentId": "SE00000000000000000000001", + "currency": "EUR", + "reference": "Monthly payout", + "description": "Scheduled payout to merchant bank account", + "referenceForBeneficiary": "PAYOUT-REF-001", + "retainedAmount": 10000, + "minPayoutAmount": 1000, + "maxPayoutAmount": 100000000, + "createdAt": "2024-01-15T10:30:00Z", + "enabled": true, + "frequency": "monthly", + "frequencyValue": 1 +} diff --git a/spec/mocks/responses/BalancePlatform/begin_sca_device_registration.json b/spec/mocks/responses/BalancePlatform/begin_sca_device_registration.json new file mode 100644 index 00000000..ad2f2a38 --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/begin_sca_device_registration.json @@ -0,0 +1,8 @@ +{ + "scaDevice": { + "id": "BSDR42XV3223223S5N6CDQDGH53M8H", + "name": "My Device", + "type": "ios" + }, + "sdkInput": "eyJjaGFsbGVuZ2UiOiJVWEZaTURONGNXWjZUVFExUlhWV2JuaEJPVzVzTm05cVVEUktUbFZtZGtrPSJ9" +} diff --git a/spec/mocks/responses/BalancePlatform/create_recurring_top_up.json b/spec/mocks/responses/BalancePlatform/create_recurring_top_up.json new file mode 100644 index 00000000..a5038e6b --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/create_recurring_top_up.json @@ -0,0 +1,23 @@ +{ + "id": "TUPC0000000000000000000001", + "counterparty": { + "transferInstrumentId": "SE000000000000000000000001" + }, + "description": "My description", + "topUpAmount": { + "fixed": { + "value": 1000, + "currency": "EUR" + } + }, + "trigger": { + "schedule": { + "type": "weekdays" + }, + "threshold": { + "value": 100, + "currency": "EUR" + } + }, + "status": "active" +} diff --git a/spec/mocks/responses/BalancePlatform/create_sweep.json b/spec/mocks/responses/BalancePlatform/create_sweep.json new file mode 100644 index 00000000..fbce8b0c --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/create_sweep.json @@ -0,0 +1,12 @@ +{ + "counterparty": { + "balanceAccountId": "BA3227C223222B5BLP6JQC3FD" + }, + "currency": "EUR", + "id": "SWEP00000000000000000000000001", + "schedule": { + "type": "daily" + }, + "status": "active", + "type": "push" +} diff --git a/spec/mocks/responses/BalancePlatform/finish_sca_device_registration.json b/spec/mocks/responses/BalancePlatform/finish_sca_device_registration.json new file mode 100644 index 00000000..01b85dc8 --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/finish_sca_device_registration.json @@ -0,0 +1,7 @@ +{ + "scaDevice": { + "id": "BSDR42XV3223223S5N6CDQDGH53M8H", + "name": "Device", + "type": "ios" + } +} diff --git a/spec/mocks/responses/BalancePlatform/get_all_sweeps_for_balance_account.json b/spec/mocks/responses/BalancePlatform/get_all_sweeps_for_balance_account.json new file mode 100644 index 00000000..f6da08e8 --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/get_all_sweeps_for_balance_account.json @@ -0,0 +1,31 @@ +{ + "hasNext": false, + "hasPrevious": false, + "sweeps": [ + { + "counterparty": { + "balanceAccountId": "BA3227C223222B5BLP6JQC3FD" + }, + "currency": "EUR", + "id": "SWEP00000000000000000000000001", + "schedule": { + "type": "daily" + }, + "status": "active", + "type": "push" + }, + { + "counterparty": { + "transferInstrumentId": "SE322JV222224D5FJ7QTZ9HVM" + }, + "currency": "EUR", + "id": "SWEP00000000000000000000000002", + "schedule": { + "type": "cron", + "cronExpression": "30 17 * * MON" + }, + "status": "inactive", + "type": "pull" + } + ] +} diff --git a/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedule_by_id.json b/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedule_by_id.json new file mode 100644 index 00000000..32a7ed76 --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedule_by_id.json @@ -0,0 +1,17 @@ +{ + "id": "PSAC00000000000000000000000001", + "balancePlatformPayoutScheduleId": "PSPC00000000000000000000000001", + "balanceAccountId": "BA000000000000000000001", + "transferInstrumentId": "SE00000000000000000000001", + "currency": "EUR", + "reference": "Monthly payout", + "description": "Scheduled payout to merchant bank account", + "referenceForBeneficiary": "PAYOUT-REF-001", + "retainedAmount": 10000, + "minPayoutAmount": 1000, + "maxPayoutAmount": 100000000, + "createdAt": "2024-01-15T10:30:00Z", + "enabled": true, + "frequency": "monthly", + "frequencyValue": 1 +} diff --git a/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedules.json b/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedules.json new file mode 100644 index 00000000..eca2e370 --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedules.json @@ -0,0 +1,26 @@ +{ + "balanceAccountPayoutSchedules": [ + { + "id": "PSAC00000000000000000000000001", + "balancePlatformPayoutScheduleId": "PSPC00000000000000000000000001", + "balanceAccountId": "BA000000000000000000001", + "transferInstrumentId": "SE00000000000000000000001", + "currency": "EUR", + "reference": "Monthly payout", + "description": "Scheduled payout to merchant bank account", + "referenceForBeneficiary": "PAYOUT-REF-001", + "retainedAmount": 10000, + "minPayoutAmount": 1000, + "maxPayoutAmount": 100000000, + "createdAt": "2024-01-15T10:30:00Z", + "enabled": true, + "frequency": "monthly", + "frequencyValue": 1 + } + ], + "link": { + "self": { + "href": "https://balanceplatform-api-test.adyen.com/bcl/v2/balanceAccounts/BA000000000000000000001/payoutSchedules" + } + } +} diff --git a/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedule_by_id.json b/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedule_by_id.json new file mode 100644 index 00000000..da0768a5 --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedule_by_id.json @@ -0,0 +1,27 @@ +{ + "id": "PSPC00000000000000000000000001", + "balancePlatformId": "YOUR_BALANCE_PLATFORM_ID", + "countryCode": "NL", + "currency": "EUR", + "defaultDescription": "Scheduled payout to merchant bank account", + "defaultFrequency": "monthly", + "defaultFrequencyValue": 1, + "defaultReference": "Monthly payout", + "defaultReferenceForBeneficiary": "PAYOUT-REF-001", + "automaticApplication": false, + "enabled": true, + "maxPayoutAmount": 100000000, + "minPayoutAmount": 1000, + "retainedAmount": 10000, + "payoutScheduleDescription": "Standard", + "userSettlementDelay": 2, + "userSettlementTime": { + "hour": 8, + "minute": 0, + "second": 0, + "nano": 0 + }, + "userSettlementTimeZone": "Europe/Amsterdam", + "createdAt": "2024-01-15T10:30:00Z", + "updatedAt": "2024-01-16T14:00:00Z" +} diff --git a/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedules.json b/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedules.json new file mode 100644 index 00000000..e89a5e8d --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedules.json @@ -0,0 +1,31 @@ +{ + "balancePlatformPayoutSchedules": [ + { + "id": "PSPC00000000000000000000000001", + "balancePlatformId": "YOUR_BALANCE_PLATFORM_ID", + "countryCode": "NL", + "currency": "EUR", + "defaultDescription": "Scheduled payout to merchant bank account", + "defaultFrequency": "monthly", + "defaultFrequencyValue": 1, + "defaultReference": "Monthly payout", + "defaultReferenceForBeneficiary": "PAYOUT-REF-001", + "automaticApplication": false, + "enabled": true, + "maxPayoutAmount": 100000000, + "minPayoutAmount": 1000, + "retainedAmount": 10000, + "payoutScheduleDescription": "Standard", + "userSettlementDelay": 2, + "userSettlementTime": { + "hour": 8, + "minute": 0, + "second": 0, + "nano": 0 + }, + "userSettlementTimeZone": "Europe/Amsterdam", + "createdAt": "2024-01-15T10:30:00Z", + "updatedAt": "2024-01-16T14:00:00Z" + } + ] +} diff --git a/spec/mocks/responses/BalancePlatform/get_payout_schedule_executions.json b/spec/mocks/responses/BalancePlatform/get_payout_schedule_executions.json new file mode 100644 index 00000000..a191b150 --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/get_payout_schedule_executions.json @@ -0,0 +1,21 @@ +{ + "payoutScheduleExecutions": [ + { + "id": "PS0000000000001", + "result": "skipped", + "triggeredAt": "2026-03-11T08:00:00Z", + "resultDetails": { + "reasonCode": "noBalanceToPayOut", + "reason": "No balance to pay out" + } + }, + { + "id": "PS0000000000002", + "result": "succeeded", + "triggeredAt": "2026-03-12T08:00:00Z", + "resultDetails": { + "transferId": "A0A0A0A0A0A0A0A0" + } + } + ] +} diff --git a/spec/mocks/responses/BalancePlatform/get_recurring_top_ups.json b/spec/mocks/responses/BalancePlatform/get_recurring_top_ups.json new file mode 100644 index 00000000..3f0ac94c --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/get_recurring_top_ups.json @@ -0,0 +1,35 @@ +{ + "recurringTopUps": [ + { + "id": "TUPC0000000000000000000001", + "counterparty": { + "transferInstrumentId": "SE000000000000000000000001" + }, + "description": "My description", + "topUpAmount": { + "fixed": { + "value": 1000, + "currency": "EUR" + } + }, + "trigger": { + "schedule": { + "type": "weekdays" + }, + "threshold": { + "value": 100, + "currency": "EUR" + } + }, + "status": "active" + } + ], + "link": { + "next": { + "href": "/balanceAccounts/balanceAccount1/recurringTopUps?limit=10&cursor=nextCursorToken" + }, + "previous": { + "href": "/balanceAccounts/balanceAccount1/recurringTopUps?limit=10&cursor=previousCursorToken" + } + } +} diff --git a/spec/mocks/responses/BalancePlatform/get_sweep.json b/spec/mocks/responses/BalancePlatform/get_sweep.json new file mode 100644 index 00000000..fbce8b0c --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/get_sweep.json @@ -0,0 +1,12 @@ +{ + "counterparty": { + "balanceAccountId": "BA3227C223222B5BLP6JQC3FD" + }, + "currency": "EUR", + "id": "SWEP00000000000000000000000001", + "schedule": { + "type": "daily" + }, + "status": "active", + "type": "push" +} diff --git a/spec/mocks/responses/BalancePlatform/submit_sca_association.json b/spec/mocks/responses/BalancePlatform/submit_sca_association.json new file mode 100644 index 00000000..7943ae1e --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/submit_sca_association.json @@ -0,0 +1,10 @@ +{ + "scaAssociations": [ + { + "scaDeviceId": "BSDR11111111111A1AAA1AAAAA1AA1", + "entityType": "accountHolder", + "entityId": "AH00000000000000000000001", + "status": "pendingApproval" + } + ] +} diff --git a/spec/mocks/responses/BalancePlatform/update_balance_account_managed_schedule.json b/spec/mocks/responses/BalancePlatform/update_balance_account_managed_schedule.json new file mode 100644 index 00000000..20ec0081 --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/update_balance_account_managed_schedule.json @@ -0,0 +1,18 @@ +{ + "id": "PSAC00000000000000000000000001", + "balancePlatformPayoutScheduleId": "PSPC00000000000000000000000001", + "balanceAccountId": "BA000000000000000000001", + "transferInstrumentId": "SE00000000000000000000001", + "currency": "EUR", + "reference": "Monthly payout", + "description": "Updated payout description", + "referenceForBeneficiary": "PAYOUT-REF-001", + "retainedAmount": 20000, + "minPayoutAmount": 1000, + "maxPayoutAmount": 100000000, + "createdAt": "2024-01-15T10:30:00Z", + "updatedAt": "2024-01-16T14:00:00Z", + "enabled": false, + "frequency": "monthly", + "frequencyValue": 1 +} diff --git a/spec/mocks/responses/BalancePlatform/update_recurring_top_ups.json b/spec/mocks/responses/BalancePlatform/update_recurring_top_ups.json new file mode 100644 index 00000000..342a55f5 --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/update_recurring_top_ups.json @@ -0,0 +1,23 @@ +{ + "id": "TUPC0000000000000000000001", + "counterparty": { + "transferInstrumentId": "SE000000000000000000000001" + }, + "description": "new description", + "topUpAmount": { + "fixed": { + "value": 1000, + "currency": "EUR" + } + }, + "trigger": { + "schedule": { + "type": "weekdays" + }, + "threshold": { + "value": 100, + "currency": "EUR" + } + }, + "status": "inactive" +} diff --git a/spec/mocks/responses/BalancePlatform/update_sweep.json b/spec/mocks/responses/BalancePlatform/update_sweep.json new file mode 100644 index 00000000..76c4291a --- /dev/null +++ b/spec/mocks/responses/BalancePlatform/update_sweep.json @@ -0,0 +1,12 @@ +{ + "counterparty": { + "balanceAccountId": "BA3227C223222B5BLP6JQC3FD" + }, + "currency": "EUR", + "id": "SWEP00000000000000000000000001", + "schedule": { + "type": "weekly" + }, + "status": "inactive", + "type": "push" +}