Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ RSpec/MultipleMemoizedHelpers:
Max: 7

RSpec/Rails/HaveHttpStatus:
Enabled: false
Enabled: false

Metrics/ModuleLength:
Exclude:
- "spec/fixtures/**/*"
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions lib/boapi/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/boapi/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Boapi
VERSION = '0.13.0'
VERSION = '0.14.0'
end
33 changes: 33 additions & 0 deletions spec/boapi/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
43 changes: 35 additions & 8 deletions spec/fixtures/transaction_fixtures.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

# rubocop:disable Metrics/MethodLength
module TransactionFixtures
module_function

Expand All @@ -22,11 +23,13 @@ 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',
Expand All @@ -40,13 +43,11 @@ def successful_transactions_list_response_message
'type' => 'tokenization', 'uid' => 'a1b993aa-d340-4d52-a0ce-92e5a30ab6a6' }
] }
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' => [
Expand All @@ -70,13 +71,39 @@ 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

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

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',
Expand All @@ -100,9 +127,9 @@ 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
Loading