public final class RedsysTransaction extends Transaction
Transaction
class. It just add some Redsys related
functionality, like Redsys random number generation as well as encrypted PIN block generation.Modifier and Type | Method and Description |
---|---|
byte[] |
calcMAC(RedsysProcessorSlotEnum slotId,
byte[] data)
Calculate a MAC hash over the data using the key under slot id.
|
static RedsysTransaction |
getInstance()
Gets the instance of the
RedsysTransaction singleton |
java.lang.String |
getPinBlock(java.lang.String pan,
int amount,
int currency,
int timeout)
Ask user for a secure PIN entry at a secure processor side and get it encrypted
|
byte[] |
getRandomNumber()
Get a current Redsys random number from a secure processor
|
void |
newRandomNumber()
Instruct a secure processor to generate a new Redsys random number
|
void |
openTransactionSession(int timeoutMs)
Opens an EMV transaction session with the secure-processor
|
void |
setPinBlockSlotId(RedsysProcessorSlotEnum slotId)
Set CPIN key slot id for a PINBLOCK operation
|
cancelOngoingTransaction, cancelTransaction, clearTransactionConfig, closeTransactionSession, getEMVConfigsFromCurrentGateway, getEMVTag, getMSRToken, getTransactions, isTransactionInProgress, isTransactionSessionOpened, registerTransactionDisplayListener, settleTransaction, setTransactionConfig, startTransaction, startTransaction, unregisterCurrentTransactionDisplayListener
public static RedsysTransaction getInstance()
RedsysTransaction
singletonRedsysTransaction
objectpublic void openTransactionSession(int timeoutMs) throws java.lang.Exception
openTransactionSession
in class Transaction
timeoutMs
- Timeout in milliseconds. If timeoutMs is <= 0, internal default timeout will be usedjava.lang.IllegalAccessException
- if an EMV transaction session is already openedjava.io.IOException
- if the EMV transaction session cannot be opened due to IO errorsjava.lang.Exception
- for other types of exceptionspublic java.lang.String getPinBlock(java.lang.String pan, int amount, int currency, int timeout) throws java.lang.Exception
pan
- card PAN used in the pin block encryptionamount
- amount value to be presented at the screencurrency
- amount currencytimeout
- operation timeoutjava.lang.Exception
- if a secure processor reports an errorpublic void newRandomNumber() throws java.lang.Exception
java.lang.Exception
- if a secure processor reports an errorpublic byte[] getRandomNumber() throws java.lang.Exception
java.lang.Exception
- if a secure processor reports an errorpublic void setPinBlockSlotId(RedsysProcessorSlotEnum slotId) throws java.lang.Exception
slotId
- - CPIN slot id for the futher PINBLOCK calculationjava.lang.Exception
- if a secure processor reports an errorpublic byte[] calcMAC(RedsysProcessorSlotEnum slotId, byte[] data) throws java.lang.Exception
slotId
- - MAC key slot iddata
- - data to be MAC'edjava.lang.Exception
- - if a secure processor reports an errorCopyright © 2019 Yello. All rights reserved.