Repository navigation
[ONB-4066] Paridad con la API pública - #135
Merged
Merged
Conversation
FranciscaOtero
force-pushed
the
compose/paridad-api-publica-4b8c
branch
from
October 28, 2026 15:58
18c01df to
53f2945
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds charges update and cancel, institutions list, invoices get, link intents create, links exchange, payouts list, get and resources, refunds voucher URL and tax statements list and get. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds events list and get, entities settlement account, onboarding append and delete document, invoices create, update, finalize, mark_uncollectible, pay and void, payment intents check eligibility, cancel and voucher URL, products update, setup intents get, subscriptions detach payment method and transfers receipt. Moves the multipart file payload builder to utils so other managers can reuse it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Creating a payment method is sent as multipart/form-data, with nested fields encoded with brackets and the consent documents as files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without a filename, Rack parses the multipart part as a string, so the API rejects payment method consent documents and onboarding documents passed as objects like io.BytesIO. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FranciscaOtero
force-pushed
the
compose/paridad-api-publica-4b8c
branch
from
October 28, 2026 16:13
53f2945 to
cc2b684
Compare
FranciscaOtero
marked this pull request as ready for review
October 28, 2026 16:50
too-many-arguments is already disabled in .pylintrc, and the duplicate-code disables in the payouts and subscriptions managers are no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tlarrain
approved these changes
Oct 28, 2026
Actions created through _create(path_=...) objetized the resource with
the action URL as its path, so calling update() or delete() on the
result hit URLs like v2/subscriptions/{id}/cancel/{id}. This removes the
protected-access patches in charges and invoices.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FranciscaOtero
force-pushed
the
compose/paridad-api-publica-4b8c
branch
from
October 29, 2026 18:27
3f8085d to
6a09cd8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
El SDK estaba atrasado respecto de la API pública: le faltaban 33 de las 143 operaciones públicas de los specs OpenAPI de
fintoc-docs(main-api.jsonycore-api.json). Este PR agrega las 33. Con eso el SDK cubre todo el spec público.El inventario del SDK se armó llamando cada método de cada manager contra un HTTP mockeado y registrando el método y el path (no a partir del README). No encontré operaciones que el SDK ya tuviera con un método HTTP distinto al del spec.
Operaciones que faltaban
Implementé todas. No dejé ninguna fuera.
v1
PATCH /v1/charges/{id}:charges.updatePOST /v1/charges/{id}/cancel:charges.cancelGET /v1/institutions:institutions.listGET /v1/invoices/{id}:invoices.get(también desdelink.invoices)POST /v1/link_intents:link_intents.createGET /v1/links/exchange:links.exchange. El link que devuelve ya trae sulink_tokenpara pedir sus recursos.GET /v1/payouts:payouts.listGET /v1/payouts/{id}:payouts.getGET /v1/payouts/{id}/resources:payouts.resources.list. Devuelve payment intents, charges o refunds según elresource_type.GET /v1/refunds/{id}/voucher_url:refunds.voucher_urlGET /v1/tax_statements:tax_statements.list(también desdelink.tax_statements)GET /v1/tax_statements/{id}:tax_statements.getv2
POST /v2/entities/{entity_id}/onboardings/{id}/documents/{slot_key}:entities.onboardings.append_documentDELETE /v2/entities/{entity_id}/onboardings/{id}/documents/{slot_key}/{document_id}:entities.onboardings.delete_documentGET /v2/entities/{id}/settlement_account:entities.settlement_accountGET /v2/events:events.listGET /v2/events/{id}:events.getPOST /v2/invoices:invoices.createPATCH /v2/invoices/{id}:invoices.updatePOST /v2/invoices/{id}/finalize:invoices.finalizePOST /v2/invoices/{id}/mark_uncollectible:invoices.mark_uncollectiblePOST /v2/invoices/{id}/pay:invoices.payPOST /v2/invoices/{id}/void:invoices.voidPOST /v2/payment_intents/check_eligibility:payment_intents.check_eligibilityPOST /v2/payment_intents/{id}/cancel:payment_intents.cancelGET /v2/payment_intents/{id}/voucher_url:payment_intents.voucher_urlPOST /v2/payment_methods:payment_methods.create, comomultipart/form-data. Los campos anidados van con corchetes y los documentos de consentimiento se pueden pasar como path o como archivo.POST /v2/payment_methods/{id}/cancel:payment_methods.cancelGET /v2/payment_methods/{id}/mandate_document:payment_methods.mandate_documentPATCH /v2/products/{id}:products.updateGET /v2/setup_intents/{id}:setup_intents.getDELETE /v2/subscriptions/{id}/payment_method:subscriptions.detach_payment_methodGET /v2/transfers/{id}/receipt:transfers.receiptOperaciones del SDK que no están en el spec
No las toqué:
POST /v1/checkout_sessionsGET /v1/checkout_sessions/{id}POST /v1/checkout_sessions/{id}/expirePOST /v1/payment_intents/check_eligibility(el spec la define solo en v2)Consideraciones
payment_methods.createcodifica los campos anidados con corchetes (mx_direct_debit[consent_documents][contract]). El spec usa esa notación para los documentos, pero no lo dice explícitamente para el resto de los campos anidados.add_lines,remove_lines(invoices v2) ycancel(subscriptions v2) devuelven un recurso cuyoupdate()apunta a la URL de la acción. Esto ya pasaba en subscriptions, y ahora también en invoices porque se puede actualizar. Las acciones nuevas no tienen este problema. Lo dejé para un PR aparte.Tests
update()después de las acciones.Requirements
None.
Additional changes
RefundyProduct(v2) se exportan como recursos. Antes los refunds y los productos se devolvían como recurso genérico.🤖🐙 Created with Compose · Spawned by session ff794820617cf95ab458daf6f1d93c8f for Francisca Otero (francisca.otero@fintoc.com) · Requested from the web · View session