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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion starkbank/merchantpurchase/__merchantpurchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions starkbank/merchantsession/__merchantsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"}

Expand Down
3 changes: 2 additions & 1 deletion starkbank/merchantsession/__purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/utils/merchantPurchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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",
Expand Down
14 changes: 9 additions & 5 deletions tests/utils/merchantSession.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,31 @@ 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"),
)


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",
Expand All @@ -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",
Expand Down
Loading