Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

Commit bff7c02

Browse files
authored
Merge pull request #23 from przemobe/main
Add argument for PSE name, fix passing PDOL
2 parents 7e89975 + 44f24dc commit bff7c02

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

emv/card.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def get_mf(self):
2727
"""Get the master file (MF)."""
2828
return self.tp.exchange(SelectCommand(file_identifier=[0x3F, 0x00]))
2929

30-
def get_pse(self):
30+
def get_pse(self, pse="1PAY.SYS.DDF01"):
3131
"""Get the Payment System Environment (PSE) file"""
32-
return self.tp.exchange(SelectCommand("1PAY.SYS.DDF01"))
32+
return self.tp.exchange(SelectCommand(pse))
3333

3434
def list_applications(self):
3535
"""List applications on the card"""
@@ -125,8 +125,8 @@ def get_metadata(self):
125125

126126
return data
127127

128-
def get_processing_options(self):
129-
res = self.tp.exchange(GetProcessingOptions())
128+
def get_processing_options(self, pdol=None):
129+
res = self.tp.exchange(GetProcessingOptions(pdol))
130130
if Tag.RMTF1 in res.data:
131131
# Response template format 1
132132
return {"AIP": res.data[Tag.RMTF1][:2], "AFL": res.data[Tag.RMTF1][2:]}

emv/protocol/command.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,6 @@ def __init__(self, pdol=None):
221221
if pdol is None:
222222
self.data = [0x83, 0x00]
223223
else:
224-
self.data = pdol
224+
self.data = [0x83, len(pdol)]
225+
self.data.extend(pdol)
225226
self.le = 0x00

0 commit comments

Comments
 (0)