Metadata-Version: 2.1
Name: stpmex
Version: 3.5.2
Summary: Client library for stpmex.com
Home-page: https://github.com/cuenca-mx/stpmex-python
Author: Cuenca
Author-email: dev@cuenca.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: cryptography (==2.9.2)
Requires-Dist: cuenca-validations (==0.2.4)
Requires-Dist: requests (==2.24.0)
Provides-Extra: test
Requires-Dist: black (==19.10b0) ; extra == 'test'
Requires-Dist: isort[pipfile] (==4.3.21) ; extra == 'test'
Requires-Dist: flake8 (==3.8.3) ; extra == 'test'
Requires-Dist: mypy (==0.782) ; extra == 'test'
Requires-Dist: pytest (==5.4.3) ; extra == 'test'
Requires-Dist: pytest-vcr (==1.0.2) ; extra == 'test'
Requires-Dist: pytest-cov (==2.10.0) ; extra == 'test'
Requires-Dist: requests-mock (==1.8.0) ; extra == 'test'

# STP python3.6+ client library


[![test](https://github.com/cuenca-mx/stpmex-python/workflows/test/badge.svg)](https://github.com/cuenca-mx/stpmex-python/actions?query=workflow%3Atest)
[![codecov](https://codecov.io/gh/cuenca-mx/stpmex-python/branch/master/graph/badge.svg)](https://codecov.io/gh/cuenca-mx/stpmex-python)
[![PyPI](https://img.shields.io/pypi/v/cuenca.svg)](https://pypi.org/project/cuenca/)

Cliente para el servicio REST de STP


## Requerimientos

Python v3.6 o superior.

## Documentación de API

[General](https://stpmex.zendesk.com/hc/es) y
[WADL](https://demo.stpmex.com:7024/speidemows/rest/application.wadl?metadata=true&detail=true)

## Instalación

```
pip install stpmex
```

## Correr pruebas

```
make venv
source venv/bin/activate
make test
```

## Uso básico

```python
from stpmex import Client

client = Client(
    empresa='TU_EMPRESA',
    priv_key='PKEY_CONTENIDO',
    priv_key_passphrase='supersecret',
)

cuenta = client.cuentas.alta(
    nombre='Eduardo',
    apellidoPaterno='Salvador',
    apellidoMaterno='Hernández',
    rfcCurp='SAHE800416HDFABC01',
    cuenta='646180110400000007',
)

orden = client.ordenes.registra(
    monto=1.2,
    cuentaOrdenante=cuenta.cuenta,
    nombreBeneficiario='Ricardo Sanchez',
    cuentaBeneficiario='072691004495711499',
    institucionContraparte='40072',
    conceptoPago='Prueba',
)

# Saldo
saldo = client.saldos.consulta(cuenta='646456789123456789')

# Ordenes - enviadas
enviadas = client.ordenes.consulta_enviadas() # fecha_operacion es el día de hoy

# Ordenes - recibidas
recibidas = client.ordenes.consulta_recibidas(
    fecha_operacion=datetime.date(2020, 4, 20)
)

# Orden - consulta por clave rastreo
orden = client.ordenes.consulta_clave_rastreo(
    claveRastreo='CR1234567890',
    institucionOperante=90646,
    fechaOperacion=datetime.date(2020, 4, 20)
)
```


