Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
A simple python wrapper for MonoAPI (https://mono.co)


## Installation
## Guide

Register on Mono website and get your Authorization key.

Expand All @@ -14,8 +14,7 @@ Still in Development Phase


```python

pip install -U ??
pip install ??
```

```python
Expand All @@ -25,12 +24,18 @@ Still in Development Phase
mono=Mono('MONO-CONNECT-ID')

# Authenticate Mono api key and use mono conncet id
mono.Auth()
data=mono.Auth()
mono.SetUserId(data.get('id'))

# return the account of a user id gotten from mono
mono.GetAccount()

........
```

## Todo
- complete unit test
- Travis integration
- publish to pypi
- test with API from Mono
- Test with API access from Mono
- Support Webhook
3 changes: 2 additions & 1 deletion pymono/Base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@


class BaseAPI(object):
_BASE_URL = "https://api.withmono.com/account/"
_BASE_URL = "https://api.withmono.com/

_CONTENT_TYPE = 'application/json'

def __init__(self):
Expand Down
23 changes: 15 additions & 8 deletions pymono/Mono.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,55 @@ def Auth(self):
:return: user_id
"""

return self._handle_request("POST", 'auth', data=self.code)
return self._handle_request("POST", 'account/"auth', data=self.code)

def GetAccount(self) -> dict:
"""
This function get the User Account after authentication
:return: json data of a user account
"""
return self._handle_request("GET", self.GetUserId())
return self._handle_request("GET", "accounts/" +self.GetUserId())

def GetTransactions(self):
"""
This function get the User transaction
:return: json data of a user transactions
"""
return self._handle_request("GET", f'{self.GetUserId()}/transactions')
return self._handle_request("GET", f'accounts/{self.GetUserId()}/transactions')

def getStatement(self):
def getStatement(self,month):
"""
This function get a User Statement of account
:return: json data of user statement of account
:return:
"""
pass
return self._handle_request('GET',f" accounts/{self.GetUserId()}/statement?period={month}")

def getUserCredits(self):
"""
This function get a User Credits history
:return: json data of a user credits
"""
return self._handle_request("GET", f'{self.GetUserId()}/credits')
return self._handle_request("GET", f"accounts/{self.GetUserId()}/credits")

def getUserDebits(self):
"""

This function get a User Debits history
:return: json data of a user debits history
"""
return self._handle_request("GET", f"{self.GetUserId()}/debits")
return self._handle_request("GET", f"accounts/{self.GetUserId()}/debits")

def GetUserIdentity(self):
"""
This function get a User Identity
:return: json data of user identity
"""
return self._handle_request("GET", f'{self.GetUserId()}/identity')
return self._handle_request("GET", f'accounts/{self.GetUserId()}/identity')

def Bvn_lookup(self,bvn)->dict:
"""
This function lookup a user bvn
:return: json data of a user details
"""
return self._handle_request("POST", f'v1/lookup/{bvn}/identity')