Skip to content

Latest commit

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Regalii Python Client

A Python HTTP client for consuming Regalii's API. The full API docs:

Installation

Add this line to your application's requirements.txt file:

git+https://github.com/regalii/regaliator_python.git

Configuration

First of all, you need a Configuration instance:

fromregalii.configurationimportConfigurationconfig=Configuration(
# Authentication settings'your-api-key',
'your-secret-key'',
# API host settings'api.casiregalii.com',
timeout=30,
use_ssl=True,
# Proxy settingsproxy_host=None,
proxy_port=None,
proxy_user=None,
proxy_pass=None,
# Version targetversion='3.2')

Versions

The available versions are: 1.5, 3.0, 3.1 and 3.2 (recommended).

Requests

Success:

>r=Regaliator(config)
>response=r.bill.show(1)>response.success()
=>True>response.data()
=> {...}
> response=r.bill.pay(1,{'amount': 13.0,'currency': 'MXN'})
> response.success()=>True
> response.data()=>{...}

Failure:

> response=r.bill.pay(1,{'amount': 0.0,'currency': 'MXN'})
> response.success()=>False
> response.data()=>{"code": "R3","message": "Invalid Payment Amount"}

Examples

The following examples will show how to use the Regaliator to connect to the different Regalii API endpoints.

Billers List

https://www.regalii.com/billers/utilities

response=r.biller.utilities()

Tests

To run the tests, run:

$ python setup.py test

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

26 watching

Forks

Releases

Packages

Contributors

Languages