openhub-bo-fx
Cobros QR con conversión de moneda vía Red Enlace (ATC) OpenHub, Bolivia:
- PIX: el pagador (Brasil) paga en BRL; tú recibes BOB/USD.
- Activos virtuales (Koibanx): liquidación en USDT/USDC.
- Binance Pay.
pip install openhub-bo[fx]
Requiere que ATC habilite cada producto para tu comercio. Si no lo está, OpenHub responde
ApiErrorcon códigoGQ-00005(PIX),GQ-00006(Koibanx) oGQ-00000(Binance). Las validaciones y los errores están verificados en el sandbox; el caso exitoso sigue la documentación de ATC.
Uso
from openhub_bo.core import Session, Webhook
from openhub_bo.fx import Glosa, PixClient, VirtualAssetsClient, BinanceClient, VirtualAsset
webhook = Webhook(url="https://mitienda.bo/webhooks/fx", value="<secreto-largo-aleatorio>")
glosa = Glosa("1", "Tienda Central", "7011", "Pedido 42") # sucursal|nombre|rubro|descripción
with Session("CLIENT_ID", "CLIENT_SECRET") as session:
pix = PixClient(session)
qr = pix.generate_qr(
amount="145.00",
glosa=glosa,
reference="1042",
payer_cpf="12345678901",
payer_phone="+5511999999999", # + y 13 dígitos
webhook=webhook,
expires_in=600,
)
print(qr.converted_amount, qr.converted_currency) # lo que paga el cliente en BRL
html = f'<img src="{qr.data_uri}">'
pix.get_status(qr.reference)
pix.cancel(qr.reference) # en sandbox solo aplica a QR pagados (devolución)
crypto = VirtualAssetsClient(session).generate_qr(
amount="50",
glosa=glosa,
reference="1043",
asset=VirtualAsset.USDT,
webhook=webhook,
expires_in=180, # mínimo Bs 50; vigencia 180..600 s
)
binance = BinanceClient(session).generate_qr(
amount="10",
glosa=glosa,
reference="1044",
webhook=webhook,
expires_in=300,
)
Async: AsyncPixClient, AsyncVirtualAssetsClient, AsyncBinanceClient con AsyncSession.
Webhooks
from openhub_bo.fx import parse_binance_webhook, parse_fx_webhook
n = parse_binance_webhook(headers, body, webhook=webhook)
return JSONResponse(n.ack) # Binance exige esta respuesta con HTTP 200
n = parse_fx_webhook(headers, body, webhook=webhook) # PIX / Koibanx (payload no documentado)
n.payload # cuerpo completo; confirma siempre con get_status
Tests sin red
openhub_bo.fx.testing.MockFx simula los tres productos, con las reglas y errores del
sandbox, pay(reference) y disable("pix") para simular un comercio no habilitado.
Metadata
Release files for openhub-bo-fx 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openhub_bo_fx-0.1.0.tar.gz | 57.8 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| openhub_bo_fx-0.1.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| openhub_bo_fx-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ x86-64 | Details |
| openhub_bo_fx-0.1.0-cp310-abi3-musllinux_1_2_aarch64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ ARM64 | Details |
| openhub_bo_fx-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| openhub_bo_fx-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| openhub_bo_fx-0.1.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| openhub_bo_fx-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 3.8 MB
Release files / openhub_bo_fx-0.1.0.tar.gz
| Download URL | openhub_bo_fx-0.1.0.tar.gz |
|---|---|
| Size | 57.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e16a46d48abc866651cb3cdbf16b4506ce97f32bc601e549c3412de27347075e
|
|
BLAKE2b-256 checksum How to use checksums |
dec8dbca69fd586ade6487eb68246752cde88bec13026df19759e60a6bb62840
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / openhub_bo_fx-0.1.0-cp310-abi3-win_amd64.whl
| Download URL | openhub_bo_fx-0.1.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 366.7 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
46fe44f2610db5257257d405f952e3548fc028e79bb939f2d5e44f6f653e4693
|
|
BLAKE2b-256 checksum How to use checksums |
a8c9f32febcd5e8b9e31cf8c4bd3e088a56b5b3178cd7c6f153f37ebb8ef4397
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / openhub_bo_fx-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | openhub_bo_fx-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 720.9 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
54e9fbd2cd5f9757306c9ac48c0ab5efbc05ae5b362bcf42f4716d2af78b8876
|
|
BLAKE2b-256 checksum How to use checksums |
47cb85bf084e9c7c5038719d6188164aecd80af69ac46e3312b87e63efb1cde6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / openhub_bo_fx-0.1.0-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | openhub_bo_fx-0.1.0-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 683.2 kB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d68934544987e8390f90c86ae725912fb50ea23fcc1b26aedc65c558b30744af
|
|
BLAKE2b-256 checksum How to use checksums |
18b1a0ee85ca81f933f0e9059f66aeb5aab213c20c8b091b1d7ac0b187572dae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / openhub_bo_fx-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | openhub_bo_fx-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 517.3 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
9bd4d5fd028a277e9a15a765b3ca908a38f4b688c2a5ad1ca7ec8a5816ee0a97
|
|
BLAKE2b-256 checksum How to use checksums |
b389a0a4cc1e6a206cf9a776325ccfe22d0f9c437d462d4dc7fa2c036b486117
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / openhub_bo_fx-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | openhub_bo_fx-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 512.7 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
96f0bc77dfdc4378879e63fa7f8ba49ff4e7e8735b6572cf3e3528888ab8f91c
|
|
BLAKE2b-256 checksum How to use checksums |
f3a2f2d0f11083f71d3642070e5388b8cf390a563b0399ca7455da7993c3cdb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / openhub_bo_fx-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | openhub_bo_fx-0.1.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 463.6 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
51ac9bb5d2b4fcc729268e33bb256ccd268055c1ac5b38b43f8afa92aec95f0a
|
|
BLAKE2b-256 checksum How to use checksums |
c8fe3c953b4189755bab222e959eabf5ff3965cf78e41bacca4ee6eb35a74bb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / openhub_bo_fx-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | openhub_bo_fx-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 469.5 kB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
90a4382e65eefd79ccbd51a1d754eacb33f9ebed106643095820c95da0125595
|
|
BLAKE2b-256 checksum How to use checksums |
e8c2abe0730e5fe5668a732fe63c2fb4faaf06fe8c1bdbfd37642d1fc39efe18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency log