From 62d0c0158b7a4a779a98c840c2548c6c17a147ce Mon Sep 17 00:00:00 2001 From: Wendel de Oliveira Silvestre Date: Fri, 15 Sep 2023 16:08:21 -0300 Subject: [PATCH] Fix DictKey and PaymentPreview resources --- CHANGELOG.md | 6 ++++++ starkbank/dictkey/__dictkey.py | 15 ++++----------- starkbank/paymentpreview/__brcodepreview.py | 8 ++------ 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a79fb4e..ba76d9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/starkbank/dictkey/__dictkey.py b/starkbank/dictkey/__dictkey.py index c0328f2..c29c6a1 100644 --- a/starkbank/dictkey/__dictkey.py +++ b/starkbank/dictkey/__dictkey.py @@ -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 @@ -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"} diff --git a/starkbank/paymentpreview/__brcodepreview.py b/starkbank/paymentpreview/__brcodepreview.py index 1a54f41..347c75a 100644 --- a/starkbank/paymentpreview/__brcodepreview.py +++ b/starkbank/paymentpreview/__brcodepreview.py @@ -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) @@ -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