Skip to main content

An API Client to interact with Pesos

Project description

# Pesos
`python-python` is the officially supported library for communicating to Pesos
via our public APIs (api.pesos.io).

Note: The library is currently in alpha, but already used in a few projects.

Pesos API Docs are available [here](https://docs.pesos.io)


### Getting Started
`pip install pesos-python` to get the library installed.


### Authentication
Get your access token from the [Developer Dashboard](https://developers.pesos.io/apikeys/)

```python
from pesos import Client
client = Client('YOUR ACCESS TOKEN')
```


### Resources
#### Accounts

To get information about your account you should make the following requests:

```python
client.account.detail()
```

To make changes to your account:
```python
client.account.update(
first_name='John',
last_name='Doe'
)
```


#### Payments
**Action: Create**

```python
response = client.payment.create(
amount=10,
description='A useful short description',
tracking_id='your internal identifier',
redirect_url='https://www.yourwebsite.com/'
)
```

Note: You'll need to pull `approval_url` out of the response dict and redirect
your user to it, so the payment can be approved.


**Possible arguments:**

|argument |type |required |
|--- |--- | --- |
|amount | decimal | x |
|description | string | x |
|tracking_id | string | |
|redirect_url | string | x |


**Action: Process**
To process a payment, you'll need to provide the `id`.

```python
client.payment.process('payment id')
```


**Action: Refund**
To refund a payment, you'll also need to provide the `id`.
```python
client.payment.refund('payment id')
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pesos-python-0.0.7.dev1.tar.gz (4.4 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page