From 53513398c001d8c686c5b0c5d800b6cec21251d3 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Thu, 18 Jun 2026 18:07:28 -0300 Subject: [PATCH 1/3] Add issuing missing fields --- CHANGELOG.md | 2 ++ README.md | 4 +-- starkinfra/issuingbalance/__issuingbalance.py | 6 +++- starkinfra/issuingcard/__issuingcard.py | 6 ++-- starkinfra/issuingproduct/__issuingproduct.py | 4 ++- .../issuingpurchase/__issuingpurchase.py | 9 ++++-- starkinfra/issuingrule/__issuingrule.py | 9 +++++- starkinfra/issuingstock/__issuingstock.py | 4 ++- starkinfra/issuingtoken/__issuingtoken.py | 29 ++++++++++++------- .../merchantcategory/__merchantcategory.py | 4 ++- tests/sdk/testIssuingToken.py | 28 +++++++++++++++++- 11 files changed, 82 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8f3d641..d6217f49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ Given a version number MAJOR.MINOR.PATCH, increment: ## [Unreleased] +### Added +- url attribute to IssuingToken resource ## [0.28.0] - 2026-06-24 ### Added diff --git a/README.md b/README.md index d7ab3015..53c0b84e 100644 --- a/README.md +++ b/README.md @@ -1028,14 +1028,14 @@ sendResponse( ### Get an IssuingToken -You can get a single token by its id. +You can get a single token by its id. The returned token exposes a return-only `url` attribute populated by the API response. ```python import starkinfra token = starkinfra.issuingtoken.get(id="5749080709922816") -print(token) +print(token.url) ``` ### Query IssuingTokens diff --git a/starkinfra/issuingbalance/__issuingbalance.py b/starkinfra/issuingbalance/__issuingbalance.py index d39ddd22..6c57420e 100644 --- a/starkinfra/issuingbalance/__issuingbalance.py +++ b/starkinfra/issuingbalance/__issuingbalance.py @@ -12,14 +12,18 @@ class IssuingBalance(Resource): - id [string]: unique id returned when IssuingBalance is created. ex: "5656565656565656" - amount [integer]: current balance amount of the Workspace in cents. ex: 200 (= R$ 2.00) - currency [string]: currency of the current Workspace. Expect others to be added eventually. ex: "BRL" + - limit [integer]: current issuing limit of the Workspace in cents. ex: 200 (= R$ 2.00) + - max_limit [integer]: maximum issuing limit of the Workspace in cents. ex: 200 (= R$ 2.00) - updated [datetime.datetime]: latest update datetime for the IssuingBalance. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0) """ - def __init__(self, id, amount, currency, updated): + def __init__(self, id, amount, currency, updated, limit=None, max_limit=None): Resource.__init__(self, id=id) self.amount = amount self.currency = currency + self.limit = limit + self.max_limit = max_limit self.updated = updated diff --git a/starkinfra/issuingcard/__issuingcard.py b/starkinfra/issuingcard/__issuingcard.py index 9346a308..0ea5f3a1 100644 --- a/starkinfra/issuingcard/__issuingcard.py +++ b/starkinfra/issuingcard/__issuingcard.py @@ -28,6 +28,7 @@ class IssuingCard(Resource): - holder_id [string]: card holder unique id. ex: "5656565656565656" - type [string]: card type. ex: "virtual" - status [string]: current IssuingCard status. ex: "active", "blocked", "canceled", "expired" + - is_pin_defined [bool]: whether the card PIN has been defined. ex: True - number [string]: [EXPANDABLE] masked card number. Expand to unmask the value. ex: "123" - security_code [string]: [EXPANDABLE] masked card verification value (cvv). Expand to unmask the value. ex: "123" - expiration [datetime.datetime]: [EXPANDABLE] masked card expiration datetime. Expand to unmask the value. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0) @@ -37,8 +38,8 @@ class IssuingCard(Resource): def __init__(self, holder_name, holder_tax_id, holder_external_id, display_name=None, rules=None, product_id=None, tags=None, street_line_1=None, street_line_2=None, district=None, city=None, state_code=None, - zip_code=None, id=None, holder_id=None, type=None, status=None, number=None, security_code=None, - expiration=None, created=None, updated=None): + zip_code=None, id=None, holder_id=None, type=None, status=None, is_pin_defined=None, number=None, + security_code=None, expiration=None, created=None, updated=None): Resource.__init__(self, id=id) self.holder_name = holder_name @@ -57,6 +58,7 @@ def __init__(self, holder_name, holder_tax_id, holder_external_id, display_name= self.holder_id = holder_id self.type = type self.status = status + self.is_pin_defined = is_pin_defined self.number = number self.security_code = security_code self.expiration = check_datetime(expiration) diff --git a/starkinfra/issuingproduct/__issuingproduct.py b/starkinfra/issuingproduct/__issuingproduct.py index 29930cbc..0d58674a 100644 --- a/starkinfra/issuingproduct/__issuingproduct.py +++ b/starkinfra/issuingproduct/__issuingproduct.py @@ -12,16 +12,18 @@ class IssuingProduct(Resource): - funding_type [string]: type of funding used for payment. ex: "credit", "debit" - holder_type [string]: holder type. ex: "business", "individual" - code [string]: internal code from card flag informing the product. ex: "MRW", "MCO", "MWB", "MCS" + - customer_type [string]: card product customer type. ex: "business", "individual" - created [datetime.datetime]: creation datetime for the IssuingProduct. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0) """ - def __init__(self, id=None, network=None, funding_type=None, holder_type=None, code=None, created=None): + def __init__(self, id=None, network=None, funding_type=None, holder_type=None, code=None, customer_type=None, created=None): Resource.__init__(self, id=id) self.network = network self.funding_type = funding_type self.holder_type = holder_type self.code = code + self.customer_type = customer_type self.created = created diff --git a/starkinfra/issuingpurchase/__issuingpurchase.py b/starkinfra/issuingpurchase/__issuingpurchase.py index ccd6bf0d..e25dea31 100644 --- a/starkinfra/issuingpurchase/__issuingpurchase.py +++ b/starkinfra/issuingpurchase/__issuingpurchase.py @@ -26,6 +26,7 @@ class IssuingPurchase(Resource): - merchant_currency_symbol [string]: merchant currency symbol. ex: "$" - merchant_category_code [string]: merchant category code. ex: "fastFoodRestaurants" - merchant_category_type [string]: merchant category type. ex "food" + - merchant_category_number [integer]: merchant category number. ex: 5814 - merchant_country_code [string]: merchant country code. ex: "USA" - acquirer_id [string]: acquirer ID. ex: "5656565656565656" - merchant_id [string]: merchant ID. ex: "5656565656565656" @@ -34,6 +35,7 @@ class IssuingPurchase(Resource): - wallet_id [string]: virtual wallet ID. ex: "5656565656565656" - method_code [string]: method code. Options: "chip", "token", "server", "manual", "magstripe" or "contactless" - score [float]: internal score calculated for the authenticity of the purchase. None in case of insufficient data. ex: 7.6 + - confirmed [bool]: whether the purchase has been confirmed. ex: True - end_to_end_id [string]: Unique id used to identify the transaction through all of its life cycle, even before the purchase is denied or approved and gets its usual id. ex: "679cd385-642b-49d0-96b7-89491e1249a5" - tags [list of strings]: list of strings for tagging returned by the sub-issuer during the authorization. ex: ["travel", "food"] ## Attributes (IssuingPurchase only): @@ -56,8 +58,9 @@ def __init__(self, holder_name=None, product_id=None, card_id=None, card_ending= installment_count=None, amount=None, tax=None, issuer_amount=None, issuer_currency_code=None, issuer_currency_symbol=None, merchant_amount=None, merchant_currency_code=None, merchant_currency_symbol=None, merchant_category_code=None, merchant_category_type=None, - merchant_country_code=None, acquirer_id=None, merchant_id=None, merchant_name=None, merchant_fee=None, - wallet_id=None, method_code=None, score=None, end_to_end_id=None, tags=None, id=None, + merchant_category_number=None, merchant_country_code=None, acquirer_id=None, merchant_id=None, + merchant_name=None, merchant_fee=None, wallet_id=None, method_code=None, score=None, confirmed=None, + end_to_end_id=None, tags=None, id=None, issuing_transaction_ids=None, status=None, description=None, metadata=None, zip_code=None, updated=None, created=None, is_partial_allowed=None, card_tags=None, holder_id=None, holder_tags=None): Resource.__init__(self, id=id) @@ -78,6 +81,7 @@ def __init__(self, holder_name=None, product_id=None, card_id=None, card_ending= self.merchant_currency_symbol = merchant_currency_symbol self.merchant_category_code = merchant_category_code self.merchant_category_type = merchant_category_type + self.merchant_category_number = merchant_category_number self.merchant_country_code = merchant_country_code self.acquirer_id = acquirer_id self.merchant_id = merchant_id @@ -86,6 +90,7 @@ def __init__(self, holder_name=None, product_id=None, card_id=None, card_ending= self.wallet_id = wallet_id self.method_code = method_code self.score = score + self.confirmed = confirmed self.end_to_end_id = end_to_end_id self.tags = tags self.issuing_transaction_ids = issuing_transaction_ids diff --git a/starkinfra/issuingrule/__issuingrule.py b/starkinfra/issuingrule/__issuingrule.py index 7fa1125e..02744e65 100644 --- a/starkinfra/issuingrule/__issuingrule.py +++ b/starkinfra/issuingrule/__issuingrule.py @@ -22,10 +22,14 @@ class IssuingRule(Resource): - counter_amount [integer]: current rule spent amount. ex: 1000 - currency_symbol [string]: currency symbol. ex: "R$" - currency_name [string]: currency name. ex: "Brazilian Real" + - schedule [string]: schedule time for the rule. ex: "every monday, wednesday from 00:00 to 23:59 in America/Sao_Paulo" + - purposes [list of strings]: list of purposes accepted by the rule. ex: ["purchase", "withdrawal"] + - merchants [list of strings]: list of merchants accepted by the rule. ex: ["5656565656565656"] """ def __init__(self, name, amount, id=None, interval=None, currency_code=None, categories=None, countries=None, - methods=None, counter_amount=None, currency_symbol=None, currency_name=None): + methods=None, counter_amount=None, currency_symbol=None, currency_name=None, schedule=None, + purposes=None, merchants=None): Resource.__init__(self, id=id) self.name = name @@ -38,6 +42,9 @@ def __init__(self, name, amount, id=None, interval=None, currency_code=None, cat self.counter_amount = counter_amount self.currency_symbol = currency_symbol self.currency_name = currency_name + self.schedule = schedule + self.purposes = purposes + self.merchants = merchants _resource = {"class": IssuingRule, "name": "IssuingRule"} diff --git a/starkinfra/issuingstock/__issuingstock.py b/starkinfra/issuingstock/__issuingstock.py index 655ee2e0..79d49828 100644 --- a/starkinfra/issuingstock/__issuingstock.py +++ b/starkinfra/issuingstock/__issuingstock.py @@ -11,16 +11,18 @@ class IssuingStock(Resource): - balance [integer]: [EXPANDABLE] current stock balance. ex: 1000 - design_id [string]: IssuingDesign unique id. ex: "5656565656565656" - embosser_id [string]: Embosser unique id. ex: "5656565656565656" + - embosser_name [string]: Embosser name. ex: "Vault123" - updated [datetime.datetime]: latest update datetime for the IssuingStock. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0) - created [datetime.datetime]: creation datetime for the IssuingStock. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0) """ - def __init__(self, balance=None, design_id=None, embosser_id=None, id=None, created=None, updated=None): + def __init__(self, balance=None, design_id=None, embosser_id=None, embosser_name=None, id=None, created=None, updated=None): Resource.__init__(self, id=id) self.balance = balance self.design_id = design_id self.embosser_id = embosser_id + self.embosser_name = embosser_name self.created = check_datetime(created) self.updated = check_datetime(updated) diff --git a/starkinfra/issuingtoken/__issuingtoken.py b/starkinfra/issuingtoken/__issuingtoken.py index d9b61a0c..51fb6fb3 100644 --- a/starkinfra/issuingtoken/__issuingtoken.py +++ b/starkinfra/issuingtoken/__issuingtoken.py @@ -1,5 +1,5 @@ from json import dumps -from starkinfra.utils import rest +from ..utils import rest from starkcore.utils.api import api_json from ..utils.parse import parse_and_verify from starkcore.utils.resource import Resource @@ -14,6 +14,8 @@ class IssuingToken(Resource): - wallet_id [string]: wallet provider which the token is bounded to. ex: "google" - wallet_name [string]: wallet name. ex: "GOOGLE" - merchant_id [string]: merchant unique id. ex: "5656565656565656" + - wallet_device_score [float]: wallet device risk score. ex: 7.6 + - wallet_account_score [float]: wallet account risk score. ex: 7.6 ## Attributes (IssuingToken only): - id [string]: unique id returned when IssuingToken is created. ex: "5656565656565656" - external_id [string]: a unique string among all your IssuingTokens, used to avoid resource duplication. ex: "DSHRMC00002626944b0e3b539d4d459281bdba90c2588791" @@ -31,23 +33,27 @@ class IssuingToken(Resource): - device_os_version [string]: device operational system version used for tokenization. ex: "4.4.4" - device_imei [string]: device imei used for tokenization. ex: "352099001761481" - wallet_instance_id [string]: unique id refered to the wallet app in the current device. ex: "71583be4777eb89aaf0345eebeb82594f096615ed17862d0" + - url [string]: token URL. ex: "https://token.starkinfra.com/5656565656565656" """ - def __init__(self, card_id=None, wallet_id=None, wallet_name=None, merchant_id=None, id=None, + def __init__(self, card_id=None, wallet_id=None, wallet_name=None, merchant_id=None, wallet_device_score=None, + wallet_account_score=None, id=None, external_id=None, tags=None, status=None, updated=None, created=None, activation_code=None, method_code=None, device_type=None, device_name=None, device_serial_number=None, device_os_name=None, - device_os_version=None, device_imei=None, wallet_instance_id=None): + device_os_version=None, device_imei=None, wallet_instance_id=None, url=None): Resource.__init__(self, id=id) self.card_id = card_id self.wallet_id = wallet_id self.wallet_name = wallet_name self.merchant_id = merchant_id + self.wallet_device_score = wallet_device_score + self.wallet_account_score = wallet_account_score self.external_id = external_id self.tags = tags self.status = status - self.updated = updated - self.created = created + self.updated = check_datetime(updated) + self.created = check_datetime(created) self.activation_code = activation_code self.method_code = method_code self.device_type = device_type @@ -57,6 +63,7 @@ def __init__(self, card_id=None, wallet_id=None, wallet_name=None, merchant_id=N self.device_os_version = device_os_version self.device_imei = device_imei self.wallet_instance_id = wallet_instance_id + self.url = url _resource = {"class": IssuingToken, "name": "IssuingToken"} @@ -75,7 +82,7 @@ def get(id, user=None): return rest.get_id(resource=_resource, id=id, user=user) -def query(limit=None, after=None, before=None, status=None, card_ids=None, tags=None, ids=None, user=None, external_ids=None): +def query(limit=None, after=None, before=None, status=None, card_ids=None, tags=None, ids=None, external_ids=None, user=None): """# Retrieve IssuingTokens Receive a generator of IssuingToken objects previously created in the Stark Infra API ## Parameters (optional): @@ -86,8 +93,8 @@ def query(limit=None, after=None, before=None, status=None, card_ids=None, tags= - card_ids [list of strings, default None]: list of card_ids to filter retrieved objects. ex: ["5656565656565656", "4545454545454545"] - tags [list of strings, default None]: list of strings for tagging. ex: ["travel", "food"] - ids [list of strings, default None]: list of ids to filter retrieved objects. ex: ["5656565656565656", "4545454545454545"] - - user [Organization/Project object, default None]: Organization or Project object. Not necessary if starkinfra.user was set before function call - external_ids [list of strings, default None]: external IDs. ex: ["DSHRMC00002626944b0e3b539d4d459281bdba90c2588791", "DSHRMC00002626941c531164a0b14c66ad9602ee716f1e85"] + - user [Organization/Project object, default None]: Organization or Project object. Not necessary if starkinfra.user was set before function call ## Return: - generator of IssuingToken objects with updated attributes """ @@ -100,12 +107,12 @@ def query(limit=None, after=None, before=None, status=None, card_ids=None, tags= card_ids=card_ids, tags=tags, ids=ids, - user=user, external_ids=external_ids, + user=user, ) -def page(cursor=None, limit=None, after=None, before=None, status=None, card_ids=None, tags=None, ids=None, user=None, external_ids=None): +def page(cursor=None, limit=None, after=None, before=None, status=None, card_ids=None, tags=None, ids=None, external_ids=None, user=None): """# Retrieve paged IssuingTokens Receive a list of IssuingToken objects previously created in the Stark Infra API and the cursor to the next page. Use this function instead of query if you want to manually page your requests. @@ -118,8 +125,8 @@ def page(cursor=None, limit=None, after=None, before=None, status=None, card_ids - card_ids [list of strings, default None]: list of card_ids to filter retrieved objects. ex: ["5656565656565656", "4545454545454545"] - tags [list of strings, default None]: list of strings for tagging. ex: ["travel", "food"] - ids [list of strings, default None]: list of ids to filter retrieved objects. ex: ["5656565656565656", "4545454545454545"] - - user [Organization/Project object, default None]: Organization or Project object. Not necessary if starkinfra.user was set before function call - external_ids [list of strings, default None]: external IDs. ex: ["5656565656565656", "4545454545454545"] + - user [Organization/Project object, default None]: Organization or Project object. Not necessary if starkinfra.user was set before function call ## Return: - list of IssuingToken objects with updated attributes - cursor to retrieve the next page of IssuingToken objects @@ -134,8 +141,8 @@ def page(cursor=None, limit=None, after=None, before=None, status=None, card_ids card_ids=card_ids, tags=tags, ids=ids, - user=user, external_ids=external_ids, + user=user, ) diff --git a/starkinfra/merchantcategory/__merchantcategory.py b/starkinfra/merchantcategory/__merchantcategory.py index dd9d8e16..07519f85 100644 --- a/starkinfra/merchantcategory/__merchantcategory.py +++ b/starkinfra/merchantcategory/__merchantcategory.py @@ -14,13 +14,15 @@ class MerchantCategory(SubResource): ## Attributes (return-only): - name [string]: category's name. ex: "Veterinary services", "Fast food restaurants" - number [string]: category's number. ex: "742", "5814" + - group [string]: category's group. ex: "pets", "food" """ - def __init__(self, code=None, type=None, name=None, number=None): + def __init__(self, code=None, type=None, name=None, number=None, group=None): self.code = code self.type = type self.name = name self.number = number + self.group = group _resource = {"class": MerchantCategory, "name": "MerchantCategory"} diff --git a/tests/sdk/testIssuingToken.py b/tests/sdk/testIssuingToken.py index 61e42d6e..fe29da25 100644 --- a/tests/sdk/testIssuingToken.py +++ b/tests/sdk/testIssuingToken.py @@ -50,10 +50,29 @@ def test_success(self): self.assertEqual(canceled_token.id, str(canceled_token.id)) -class TestIssuingTokenParseRight(TestCase): +class TestIssuingTokenUrl(TestCase): + + def test_success_query(self): + tokens = starkinfra.issuingtoken.query(limit=5) + for token in tokens: + self.assertTrue(hasattr(token, "url")) + if token.url is not None: + self.assertEqual(token.url, str(token.url)) + + def test_success_get(self): + tokens = starkinfra.issuingtoken.query(limit=1) + for token in tokens: + fetched_token = starkinfra.issuingtoken.get(token.id) + self.assertTrue(hasattr(fetched_token, "url")) + if fetched_token.url is not None: + self.assertEqual(fetched_token.url, str(fetched_token.url)) + + +class TestIssuingTokenProcess(TestCase): content = "{\"deviceName\": \"My phone\", \"methodCode\": \"manual\", \"walletName\": \"Google Pay\", \"activationCode\": \"\", \"deviceSerialNumber\": \"2F6D63\", \"deviceImei\": \"352099001761481\", \"deviceType\": \"Phone\", \"walletInstanceId\": \"1b24f24a24ba98e27d43e345b532a245e4723d7a9c4f624e\", \"deviceOsVersion\": \"4.4.4\", \"cardId\": \"5189831499972623\", \"deviceOsName\": \"Android\", \"merchantId\": \"12345678901\", \"walletId\": \"google\"}" valid_signature = "MEYCIQC4XbhjxEp9VhowLeg9JbSOo94FCRWE9GI7l7OuHh0bUwIhAJBuLDl5DAT9L4iMI0qYQ+PVmBIG5scxxvkWSsoWmwi4" invalid_signature = "MEUCIQDOpo1j+V40DNZK2URL2786UQK/8mDXon9ayEd8U0/l7AIgYXtIZJBTs8zCRR3vmted6Ehz/qfw1GRut/eYyvf1yOk=" + malformed_signature = "something is definitely wrong" def test_success(self): event = starkinfra.issuingtoken.parse( @@ -76,6 +95,13 @@ def test_invalid_signature(self): signature=self.invalid_signature, ) + def test_malformed_signature(self): + with self.assertRaises(InvalidSignatureError): + starkinfra.issuingtoken.parse( + content=self.content, + signature=self.malformed_signature, + ) + class TestIssuingTokenResponseAuthorization(TestCase): From 11f4cba95cc858fd31c57d646095e33f7165bcd5 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Wed, 1 Jul 2026 16:12:48 -0300 Subject: [PATCH 2/3] Change issuing docstrings, confirmed to datetime, and remove IssuingToken url --- README.md | 4 ++-- starkinfra/issuingbalance/__issuingbalance.py | 4 ++-- .../__issuingbillinginvoice.py | 3 +++ .../__issuingbillingtransaction.py | 3 +++ starkinfra/issuingcard/__issuingcard.py | 2 +- starkinfra/issuingproduct/__issuingproduct.py | 2 +- .../issuingpurchase/__issuingpurchase.py | 6 +++--- starkinfra/issuingstock/__issuingstock.py | 2 +- starkinfra/issuingtoken/__issuingtoken.py | 8 +++----- tests/sdk/testIssuingToken.py | 18 ------------------ 10 files changed, 19 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 53c0b84e..d7ab3015 100644 --- a/README.md +++ b/README.md @@ -1028,14 +1028,14 @@ sendResponse( ### Get an IssuingToken -You can get a single token by its id. The returned token exposes a return-only `url` attribute populated by the API response. +You can get a single token by its id. ```python import starkinfra token = starkinfra.issuingtoken.get(id="5749080709922816") -print(token.url) +print(token) ``` ### Query IssuingTokens diff --git a/starkinfra/issuingbalance/__issuingbalance.py b/starkinfra/issuingbalance/__issuingbalance.py index 6c57420e..bca863b4 100644 --- a/starkinfra/issuingbalance/__issuingbalance.py +++ b/starkinfra/issuingbalance/__issuingbalance.py @@ -12,8 +12,8 @@ class IssuingBalance(Resource): - id [string]: unique id returned when IssuingBalance is created. ex: "5656565656565656" - amount [integer]: current balance amount of the Workspace in cents. ex: 200 (= R$ 2.00) - currency [string]: currency of the current Workspace. Expect others to be added eventually. ex: "BRL" - - limit [integer]: current issuing limit of the Workspace in cents. ex: 200 (= R$ 2.00) - - max_limit [integer]: maximum issuing limit of the Workspace in cents. ex: 200 (= R$ 2.00) + - limit [integer]: Spending limit of the balance + - max_limit [integer]: Maximum spending limit. This field is currently always equal to limit - updated [datetime.datetime]: latest update datetime for the IssuingBalance. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0) """ diff --git a/starkinfra/issuingbillinginvoice/__issuingbillinginvoice.py b/starkinfra/issuingbillinginvoice/__issuingbillinginvoice.py index 79ebd9d2..01e8cfac 100644 --- a/starkinfra/issuingbillinginvoice/__issuingbillinginvoice.py +++ b/starkinfra/issuingbillinginvoice/__issuingbillinginvoice.py @@ -6,6 +6,9 @@ class IssuingBillingInvoice(Resource): """# IssuingBillingInvoice object Check out our API Documentation at https://starkinfra.com/docs/api#issuing-billing-invoice + ## Attributes (return-only): + - fine [float]: Fine percentage applied when paid after the due date. ex: 2.0 + - interest [float]: Monthly interest percentage applied when paid after the due date. ex: 1.0 """ def __init__(self, id=None, name=None, tax_id=None, fine=None, interest=None, status=None, amount=None, diff --git a/starkinfra/issuingbillingtransaction/__issuingbillingtransaction.py b/starkinfra/issuingbillingtransaction/__issuingbillingtransaction.py index f7be5d86..87147c6e 100644 --- a/starkinfra/issuingbillingtransaction/__issuingbillingtransaction.py +++ b/starkinfra/issuingbillingtransaction/__issuingbillingtransaction.py @@ -6,6 +6,9 @@ class IssuingBillingTransaction(Resource): """# IssuingBillingTransaction object Check out our API Documentation at https://starkinfra.com/docs/api#issuing-billing-transaction + ## Attributes (return-only): + - rate [float]: Conversion rate applied to international transactions + - tax [integer]: IOF amount in cents applied to the transaction """ def __init__(self, id=None, amount=None, invoice_id=None, installment=None, installment_count=None, diff --git a/starkinfra/issuingcard/__issuingcard.py b/starkinfra/issuingcard/__issuingcard.py index 0ea5f3a1..36d6a2c6 100644 --- a/starkinfra/issuingcard/__issuingcard.py +++ b/starkinfra/issuingcard/__issuingcard.py @@ -28,7 +28,7 @@ class IssuingCard(Resource): - holder_id [string]: card holder unique id. ex: "5656565656565656" - type [string]: card type. ex: "virtual" - status [string]: current IssuingCard status. ex: "active", "blocked", "canceled", "expired" - - is_pin_defined [bool]: whether the card PIN has been defined. ex: True + - is_pin_defined [bool]: Whether the card has a PIN defined. Returned only when "expand=isPinDefined" is informed in the request - number [string]: [EXPANDABLE] masked card number. Expand to unmask the value. ex: "123" - security_code [string]: [EXPANDABLE] masked card verification value (cvv). Expand to unmask the value. ex: "123" - expiration [datetime.datetime]: [EXPANDABLE] masked card expiration datetime. Expand to unmask the value. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0) diff --git a/starkinfra/issuingproduct/__issuingproduct.py b/starkinfra/issuingproduct/__issuingproduct.py index 0d58674a..fddf97dd 100644 --- a/starkinfra/issuingproduct/__issuingproduct.py +++ b/starkinfra/issuingproduct/__issuingproduct.py @@ -12,7 +12,7 @@ class IssuingProduct(Resource): - funding_type [string]: type of funding used for payment. ex: "credit", "debit" - holder_type [string]: holder type. ex: "business", "individual" - code [string]: internal code from card flag informing the product. ex: "MRW", "MCO", "MWB", "MCS" - - customer_type [string]: card product customer type. ex: "business", "individual" + - customer_type [string]: Same as holderType. Kept for backward compatibility - created [datetime.datetime]: creation datetime for the IssuingProduct. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0) """ diff --git a/starkinfra/issuingpurchase/__issuingpurchase.py b/starkinfra/issuingpurchase/__issuingpurchase.py index e25dea31..6af97319 100644 --- a/starkinfra/issuingpurchase/__issuingpurchase.py +++ b/starkinfra/issuingpurchase/__issuingpurchase.py @@ -26,7 +26,7 @@ class IssuingPurchase(Resource): - merchant_currency_symbol [string]: merchant currency symbol. ex: "$" - merchant_category_code [string]: merchant category code. ex: "fastFoodRestaurants" - merchant_category_type [string]: merchant category type. ex "food" - - merchant_category_number [integer]: merchant category number. ex: 5814 + - merchant_category_number [integer]: MCC number of the merchant category. ex: 5814 - merchant_country_code [string]: merchant country code. ex: "USA" - acquirer_id [string]: acquirer ID. ex: "5656565656565656" - merchant_id [string]: merchant ID. ex: "5656565656565656" @@ -35,7 +35,7 @@ class IssuingPurchase(Resource): - wallet_id [string]: virtual wallet ID. ex: "5656565656565656" - method_code [string]: method code. Options: "chip", "token", "server", "manual", "magstripe" or "contactless" - score [float]: internal score calculated for the authenticity of the purchase. None in case of insufficient data. ex: 7.6 - - confirmed [bool]: whether the purchase has been confirmed. ex: True + - confirmed [datetime.datetime]: Confirmation datetime. Null until the purchase is confirmed. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0) - end_to_end_id [string]: Unique id used to identify the transaction through all of its life cycle, even before the purchase is denied or approved and gets its usual id. ex: "679cd385-642b-49d0-96b7-89491e1249a5" - tags [list of strings]: list of strings for tagging returned by the sub-issuer during the authorization. ex: ["travel", "food"] ## Attributes (IssuingPurchase only): @@ -90,7 +90,7 @@ def __init__(self, holder_name=None, product_id=None, card_id=None, card_ending= self.wallet_id = wallet_id self.method_code = method_code self.score = score - self.confirmed = confirmed + self.confirmed = check_datetime(confirmed) self.end_to_end_id = end_to_end_id self.tags = tags self.issuing_transaction_ids = issuing_transaction_ids diff --git a/starkinfra/issuingstock/__issuingstock.py b/starkinfra/issuingstock/__issuingstock.py index 79d49828..369cd7e0 100644 --- a/starkinfra/issuingstock/__issuingstock.py +++ b/starkinfra/issuingstock/__issuingstock.py @@ -11,7 +11,7 @@ class IssuingStock(Resource): - balance [integer]: [EXPANDABLE] current stock balance. ex: 1000 - design_id [string]: IssuingDesign unique id. ex: "5656565656565656" - embosser_id [string]: Embosser unique id. ex: "5656565656565656" - - embosser_name [string]: Embosser name. ex: "Vault123" + - embosser_name [string]: Name of the embosser that holds this stock - updated [datetime.datetime]: latest update datetime for the IssuingStock. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0) - created [datetime.datetime]: creation datetime for the IssuingStock. ex: datetime.datetime(2020, 3, 10, 10, 30, 0, 0) """ diff --git a/starkinfra/issuingtoken/__issuingtoken.py b/starkinfra/issuingtoken/__issuingtoken.py index 51fb6fb3..d340f950 100644 --- a/starkinfra/issuingtoken/__issuingtoken.py +++ b/starkinfra/issuingtoken/__issuingtoken.py @@ -14,8 +14,8 @@ class IssuingToken(Resource): - wallet_id [string]: wallet provider which the token is bounded to. ex: "google" - wallet_name [string]: wallet name. ex: "GOOGLE" - merchant_id [string]: merchant unique id. ex: "5656565656565656" - - wallet_device_score [float]: wallet device risk score. ex: 7.6 - - wallet_account_score [float]: wallet account risk score. ex: 7.6 + - wallet_device_score [float]: Device score informed by the digital wallet. + - wallet_account_score [float]: Account score informed by the digital wallet ## Attributes (IssuingToken only): - id [string]: unique id returned when IssuingToken is created. ex: "5656565656565656" - external_id [string]: a unique string among all your IssuingTokens, used to avoid resource duplication. ex: "DSHRMC00002626944b0e3b539d4d459281bdba90c2588791" @@ -33,14 +33,13 @@ class IssuingToken(Resource): - device_os_version [string]: device operational system version used for tokenization. ex: "4.4.4" - device_imei [string]: device imei used for tokenization. ex: "352099001761481" - wallet_instance_id [string]: unique id refered to the wallet app in the current device. ex: "71583be4777eb89aaf0345eebeb82594f096615ed17862d0" - - url [string]: token URL. ex: "https://token.starkinfra.com/5656565656565656" """ def __init__(self, card_id=None, wallet_id=None, wallet_name=None, merchant_id=None, wallet_device_score=None, wallet_account_score=None, id=None, external_id=None, tags=None, status=None, updated=None, created=None, activation_code=None, method_code=None, device_type=None, device_name=None, device_serial_number=None, device_os_name=None, - device_os_version=None, device_imei=None, wallet_instance_id=None, url=None): + device_os_version=None, device_imei=None, wallet_instance_id=None): Resource.__init__(self, id=id) self.card_id = card_id @@ -63,7 +62,6 @@ def __init__(self, card_id=None, wallet_id=None, wallet_name=None, merchant_id=N self.device_os_version = device_os_version self.device_imei = device_imei self.wallet_instance_id = wallet_instance_id - self.url = url _resource = {"class": IssuingToken, "name": "IssuingToken"} diff --git a/tests/sdk/testIssuingToken.py b/tests/sdk/testIssuingToken.py index fe29da25..17b105e9 100644 --- a/tests/sdk/testIssuingToken.py +++ b/tests/sdk/testIssuingToken.py @@ -50,24 +50,6 @@ def test_success(self): self.assertEqual(canceled_token.id, str(canceled_token.id)) -class TestIssuingTokenUrl(TestCase): - - def test_success_query(self): - tokens = starkinfra.issuingtoken.query(limit=5) - for token in tokens: - self.assertTrue(hasattr(token, "url")) - if token.url is not None: - self.assertEqual(token.url, str(token.url)) - - def test_success_get(self): - tokens = starkinfra.issuingtoken.query(limit=1) - for token in tokens: - fetched_token = starkinfra.issuingtoken.get(token.id) - self.assertTrue(hasattr(fetched_token, "url")) - if fetched_token.url is not None: - self.assertEqual(fetched_token.url, str(fetched_token.url)) - - class TestIssuingTokenProcess(TestCase): content = "{\"deviceName\": \"My phone\", \"methodCode\": \"manual\", \"walletName\": \"Google Pay\", \"activationCode\": \"\", \"deviceSerialNumber\": \"2F6D63\", \"deviceImei\": \"352099001761481\", \"deviceType\": \"Phone\", \"walletInstanceId\": \"1b24f24a24ba98e27d43e345b532a245e4723d7a9c4f624e\", \"deviceOsVersion\": \"4.4.4\", \"cardId\": \"5189831499972623\", \"deviceOsName\": \"Android\", \"merchantId\": \"12345678901\", \"walletId\": \"google\"}" valid_signature = "MEYCIQC4XbhjxEp9VhowLeg9JbSOo94FCRWE9GI7l7OuHh0bUwIhAJBuLDl5DAT9L4iMI0qYQ+PVmBIG5scxxvkWSsoWmwi4" From d153a1a29533fd56a7439cb3e1d821d3d2985996 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Wed, 1 Jul 2026 18:40:34 -0300 Subject: [PATCH 3/3] Change IssuingRule docstrings and remove merchants field --- starkinfra/issuingrule/__issuingrule.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/starkinfra/issuingrule/__issuingrule.py b/starkinfra/issuingrule/__issuingrule.py index 02744e65..8349d6f3 100644 --- a/starkinfra/issuingrule/__issuingrule.py +++ b/starkinfra/issuingrule/__issuingrule.py @@ -22,14 +22,13 @@ class IssuingRule(Resource): - counter_amount [integer]: current rule spent amount. ex: 1000 - currency_symbol [string]: currency symbol. ex: "R$" - currency_name [string]: currency name. ex: "Brazilian Real" - - schedule [string]: schedule time for the rule. ex: "every monday, wednesday from 00:00 to 23:59 in America/Sao_Paulo" - - purposes [list of strings]: list of purposes accepted by the rule. ex: ["purchase", "withdrawal"] - - merchants [list of strings]: list of merchants accepted by the rule. ex: ["5656565656565656"] + - schedule [string]: Optional schedule dictating when the rule can be used. Some examples: "everyday from 09:00 to 18:00 in America/Sao_Paulo" - every day, 09:00-18:00 Sao Paulo time; "every monday, wednesday, friday from 08:00 to 12:00 in America/Sao_Paulo" - only those weekdays, mornings; "every saturday, sunday" - weekends, all day, in UTC + - purposes [list of strings]: Optional list of transaction purposes the rule applies to. Options: "purchase", "withdrawal", "verification". The rule then limits only purchases of those purposes; omit it to allow any purposes. Example: ["purchase", "verification"] if you want us to automatically deny withdrawal. """ def __init__(self, name, amount, id=None, interval=None, currency_code=None, categories=None, countries=None, methods=None, counter_amount=None, currency_symbol=None, currency_name=None, schedule=None, - purposes=None, merchants=None): + purposes=None): Resource.__init__(self, id=id) self.name = name @@ -44,7 +43,6 @@ def __init__(self, name, amount, id=None, interval=None, currency_code=None, cat self.currency_name = currency_name self.schedule = schedule self.purposes = purposes - self.merchants = merchants _resource = {"class": IssuingRule, "name": "IssuingRule"}