diff --git a/CHANGELOG.md b/CHANGELOG.md index bfc25e4..7540cce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ Given a version number MAJOR.MINOR.PATCH, increment: ## [Unreleased] +### Added +- holder_id and soft_descriptor attributes to MerchantSession +- holder_id attribute to MerchantPurchase ## [2.32.1] - 2026-02-24 ### Added diff --git a/starkbank/merchantpurchase/__merchantpurchase.py b/starkbank/merchantpurchase/__merchantpurchase.py index 25965a7..4d680e8 100644 --- a/starkbank/merchantpurchase/__merchantpurchase.py +++ b/starkbank/merchantpurchase/__merchantpurchase.py @@ -9,7 +9,7 @@ class MerchantPurchase(Resource): """ def __init__(self, amount, card_id, funding_type, installment_count, id=None, card_expiration=None, - card_number=None, card_security_code=None,holder_name=None, holder_email=None, holder_phone=None, + card_number=None, card_security_code=None,holder_name=None, holder_email=None, holder_phone=None, holder_id=None, billing_country_code=None, billing_city=None,billing_state_code=None, billing_street_line_1=None, billing_street_line_2=None, billing_zip_code=None, metadata=None, card_ending=None, challenge_mode=None, challenge_url=None, created=None, currency_code=None, end_to_end_id=None, @@ -24,6 +24,7 @@ def __init__(self, amount, card_id, funding_type, installment_count, id=None, ca self.holder_name = holder_name self.holder_email = holder_email self.holder_phone = holder_phone + self.holder_id = holder_id self.funding_type = funding_type self.billing_country_code = billing_country_code self.billing_city = billing_city diff --git a/starkbank/merchantsession/__merchantsession.py b/starkbank/merchantsession/__merchantsession.py index 3ed4802..a5b79f6 100644 --- a/starkbank/merchantsession/__merchantsession.py +++ b/starkbank/merchantsession/__merchantsession.py @@ -13,7 +13,7 @@ class MerchantSession(Resource): """ def __init__(self, allowed_funding_types, allowed_installments, expiration, id=None, allowed_ips=None, - challenge_mode=None, created=None, status=None, tags=None, updated=None, uuid=None): + challenge_mode=None, created=None, status=None, tags=None, updated=None, uuid=None, holder_id=None, soft_descriptor=None): Resource.__init__(self, id=id) self.allowed_funding_types = allowed_funding_types @@ -26,7 +26,8 @@ def __init__(self, allowed_funding_types, allowed_installments, expiration, id=N self.created = check_datetime(created) self.updated = check_datetime(updated) self.uuid = uuid - + self.holder_id = holder_id + self.soft_descriptor = soft_descriptor _resource = {"class": MerchantSession, "name": "MerchantSession"} diff --git a/starkbank/merchantsession/__purchase.py b/starkbank/merchantsession/__purchase.py index adabd13..ca61dad 100644 --- a/starkbank/merchantsession/__purchase.py +++ b/starkbank/merchantsession/__purchase.py @@ -8,7 +8,7 @@ class Purchase(Resource): """ def __init__(self, amount, card_expiration, card_number, card_security_code, holder_name, funding_type, id=None, - holder_email=None, holder_phone=None, installment_count=None, billing_country_code=None, + holder_email=None, holder_phone=None, holder_id=None, installment_count=None, billing_country_code=None, billing_city=None, billing_state_code=None, billing_street_line_1=None, billing_street_line_2=None, billing_zip_code=None, metadata=None, card_ending=None, card_id=None, challenge_mode=None, challenge_url=None, created=None, currency_code=None, end_to_end_id=None, fee=None, network=None, @@ -23,6 +23,7 @@ def __init__(self, amount, card_expiration, card_number, card_security_code, hol self.funding_type = funding_type self.holder_email = holder_email self.holder_phone = holder_phone + self.holder_id = holder_id self.installment_count = installment_count self.billing_country_code = billing_country_code self.billing_city = billing_city diff --git a/tests/utils/merchantPurchase.py b/tests/utils/merchantPurchase.py index 341bb70..4c8c743 100644 --- a/tests/utils/merchantPurchase.py +++ b/tests/utils/merchantPurchase.py @@ -47,6 +47,7 @@ def json_to_merchant_purchase(json_data): holder_name=json_data.get("holderName"), holder_email=json_data.get("holderEmail"), holder_phone=json_data.get("holderPhone"), + holder_id=json_data.get("holderId"), funding_type=json_data.get("fundingType"), billing_country_code=json_data.get("billingCountryCode"), billing_city=json_data.get("billingCity"), @@ -102,6 +103,7 @@ def generate_example_merchant_purchase_json(card_id): "billingZipCode": "11111-111", "holderEmail": "holdeName@email.com", "holderPhone": "11111111111", + "holderId": "565656555656", "metadata": { "userAgent": "userAgent", "userIp": "255.255.255.255", diff --git a/tests/utils/merchantSession.py b/tests/utils/merchantSession.py index 2e756aa..1496b2d 100644 --- a/tests/utils/merchantSession.py +++ b/tests/utils/merchantSession.py @@ -30,6 +30,8 @@ def json_to_merchant_session(json_data): challenge_mode=json_data.get("challengeMode"), expiration=json_data.get("expiration"), tags=json_data.get("tags"), + holder_id=json_data.get("holderId"), + soft_descriptor=json_data.get("softDescriptor"), ) @@ -37,20 +39,22 @@ def generate_example_merchant_session_json(challengeMode): merchant_session_json = { "allowedFundingTypes": ["debit", "credit"], "allowedInstallments": [ - {"totalAmount": 0, "count": 1}, - {"totalAmount": 120, "count": 2}, - {"totalAmount": 180, "count": 12}, + {"totalAmount": 500, "count": 1}, + {"totalAmount": 1000, "count": 2}, + {"totalAmount": 6000, "count": 12}, ], "expiration": 3600, "challengeMode": challengeMode, "tags": ["yourTags"], + "holderId": "565656565655656", + "softDescriptor": "softDescriptor", } return deepcopy(json_to_merchant_session(merchant_session_json)) def generate_example_merchant_session_purchase_challenge_mode_disabled_json(): merchant_session_purchase_json = { - "amount": 180, + "amount": 6000, "installmentCount": 12, "cardExpiration": "2035-01", "cardNumber": "5277696455399733", @@ -63,7 +67,7 @@ def generate_example_merchant_session_purchase_challenge_mode_disabled_json(): def generate_example_merchant_session_purchase_challenge_mode_enabled_json(): merchant_session_purchase_json = { - "amount": 180, + "amount": 6000, "installmentCount": 12, "cardExpiration": "2035-01", "cardNumber": "5277696455399733",