diff --git a/README.md b/README.md index 73387bf..36dcaa5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A simple python wrapper for MonoAPI (https://mono.co) -## Installation +## Guide Register on Mono website and get your Authorization key. @@ -14,8 +14,7 @@ Still in Development Phase ```python - - pip install -U ?? + pip install ?? ``` ```python @@ -25,7 +24,12 @@ 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() + ........ ``` @@ -33,4 +37,5 @@ Still in Development Phase - complete unit test - Travis integration - publish to pypi -- test with API from Mono +- Test with API access from Mono +- Support Webhook diff --git a/pymono/Base.py b/pymono/Base.py index d3c7362..292dee9 100644 --- a/pymono/Base.py +++ b/pymono/Base.py @@ -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): diff --git a/pymono/Mono.py b/pymono/Mono.py index d288260..84ad62a 100644 --- a/pymono/Mono.py +++ b/pymono/Mono.py @@ -14,36 +14,36 @@ 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): """ @@ -51,11 +51,18 @@ 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')