Skip to main content

Sincpro Payments SDK

SDK para integración con pasarelas de pago y servicios bancarios, construido sobre el Sincpro Framework con arquitectura hexagonal.


Bounded Contexts

cybersource — Pagos con tarjeta (Cybersource)

Proveedor: Cybersource / Linkser

Use case Command
Tokenizar tarjeta CommandCreatePaymentMethod
Tokenizar tarjeta + cliente CommandCreateCustomerPaymentMethod
Pago tarjeta nueva (enrollment) CommandPayNewCardEnrollment
Pago tarjeta nueva (validación) CommandPayNewCardValidation
Pago tarjeta guardada (enrollment) CommandPaySavedCardEnrollment
Pago tarjeta guardada (validación) CommandPaySavedCardValidation
Pago recurrente CommandRecurringPayment
Cancelar / reembolso CommandCancelOrRefund
Pre-pago: setup auth CommandSetupAuth
Pre-pago: iniciar monitor CommandStartMonitorAuth
Pre-pago: verificar 3DS CommandCheckRequireAuth
Pre-pago: validar auth CommandValidateAuth
from sincpro_payments_sdk.apps.cybersource import cybersource, tokenization

result = cybersource(
    tokenization.CommandCreatePaymentMethod(...),
    tokenization.ResponseCreatePaymentMethod,
)

qr — Pagos QR

Tres proveedores bajo el mismo bounded context:

BNB

Use case Command
Autenticar CommandAuthenticateBNB
Crear QR CommandCreateQR
Verificar estado CommandCheckQRStatus
Listar QRs CommandListQRs
Cancelar QR CommandCancelQR

Banco Económico

Use case Command
Autenticar CommandAuthenticateEconomico
Crear QR CommandCreateQR
Verificar estado CommandCheckQRStatus
QRs cobrados CommandGetPaidQRs
Cancelar QR CommandCancelQR

Linkser

Use case Command
Crear QR CommandCreateQR
Verificar estado CommandCheckQRStatus
from sincpro_payments_sdk.apps.qr import qr, economico, bnb, linkser

auth = qr(
    economico.CommandAuthenticateEconomico(user_name="...", password="...", aes_key="..."),
    economico.ResponseAuthenticateEconomico,
)
qr_image = qr(economico.CommandCreateQR(...), economico.ResponseCreateQR)

bank_account — Extractos bancarios

Dos proveedores bajo el mismo bounded context:

Banco Económico

Use case Command
Autenticar CommandAuthenticateEconomico
Consultar movimientos CommandGetMovements
from sincpro_payments_sdk.apps.bank_account import bank_account, economico

auth = bank_account(
    economico.CommandAuthenticateEconomico(user_name="...", password="...", aes_key="..."),
    economico.ResponseAuthenticateEconomico,
)
movements = bank_account(
    economico.CommandGetMovements(account_code="...", start_date=..., end_date=...),
    economico.ResponseGetMovements,
)

BNB

Use case Command
Autenticar CommandAuthenticateBnb
Últimos 30 movimientos CommandGetStatement
Extracto histórico CommandGetHistoricalStatement
from datetime import date

from sincpro_payments_sdk.apps.bank_account import bank_account, bnb
from sincpro_payments_sdk.apps.bank_account.domain import BNBProductType

auth = bank_account(
    bnb.CommandAuthenticateBnb(account_id="...", auth_id="..."),
    bnb.ResponseAuthenticateBnb,
)
last_movements = bank_account(
    bnb.CommandGetStatement(
        account_number=2000050000, product_type=BNBProductType.CUENTA_CORRIENTE
    ),
    bnb.ResponseGetStatement,
)
historical = bank_account(
    bnb.CommandGetHistoricalStatement(
        account_number=2000050000,
        initial_date=date(2026, 1, 1),
        final_date=date(2026, 1, 31),
    ),
    bnb.ResponseGetHistoricalStatement,
)

pos — Cobros con tarjeta en terminal POS

Un submódulo por vendor. Para sumar un vendor nuevo se agrega su carpeta sin tocar los existentes.

Linkser

Use case Command
Cobrar en el terminal CommandChargeLinkser

Cada cobro indica el terminal al que va: terminal lleva la URL de ese POS (http://IP:8000; también acepta dominio o https). Un cliente con 25 terminales usa la misma llamada con distinta IP. La espera máxima es de 250 segundos, como pide Linkser desde que el mismo cobro se puede pagar con QR Simple, QR Pix o Tigo Money (POS versión 01_27_250702 o superior).

from decimal import Decimal

from sincpro_payments_sdk.apps.common.domain import CurrencyType
from sincpro_payments_sdk.apps.pos import TerminalEndpoint, linkser, pos

result = pos(
    linkser.CommandChargeLinkser(
        terminal=TerminalEndpoint(url="http://192.168.1.50:8000"),  # IP, dominio o https
        importe=Decimal("47.85"),
        moneda=CurrencyType.BOB,
    ),
    linkser.ResponseChargeLinkser,
)
if result.autorizado:
    print(result.autorizacion, result.pan, result.codigo_terminal)

autorizado es True solo cuando la respuesta del terminal es 00. Un rechazo no lanza excepción: llega como resultado. Terminal apagado o sin respuesta en 250 s: SincproServiceUnavailableError.

pan depende de cómo pagó el cliente: tarjeta enmascarada (215141XXXXXX2548), PAN de la tarjeta Dami en QR Simple, número de teléfono en Tigo Money o alias del QR en Pix.

Métricas: payment_pos.charge_linkser.importe separa el monto por moneda y por autorizado, para que un rechazo no se cuente como dinero cobrado.


Documentación

Documentación detallada de DTOs, Features y Application Services disponible en generated_docs/site/index.html.

Para regenerar:

make docs

Desarrollo

make install          # instalar dependencias
make format           # formatear código (obligatorio antes de commit)
make test             # ejecutar tests
make test_one t=<archivo>  # test específico

Metadata

Release files for sincpro-payments-sdk 6.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sincpro-payments-sdk 6.1.0
File Size Uploaded Provenance Actions
sincpro_payments_sdk-6.1.0.tar.gz 80.9 kB Without provenance Details for sincpro_payments_sdk-6.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sincpro-payments-sdk 6.1.0
File Interpreter ABI Platform Actions
sincpro_payments_sdk-6.1.0-py3-none-any.whl Python 3 none any Details for sincpro_payments_sdk-6.1.0-py3-none-any.whl

Total release size: 208.9 kB

Release files / sincpro_payments_sdk-6.1.0.tar.gz

Download URL sincpro_payments_sdk-6.1.0.tar.gz
Size 80.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e3d8440583b878f040f348235aeb808d1055aa1f28bac4d85eea39e08d39e6fc
BLAKE2b-256 checksum
How to use checksums
58f4415e02f56552c75468ed4a0fee461ef954903e48556ae482c031596073eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.3 Linux/7.0.0-38-generic

Release files / sincpro_payments_sdk-6.1.0-py3-none-any.whl

Download URL sincpro_payments_sdk-6.1.0-py3-none-any.whl
Size 127.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
765e1e6c4bd03e44ae0b781ba6c61ff413ba470397e82e6e3390028d96cd5c18
BLAKE2b-256 checksum
How to use checksums
59b87dca3474757a075c5595ef968f5bf0f6e2bdd399ad4e30babcbbb89bf036
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.3 Linux/7.0.0-38-generic

Security for sincpro-payments-sdk 6.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

6.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page