Skip to content

[BA-8916] Add transfer batches support to fintoc-ruby - #35

Merged
SimonOyaneder merged 6 commits into
mainfrom
ba-8916-ruby-transfer-batches-support
Oct 23, 2026
Merged

SimonOyaneder merged 6 commits into
mainfrom
ba-8916-ruby-transfer-batches-support

Conversation

@SimonOyaneder

@SimonOyaneder SimonOyaneder commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Contexto

La API pública va a exponer transfer batches (/v2/transfer_batches) y el SDK de Ruby todavía no los soporta.

Que hay de nuevo?

  • client.v2.transfer_batches con create, get y list, que devuelven Fintoc::V2::TransferBatch (con refresh y predicados de status). Los montos son amount y settled_amount, como en transfers, y trae succeeded_at y partially_succeeded_at.
  • 5 clases de error que puede devolver el endpoint: InvalidTransfersError, InvalidTransfersSizeError, InvalidDescriptionSizeError, InvalidSenderAccountsError y OperationNotImplementedError. El SDK resuelve la clase por el code, sin ellas tiraba NameError.
  • Sección de transfer batches en el README.

Tests

  • Tests unitarios del resource y del manager.
  • Tests del client con VCR.

Safety Checks

  • Versión y CHANGELOG actualizados (si corresponde)

Consideraciones

  • /v2/transfer_batches ya está en main en fintoc-rails (BA-8905) y en sandbox (BA-8915).
  • Los cassettes VCR están hechos a mano con la forma actual del serializer de pacioli.

@SimonOyaneder SimonOyaneder self-assigned this Oct 22, 2026
@fin-hermes fin-hermes Bot added the size/XL label Oct 22, 2026
@SimonOyaneder
SimonOyaneder marked this pull request as ready for review October 22, 2026 20:38

def to_s
amount_str = Money.from_cents(@transfer_amount, @currency).format
"📦 #{amount_str} (#{@id}) - #{@status}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usamos emoticones en otra parte? no sea que rompa alguna integración

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sii en el sdk se usan jaja nose porque pero seguí el patrón nomas

RSpec.shared_examples 'a client with transfer batches manager' do
let(:jws_private_key) do
key_string = "-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDNLwwQr/uFToDH

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

porque necesitamos este JWT? contra que es validado?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

el POST de batches exige Fintoc-JWS-Signature igual que el de transfers, entonces el client lo firma con la llave que le pasas. En el spec es una llave de prueba pa que se pueda generar el header, nadie la valida por que VCR matchea solo method, uri y body. Es la misma que usan los examples de transfers y account verifications

@rodrigoguerra-fintoc rodrigoguerra-fintoc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solo esos dos comentarios que si son inválidos esta ok

@SimonOyaneder
SimonOyaneder merged commit ceb2cae into main Oct 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants