-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support to BillPayment API
- Loading branch information
Showing
6 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
""" | ||
Quickbooks Online Bill Payments | ||
""" | ||
from typing import Dict | ||
from .api_base import ApiBase | ||
|
||
|
||
class BillPayments(ApiBase): | ||
"""Class for Bill Payments API.""" | ||
|
||
GET_BILLS = '/query?query=select * from billpayment STARTPOSITION {0} MAXRESULTS 1000' | ||
POST_BILL_PAYMENT = '/billpayment?minorversion=38' | ||
DELETE_BILL = '/billpayment?operation=delete' | ||
|
||
def get(self): | ||
""" | ||
Get all Bill Payments | ||
:return: List of Dicts in Bill Payment Schema | ||
""" | ||
return self._query_get_all('BillPayment', BillPayments.GET_BILLS) | ||
|
||
def post(self, data: Dict): | ||
""" | ||
Post Bill Payment to Quickbooks Online | ||
:param data: Dict in Bill Payment schema | ||
:return: | ||
""" | ||
return self._post_request(data, BillPayments.POST_BILL_PAYMENT) | ||
|
||
def delete(self, bill_payment_id: str): | ||
""" | ||
Delete Bill Payment from Quickbooks Online | ||
:param bill_payment_id: Bill Payment Id to remove | ||
:return: Dict response | ||
""" | ||
data = { | ||
'SyncToken': '1', | ||
'Id': bill_payment_id | ||
} | ||
return self._post_request(data, BillPayments.DELETE_BILL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
|
||
setuptools.setup( | ||
name='qbosdk', | ||
version='0.6.1', | ||
version='0.7.0', | ||
author='Shwetabh Kumar', | ||
author_email='[email protected]', | ||
description='Python SDK for accessing Quickbooks Online APIs', | ||
|