Skip to content

Commit

Permalink
Merge pull request #111 from starkbank/fix/central-bank-attributes
Browse files Browse the repository at this point in the history
fix-central-bank-attributes
  • Loading branch information
wendel-stark authored Sep 15, 2023
2 parents 2dbd362 + 62d0c01 commit e15091c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ Given a version number MAJOR.MINOR.PATCH, increment:


## [Unreleased]
### Removed
- account_created, created, owned attributes to DictKey resource
- account_number, branch_code attributes to PaymentPreview resource

### Changed
- account_number, branch_code attributes to DictKey resource

## [2.21.0] - 2023-08-06
### Changed
Expand Down
15 changes: 4 additions & 11 deletions starkbank/dictkey/__dictkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ class DictKey(Resource):
- owner_type [string]: DICT key owner type. ex "naturalPerson" or "legalPerson"
- bank_name [string]: bank name associated with the DICT key. ex: "Stark Bank"
- ispb [string]: bank ISPB associated with the DICT key. ex: "20018183"
- branch_code [string]: bank account branch code associated with the DICT key. ex: "9585"
- account_number [string]: bank account number associated with the DICT key. ex: "9828282578010513"
- branch_code [string]: encrypted bank account branch code associated with the DICT key. ex: "ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl"
- account_number [string]: encrypted bank account number associated with the DICT key. ex: "ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy"
- account_type [string]: bank account type associated with the DICT key. ex: "checking", "saving", "salary" or "payment"
- status [string]: current DICT key status. ex: "created", "registered", "canceled" or "failed"
- account_created [datetime.datetime]: creation datetime of the bank account associated with the DICT key. ex: datetime.date(2020, 1, 12, 11, 14, 8)
- owned [datetime.datetime]: datetime since when the current owner holds this DICT key. ex: datetime.date(2020, 11, 16, 8, 12, 11)
- created [datetime.datetime]: creation datetime for the DICT key. ex: datetime.date(2020, 11, 16, 8, 12, 11)
"""

def __init__(self, id=None, type=None, name=None, tax_id=None, owner_type=None, bank_name=None, ispb=None,
branch_code=None, account_number=None, account_type=None, status=None, account_created=None,
owned=None, created=None):
def __init__(self, id=None, type=None, name=None, tax_id=None, owner_type=None, bank_name=None,
ispb=None, branch_code=None, account_number=None, account_type=None, status=None):
Resource.__init__(self, id=id)

self.type = type
Expand All @@ -41,9 +37,6 @@ def __init__(self, id=None, type=None, name=None, tax_id=None, owner_type=None,
self.account_number = account_number
self.account_type = account_type
self.status = status
self.account_created = check_datetime(account_created)
self.owned = check_datetime(owned)
self.created = check_datetime(created)


_resource = {"class": DictKey, "name": "DictKey"}
Expand Down
8 changes: 2 additions & 6 deletions starkbank/paymentpreview/__brcodepreview.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class BrcodePreview(SubResource):
- name [string]: Payment receiver name. ex: "Tony Stark"
- tax_id [string]: Payment receiver tax ID. ex: "012.345.678-90"
- bank_code [string]: Payment receiver bank code. ex: "20018183"
- branch_code [string]: Payment receiver branch code. ex: "0001"
- account_number [string]: Payment receiver account number. ex: "1234567"
- account_type [string]: Payment receiver account type. ex: "checking"
- allow_change [bool]: If True, the payment is able to receive amounts that are different from the nominal one. ex: True or False
- amount [integer]: Value in cents that this payment is expecting to receive. If 0, any value is accepted. ex: 123 (= R$1,23)
Expand All @@ -23,14 +21,12 @@ class BrcodePreview(SubResource):
- reconciliation_id [string]: Reconciliation ID linked to this payment. ex: "txId", "payment-123"
"""

def __init__(self, status, name, tax_id, bank_code, branch_code, account_number, account_type, allow_change, amount,
nominal_amount, interest_amount, fine_amount, reduction_amount, discount_amount, reconciliation_id):
def __init__(self, status, name, tax_id, bank_code, account_type, allow_change, amount, nominal_amount,
interest_amount, fine_amount, reduction_amount, discount_amount, reconciliation_id):
self.status = status
self.name = name
self.tax_id = tax_id
self.bank_code = bank_code
self.branch_code = branch_code
self.account_number = account_number
self.account_type = account_type
self.allow_change = allow_change
self.amount = amount
Expand Down

0 comments on commit e15091c

Please sign in to comment.