No project description provided
Project description
Arteria – Python client library
Read arteria docs for all integartion details.
Installation
pip install arteria-python
Authentication
To configure manually your credentials:
import cuenca
ARTERIA_API_KEY = 'PKxxxx'
ARTERIA_API_SECRET= 'yyyyyy'
cuenca.configure(api_key=ARTERIA_API_KEY, api_secret=ARTERIA_API_SECRET)
Transfers
Create transfer
import arteria
arteria.configure(sandbox=True) # if using sandbox
local_transfer_id = '078efdc20bab456285437309c4b75673'
transfer = arteria.Transfer.create(
recipient_name='Benito Juárez',
account_number='646180157042875763', # CLABE or card number
amount=12345, # Mx$123.45
descriptor='sending money', # As it'll appear for the customer
idempotency_key=local_transfer_id
)
# To get updated status
transfer.refresh()
Retrieve by id
import arteria
transfer = arteria.Transfer.retrieve('tr_123')
Query by idempotency_key
, account_number
and status
Results are always returned in descending order of created_at
The methods that can be used:
one()
- returns a single result. RaisesNoResultFound
if there are no results andMultipleResultsFound
if there are more than onefirst()
- returns the first result orNone
if there aren't anyall()
- returns a generator of all matching results. Pagination is handled automatically as you iterate over the responsecount()
- returns an integer with the count of the matching results
import arteria
# find the unique transfer using the idempotency key
local_transfer_id = '078efdc20bab456285437309c4b75673'
transfer = arteria.Transfer.one(idempotency_key=local_transfer_id)
# returns a generator of all succeeded transfers to the specific account
transfers = arteria.Transfer.all(
account_number='646180157000000004',
status='succeeded'
)
# the total number of succeeded transfers
count = arteria.Transfer.count(status='succeeded')
Api Keys
Create new ApiKey
and deactivate old
import arteria
# Create new ApiKey
new = arteria.ApiKey.create()
# Have to use the new key to deactivate the old key
old_id = arteria.session.auth[0]
arteria.session.configure(new.id, new.secret)
arteria.ApiKey.deactivate(old_id, 60) # revoke prior API key in an hour
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for arteria-python-0.0.1.dev1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91fb8b49b7d1c1a9a260cc980dc809697334a26448218772f2efc7546d4a13f5 |
|
MD5 | 48d5f0e337ddc598004a6dbac9d52aaf |
|
BLAKE2b-256 | 2fafedd3acbab3130b90051790b75df0a5c21107c232acc55c05f9220358253a |
Close
Hashes for arteria_python-0.0.1.dev1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 383fc19fbd9d998f4a66af2dcec9d6336a0d128242b33bba7eb2cb22fe1f2834 |
|
MD5 | 025d1e2bd576a0b9b210377a963fb237 |
|
BLAKE2b-256 | d2b2aaac75570a8c3e0057e1c3e26ada9a4d9a20a7fab707a1efaf852047aba3 |