Skip to content
Open
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
42 changes: 33 additions & 9 deletions pyinvoice/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class InvoiceInfo(object):
"""
Invoice information
"""
def __init__(self, invoice_id=None, invoice_datetime=None, due_datetime=None):
def __init__(
self, invoice_id=None, invoice_datetime=None, due_datetime=None):
"""
Invoice info
:param invoice_id: Invoice id
Expand All @@ -42,17 +43,25 @@ def __init__(self, invoice_id=None, invoice_datetime=None, due_datetime=None):


class AddressInfo(object):
def __init__(self, name=None, street=None, city=None, state=None, country=None, post_code=None):
def __init__(
self, name=None, street=None,
po_box=None, private_bag=None,
city=None, state=None,
country=None, post_code=None):
"""
:type name: str or unicode or None
:type street: str or unicode or None
:type po_box: str or unicode or None
:type private_bag: str or unicode or None
:type city: str or unicode or None
:type state: str or unicode or None
:type country: str or unicode or None
:type post_code: str or unicode or int or None
"""
self.name = name
self.street = street
self.po_box = po_box
self.private_bag = private_bag
self.city = city
self.state = state
self.country = country
Expand All @@ -63,38 +72,53 @@ class ServiceProviderInfo(AddressInfo):
"""
Service provider/Merchant information
"""
def __init__(self, name=None, street=None, city=None, state=None, country=None, post_code=None,
vat_tax_number=None):
def __init__(
self, name=None, street=None,
po_box=None, private_bag=None,
city=None, state=None, country=None,
post_code=None,
vat_tax_number=None):
"""
:type name: str or unicode or None
:type street: str or unicode or None
:type po_box: str or unicode or None
:type private_bag: str or unicode or None
:type city: str or unicode or None
:type state: str or unicode or None
:type country: str or unicode or None
:type post_code: str or unicode or None
:type vat_tax_number: str or unicode or int or None
"""
super(ServiceProviderInfo, self).__init__(name, street, city, state, country, post_code)
super(ServiceProviderInfo, self).__init__(
name, street, po_box, private_bag, city,
state, country, post_code)
self.vat_tax_number = vat_tax_number


class ClientInfo(AddressInfo):
"""
Client/Custom information
"""
def __init__(self, name=None, street=None, city=None, state=None, country=None, post_code=None,
email=None, client_id=None):
def __init__(
self, name=None, street=None,
po_box=None, private_bag=None,
city=None, state=None, country=None,
post_code=None, email=None, client_id=None):
"""
:type name: str or unicode or None
:type street: str or unicode or None
:type po_box: str or unicode or None
:type private_bag: str or unicode or None
:type city: str or unicode or None
:type state: str or unicode or None
:type country: str or unicode or None
:type post_code: str or unicode or None
:type email: str or unicode or None
:type client_id: str or unicode or int or None
"""
super(ClientInfo, self).__init__(name, street, city, state, country, post_code)
super(ClientInfo, self).__init__(
name, street, po_box, private_bag,
city, state, country, post_code)
self.email = email
self.client_id = client_id

Expand Down Expand Up @@ -145,4 +169,4 @@ def __init__(self, gateway, transaction_id, transaction_datetime, amount):
self.gateway = gateway
self.transaction_id = transaction_id
self.transaction_datetime = transaction_datetime
self.amount = amount
self.amount = amount
Loading