Exemplo n.º 1
0
def END_EMV_cmd(connection, timeout = 0):
    """
    Sends a **END_EMV** command and waits for an answer from the SPOT.
    :Parameters:
        - *connection* (PupySPOT): Object managing spot connection.
        - *timeout* (integer): Timeout for ``recv_END_EMV_cmd`` function.
    :Returns: ``None`` if command is Successful.    
    """ 
    send_END_EMV_cmd(connection)
    return Utility.assertSuccess(recv_END_EMV_cmd(connection,timeout))
Exemplo n.º 2
0
def START_EMV_2_PHASE_2_cmd(connection, amount = 0, timeout = 0):
    """
    Sends a **START_EMV_2_PHASE_2** command and waits for an answer from the SPOT.
    :Parameters:
        - *connection* (PupySPOT): Object managing spot connection.
        - *amount* (dword): This is the amount used for pre-authorisation or pre-payment.
        - *timeout* (integer): Timeout for ``recv_START_EMV_2_PHASE_2_cmd` function.
    :Returns: ``None`` if command is Successful.
    """
    send_START_EMV_2_PHASE_2_cmd(connection, amount)
    return Utility.assertSuccess(recv_START_EMV_2_PHASE_2_cmd(connection, timeout = 0))
Exemplo n.º 3
0
def ACTION_EMV_cmd(connection, olaForced = ACTION_NEXT_COMMAND_NONE, amount = 0, timeout = 0):
    """
    Sends a **ACTION_EMV** command and waits for an answer from the SPOT.
    :Parameters:
        - *connection* (PupySPOT): Object managing spot connection.
        - *olaForced* (byte): The flag parameter (if asserted) overrides the decision of ICC and EMV kernel and forces online decision. For example, EPS may consider suspiciously some transactions and require them to be forced online.
        - *amount* (dword): The Amount parameter (4 bytes binary data) is optional and when is specified overrides the amount specified with the ``START_EMV`` or ``START_EMV_1`` or ``START_EMV_2_PHASE_2`` command at the beginning of current transaction.
        - *timeout* (integer): Timeout for ``recv_ACTION_EMV_cmd`` function.
    :Returns: ``None`` if command is Successful.    
    """ 
    send_ACTION_EMV_cmd(connection, olaForced, amount)
    return Utility.assertSuccess(recv_ACTION_EMV_cmd(connection, timeout))
Exemplo n.º 4
0
def START_EMV_cmd(connection, currentDateAndTime, amount = 0, nextCommand = START_NEXT_COMMAND_NONE, timeout = 0):
    """
    Sends a **START_EMV** command and waits for an answer from the SPOT.
    :Parameters:
        - *connection* (PupySPOT): Object managing spot connection.
        - *currentDateAndTime* (binary string): Synchronisation of SPOT internal clock with the terminal one before starting the EMV transaction. Six ASCII hex for YYMMDDHHMMSS.
        - *amount* (dword): This is the amount used for pre-authorisation or pre-payment. It is 4 bytes binary data.
        - *nextCommand* (byte): This flag allows proceeding with the operations that normally are performed by next command.
        - *timeout* (integer): Timeout for ``recv_START_EMV_cmd`` function.
    :Returns: ``None`` if command is Successful.
    """ 
    send_START_EMV_cmd(connection, currentDateAndTime, amount, nextCommand)
    return Utility.assertSuccess(recv_START_EMV_cmd(connection, timeout))
Exemplo n.º 5
0
def START_EMV_2_cmd(connection, nextCommand = 0, timeout = 0):
    """
    Sends a **START_EMV_2** command and waits for an answer from the SPOT.
    :Parameters:
        - *connection* (PupySPOT): Object managing spot connection.
        - nextCommand (byte):
            - 0x00 = like START_EMV_2 without optional flag,
            - 0x01 = pausing processing just before EMV phase "Get Processing Options.
        - *timeout* (integer): Timeout for ``recv_START_EMV_2_cmd`` function.
    :Returns: ``None`` if command is Successful.    
    """
    send_START_EMV_2_cmd(connection, nextCommand)
    return Utility.assertSuccess(recv_START_EMV_2_cmd(connection, timeout))
Exemplo n.º 6
0
def OLA_EMV_cmd(connection, hostDecision, hostResponse, authCode, issData, script71Tuple = (), script72Tuple = (), timeout = 0):
    """
    Sends a **OLA_EMV** command and waits for an answer from the SPOT.
    :Parameters:
        - *connection* (PupySPOT): Object managing spot connection.
        - *hostDecision* (byte): 
            - 0x30 = authorised,
            - 0x31 = denied,
            - 0x32 = denied \- pick up the card,
            - 0x39 and other values = error or fail to connect to host.
        - *hostResponse* (word): This is normally the ISO8583/1987 two digits response/action code or "00" if not available.
        - *authCode* (binary string): Authorisation Code from ISO8583 bitmap 38 (six alphanum); it will be saved into DB with tag89.
        - *issData* (binary string): The "Iss data for authorisation" to be saved on DB as tag 91. First 8 bytes are the ARPC and are mandatory the rest should be optional but normally at least 2 bytes with ARC are present.
        - *script71Tuple* (tuple): List of "File Id" to use for download the EMV files type 0x22, used for issuer script 71.
        - *script72Tuple* (tuple): List of "File Id" to use for download the EMV files type 0x22, used for issuer script 72.
        - *timeout* (integer): Timeout for ``recv_OLA_EMV_cmd`` function.
    :Returns: ``None`` if command is Successful.
    """ 
    send_OLA_EMV_cmd(connection, hostDecision, hostResponse, authCode, issData, script71Tuple, script72Tuple)
    return Utility.assertSuccess(recv_OLA_EMV_cmd(connection, timeout))