Skip to content

Commit

Permalink
Merge pull request #107 from starkbank/feature/accountType-as-required
Browse files Browse the repository at this point in the history
set Transfer account_type parameter as required
  • Loading branch information
luistarkbank authored Aug 29, 2023
2 parents eeb361c + fdde096 commit 6e62bc3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Given a version number MAJOR.MINOR.PATCH, increment:


## [Unreleased]
### Changed
- Transfer account_type parameter to required

## [2.20.0] - 2023-05-03
### Added
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ transfers = starkbank.transfer.create([
bank_code="033", # TED
branch_code="0001",
account_number="10000-0",
account_type="salary",
tax_id="012.345.678-90",
name="Tony Stark",
tags=["iron", "suit"]
Expand Down
4 changes: 2 additions & 2 deletions starkbank/transfer/__transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class Transfer(Resource):
- bank_code [string]: code of the receiver bank institution in Brazil. If an ISPB (8 digits) is informed, a PIX transfer will be created, else a TED will be issued. ex: "20018183" or "341"
- branch_code [string]: receiver bank account branch. Use '-' in case there is a verifier digit. ex: "1357-9"
- account_number [string]: receiver bank account number. Use '-' before the verifier digit. ex: "876543-2"
- account_type [string]: Receiver bank account type. This parameter only has effect on Pix Transfers. ex: "checking", "savings", "salary" or "payment"
## Parameters (optional):
- account_type [string, default "checking"]: Receiver bank account type. This parameter only has effect on Pix Transfers. ex: "checking", "savings", "salary" or "payment"
- external_id [string, default None]: url safe string that must be unique among all your transfers. Duplicated external_ids will cause failures. By default, this parameter will block any transfer that repeats amount and receiver information on the same date. ex: "my-internal-id-123456"
- scheduled [datetime.date, datetime.datetime or string, default now]: date or datetime when the transfer will be processed. May be pushed to next business day if necessary. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0)
- description [string, default None]: optional description to override default description to be shown in the bank statement. ex: "Payment for service #1234"
Expand All @@ -35,7 +35,7 @@ class Transfer(Resource):
- updated [datetime.datetime]: latest update datetime for the transfer. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0)
"""

def __init__(self, amount, name, tax_id, bank_code, branch_code, account_number, account_type=None,
def __init__(self, amount, name, tax_id, bank_code, branch_code, account_number, account_type,
external_id=None, scheduled=None, description=None, transaction_ids=None, metadata=None,
fee=None, tags=None, rules=None, status=None, id=None, created=None, updated=None
):
Expand Down
3 changes: 2 additions & 1 deletion tests/utils/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
tax_id="01234567890",
bank_code=choice(["18236120", "60701190"]),
branch_code="0001",
account_number="10000-0"
account_number="10000-0",
account_type="checking"
)


Expand Down

0 comments on commit 6e62bc3

Please sign in to comment.