You've already forked akaunting-py
refactor a little
This commit is contained in:
@@ -39,8 +39,7 @@ class Client(object):
|
||||
self.currency_rate = currency_rate
|
||||
|
||||
def call(self, method="get", endpoint=None,
|
||||
**params) -> dict():
|
||||
response = None
|
||||
**params) -> dict:
|
||||
|
||||
response = requests.request(method=method,
|
||||
url=self.url + "/" + endpoint,
|
||||
@@ -84,7 +83,7 @@ class Client(object):
|
||||
return data['data']
|
||||
|
||||
def create_transaction(self,
|
||||
type='income', # Payment method type
|
||||
transaction_type='income', # Payment method type
|
||||
account_id=None, # Account ID to assign
|
||||
category_id=None, # Category ID to assign
|
||||
contact_id=None, # Contact ID/Client to assign
|
||||
@@ -107,8 +106,8 @@ class Client(object):
|
||||
|
||||
data = self.call(endpoint="transactions",
|
||||
method="POST",
|
||||
search="type:" + type,
|
||||
type=type,
|
||||
search="type:" + transaction_type,
|
||||
type=transaction_type,
|
||||
account_id=account_id,
|
||||
category_id=category_id,
|
||||
paid_at=paid_at,
|
||||
|
||||
Reference in New Issue
Block a user