From bd1e3e79047d6dad1827f88d50d1591fd9df0678 Mon Sep 17 00:00:00 2001 From: Grigoriy Antonov Date: Fri, 11 Jul 2025 16:42:57 +0300 Subject: [PATCH 1/4] BOAPI-629 add uids_export --- CHANGELOG.md | 6 +++- lib/boapi/client.rb | 4 +++ spec/boapi/client_spec.rb | 33 ++++++++++++++++++++++ spec/fixtures/transaction_fixtures.rb | 40 +++++++++++++++++++++++++-- 4 files changed, 79 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf08b64..9ca2c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ ## [Released] -## [0.13.0] - 2025-08-1 +## [0.14.0] - 2026-03-18 + +- Add uids_export request + +## [0.13.0] - 2025-08-01 - Add aggregation request diff --git a/lib/boapi/client.rb b/lib/boapi/client.rb index e547255..794512d 100644 --- a/lib/boapi/client.rb +++ b/lib/boapi/client.rb @@ -41,6 +41,10 @@ def transactions_export(params) send_request(:post, '/api/v2/transactions/export', params) end + def transactions_uids_export(params) + send_request(:post, '/api/v2/transactions/uids_export', params) + end + def psp_balances(params) send_request(:post, '/api/v2/psp/balances', params) end diff --git a/spec/boapi/client_spec.rb b/spec/boapi/client_spec.rb index 2417709..9034be2 100644 --- a/spec/boapi/client_spec.rb +++ b/spec/boapi/client_spec.rb @@ -173,6 +173,39 @@ end end + describe '.transactions_uids_export' do + let(:response) do + Boapi::Client.new(account_id: account_id, account_secret: account_secret).transactions_uids_export(params) + end + + let(:url) { "#{Boapi.configuration.api_host}/api/v2/transactions/uids_export" } + + context 'when valid params given' do + let(:params) do + { + response_parameters: 'main', + filter: { + uids: ['2362e0a1-6b5c-4128-9169-8a02122965b9'] + } + } + end + let(:http_status) { 200 } + + before do + stub_request(:post, url) + .to_return(status: http_status, body: TransactionFixtures.successful_transactions_uids_export_response) + end + + it 'returns successful response' do + expect(response.status).to be http_status + + expect(response.success?).to be true + expect(response.error?).to be false + expect(response.data).to eq(TransactionFixtures.successful_transactions_uids_export_response_message) + end + end + end + describe '.transactions_search' do let(:response) do Boapi::Client.new(account_id: account_id, account_secret: account_secret).transactions_search(params) diff --git a/spec/fixtures/transaction_fixtures.rb b/spec/fixtures/transaction_fixtures.rb index 084bcd9..e280af6 100644 --- a/spec/fixtures/transaction_fixtures.rb +++ b/spec/fixtures/transaction_fixtures.rb @@ -25,9 +25,9 @@ def failed_transactions_count_response # rubocop:disable Metrics/MethodLength def successful_transactions_list_response_message { 'pagination' => { - 'date_from' => '2023-02-20T09:02:54.516000Z', 'date_to' => '2023-02-20T11:13:43.748000Z', - 'date_type' => 'created_at', 'has_next_page' => true, 'next_date' => '2023-02-20T11:21:05.639000Z' - }, + 'date_from' => '2023-02-20T09:02:54.516000Z', 'date_to' => '2023-02-20T11:13:43.748000Z', + 'date_type' => 'created_at', 'has_next_page' => true, 'next_date' => '2023-02-20T11:21:05.639000Z' + }, 'transactions' => [ { 'amount' => 200, 'created_at' => '2023-02-20T09:02:54.516000Z', 'currency' => 'BYN', 'merchant_id' => 55, 'paid_at' => '2023-02-20T09:02:59.669000Z', 'shop_id' => 296, @@ -40,6 +40,7 @@ def successful_transactions_list_response_message 'type' => 'tokenization', 'uid' => 'a1b993aa-d340-4d52-a0ce-92e5a30ab6a6' } ] } end + # rubocop:enable Metrics/MethodLength def successful_transactions_list_response @@ -70,6 +71,38 @@ def successful_transactions_export_response_message } } end + + # rubocop:enable Metrics/MethodLength + + def successful_transactions_uids_export_response + %({"data":#{successful_transactions_uids_export_response_message.to_json}}) + end + + # rubocop:disable Metrics/MethodLength + def successful_transactions_uids_export_response_message + [ + { + 'amount' => 123, + 'closed_at' => nil, + 'code' => 'S.0000', + 'created_at' => '2025-06-19T10:47:19.959000Z', + 'currency' => 'BYN', + 'description' => 'Transaction with test flag', + 'expired_at' => nil, + 'fraud' => '', + 'friendly_message' => 'The transaction is successfully processed.', + 'language' => 'en', + 'manually_corrected_at' => nil, + 'merchant_id' => 222, + 'message' => 'Transaction is successful.', + 'paid_at' => nil, + 'type' => 'fraud_advice', + 'uid' => '2362e0a1-4444-3333-2222-8a02222965b9', + 'updated_at' => '2025-06-19T10:47:20.082000Z' + } + ] + end + # rubocop:enable Metrics/MethodLength def successful_transactions_export_response @@ -100,6 +133,7 @@ def successful_preadjustments_surcharges_max_response_message } } end + # rubocop:enable Metrics/MethodLength def successful_preadjustments_surcharges_max_response From d42f4499396f0495dc52b172e23645c6a34d794f Mon Sep 17 00:00:00 2001 From: IvanChibisov Date: Wed, 4 Mar 2026 16:06:27 +0300 Subject: [PATCH 2/4] Update version --- lib/boapi/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/boapi/version.rb b/lib/boapi/version.rb index 1fcd357..cd97221 100644 --- a/lib/boapi/version.rb +++ b/lib/boapi/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Boapi - VERSION = '0.13.0' + VERSION = '0.14.0' end From f9ccad4e69899ddc690c15dd5c093b4ea52dc1b3 Mon Sep 17 00:00:00 2001 From: Sergey Karpuk Date: Wed, 18 Mar 2026 18:00:36 +0300 Subject: [PATCH 3/4] update lock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index bf27078..8ed5975 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - boapi (0.12.0) + boapi (0.14.0) faraday (> 0.7.6, < 1.0) faraday_middleware (> 0.1, < 1.0) From 65f6923a000a1c7964a09fb2b0821c390a279f56 Mon Sep 17 00:00:00 2001 From: Sergey Karpuk Date: Wed, 18 Mar 2026 18:11:30 +0300 Subject: [PATCH 4/4] fix lint --- .rubocop.yml | 6 +++++- spec/fixtures/transaction_fixtures.rb | 23 ++++++++--------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index f4ae116..d0e4eb6 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -26,4 +26,8 @@ RSpec/MultipleMemoizedHelpers: Max: 7 RSpec/Rails/HaveHttpStatus: - Enabled: false \ No newline at end of file + Enabled: false + +Metrics/ModuleLength: + Exclude: + - "spec/fixtures/**/*" diff --git a/spec/fixtures/transaction_fixtures.rb b/spec/fixtures/transaction_fixtures.rb index e280af6..dd371ea 100644 --- a/spec/fixtures/transaction_fixtures.rb +++ b/spec/fixtures/transaction_fixtures.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +# rubocop:disable Metrics/MethodLength module TransactionFixtures module_function @@ -22,12 +23,14 @@ def failed_transactions_count_response %({"error":#{failed_transactions_count_response_message.to_json}}) end - # rubocop:disable Metrics/MethodLength def successful_transactions_list_response_message { 'pagination' => { - 'date_from' => '2023-02-20T09:02:54.516000Z', 'date_to' => '2023-02-20T11:13:43.748000Z', - 'date_type' => 'created_at', 'has_next_page' => true, 'next_date' => '2023-02-20T11:21:05.639000Z' - }, + 'date_from' => '2023-02-20T09:02:54.516000Z', + 'date_to' => '2023-02-20T11:13:43.748000Z', + 'date_type' => 'created_at', + 'has_next_page' => true, + 'next_date' => '2023-02-20T11:21:05.639000Z' + }, 'transactions' => [ { 'amount' => 200, 'created_at' => '2023-02-20T09:02:54.516000Z', 'currency' => 'BYN', 'merchant_id' => 55, 'paid_at' => '2023-02-20T09:02:59.669000Z', 'shop_id' => 296, @@ -41,13 +44,10 @@ def successful_transactions_list_response_message ] } end - # rubocop:enable Metrics/MethodLength - def successful_transactions_list_response %({"data":#{successful_transactions_list_response_message.to_json}}) end - # rubocop:disable Metrics/MethodLength def successful_transactions_export_response_message { 'transactions' => [ @@ -72,13 +72,10 @@ def successful_transactions_export_response_message } end - # rubocop:enable Metrics/MethodLength - def successful_transactions_uids_export_response %({"data":#{successful_transactions_uids_export_response_message.to_json}}) end - # rubocop:disable Metrics/MethodLength def successful_transactions_uids_export_response_message [ { @@ -103,13 +100,10 @@ def successful_transactions_uids_export_response_message ] end - # rubocop:enable Metrics/MethodLength - def successful_transactions_export_response %({"data":#{successful_transactions_export_response_message.to_json}}) end - # rubocop:disable Metrics/MethodLength def successful_preadjustments_surcharges_max_response_message { 'code' => 'S.0000', @@ -134,9 +128,8 @@ def successful_preadjustments_surcharges_max_response_message } end - # rubocop:enable Metrics/MethodLength - def successful_preadjustments_surcharges_max_response %({"data":#{successful_preadjustments_surcharges_max_response_message.to_json}}) end end +# rubocop:enable Metrics/MethodLength