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
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]
### Fixed
- dynamicBrCode and brCodePreview docstring

## [2.28.0] - 2025-03-02
### Added
Expand Down
22 changes: 20 additions & 2 deletions starkbank/dynamicbrcode/__dynamicbrcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,27 @@

class DynamicBrcode(Resource):
"""# DynamicBrcode object
Check out our API Documentation at https://starkbank.com/docs/api#dynamic-brcode
When you initialize a DynamicBrcode, the entity will not be automatically
sent to the Stark Bank API. The 'create' function sends the objects
to the Stark Bank API and returns the list of created objects.
DynamicBrcodes are conciliated BR Codes that can be used to receive Pix transactions in a convenient way.
When a DynamicBrcode is paid, a Deposit is created with the tags parameter containing the character “dynamic-brcode/” followed by the DynamicBrcode’s uuid "dynamic-brcode/{uuid}" for conciliation.
Additionally, all tags passed on the DynamicBrcode will be transferred to the respective Deposit resource.
## Parameters (required):
- amount [integer]: DynamicBrcode value in cents. Minimum = 0 (any value will be accepted). ex: 1234 (= R$ 12.34)
## Parameters (optional):
- expiration [integer or datetime.timedelta, default 3600 (1 hour)]: time interval in seconds between due date and expiration date. ex 123456789
- tags [list of strings, default []]: list of strings for tagging, these will be passed to the respective Deposit resource when paid
- display_description [string, default None]: optional description to be shown in the payer bank interface. ex: "Payment for service #1234"
- rules [list of DynamicBrcode.Rules, default []]: list of DynamicBrcode.Rule objects for modifying invoice behavior. ex: [DynamicBrcode.Rule(key="allowedTaxIds", value=[ "012.345.678-90", "45.059.493/0001-73" ])]
## Attributes (return-only):
- id [string]: id returned on creation, this is the BR code. ex: "00020126360014br.gov.bcb.pix0114+552840092118152040000530398654040.095802BR5915Jamie Lannister6009Sao Paulo620705038566304FC6C"
- uuid [string]: unique uuid returned when the DynamicBrcode is created. ex: "4e2eab725ddd495f9c98ffd97440702d"
- picture_url [string]: public QR Code (png image) URL. ex: "https://sandbox.api.starkbank.com/v2/dynamic-brcode/d3ebb1bd92024df1ab6e5a353ee799a4.png"
- updated [datetime.datetime]: latest update datetime for the DynamicBrcode. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0)
- created [datetime.datetime]: creation datetime for the DynamicBrcode. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0)
"""

def __init__(self, amount, expiration=None, tags=None, display_description=None, rules=None, id=None, uuid=None,
picture_url=None, updated=None, created=None):
Resource.__init__(self, id=id)
Expand Down
8 changes: 7 additions & 1 deletion starkbank/dynamicbrcode/rule/__rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@


class Rule(SubResource):

"""# DynamicBrcode.Rule object
The DynamicBrcode.Rule object modifies the behavior of DynamicBrcode objects when passed as an argument upon their creation.
## Parameters (required):
- key [string]: Rule to be customized, describes what DynamicBrcode behavior will be altered. ex: "allowedTaxIds"
- value [list of string]: Value of the rule. ex: ["012.345.678-90", "45.059.493/0001-73"]
"""

def __init__(self, key, value):
self.key = key
self.value = value
Expand Down
2 changes: 1 addition & 1 deletion starkbank/paymentpreview/__brcodepreview.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class BrcodePreview(SubResource):
"""# BrcodePreview object
A BrcodePreview is used to get information from a BR Code you received before confirming the payment.
## Attributes (return-only):
- status [string]: Payment status. ex: "active", "paid", "canceled" or "unknown"
- status [string]: Payment status. ex: "created", "paid", "canceled" or "expired"
- 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"
Expand Down
Loading