public class TransactionConfiguration
extends java.lang.Object
implements java.io.Serializable
Transaction
singleton class:
Transaction.setTransactionConfig(TransactionConfiguration)
Transaction.startTransaction(TransactionConfiguration, TransactionType, BigDecimal, BigDecimal)
Transaction.setTransactionConfig(TransactionConfiguration)
while an EMV transaction is in
progress. Any attempt to do so will result in an IllegalAccessException
.
Transaction
SingletonTransaction trans = Transaction.getInstance(); TransactionConfiguration config = new TransactionConfiguration("EUR", "TestMerchantID", true, true, false); trans.setTransactionConfig(config);
Transaction
SingletonTransactionConfiguration config = new TransactionConfiguration("EUR", "TestMerchantID", true, true, false); trans.openTransactionSession(0); TransactionStatus status = trans.startTransaction(config, TransactionType.PURCHASE, new BigDecimal("1.0"), new BigDecimal("0.0")); trans.closeTransactionSession();
TransactionConfiguration config = new TransactionConfiguration("EUR", "TestMerchantID", true, true, true); ... config.setCurrency("USD");NOTE: Any update performed on the EMV configuration after setting it via the
Transaction
singleton class will NOT be accounted for by the
Yello EMV transaction library as long as it NOT set again via the method
Transaction.setTransactionConfig(TransactionConfiguration)
. This is due to the fact that
the Transaction
singleton class makes a copy of the EMV
configuration at setup time to avoid issues if the user modifies the configuration
while an EMV transaction is in progress.Transaction
singleton class.Constructor and Description |
---|
TransactionConfiguration(java.lang.String currencyAlphabeticCode,
java.lang.String merchantID,
boolean forceOnline,
boolean enableEntryPoint,
boolean autoSettle)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
enableEntryPoint(boolean enable)
Sets the entry-point option
When enabled, if a new presentation of the card is required during a transaction the Yello transaction framework will wait for the cardholder to present his card again. When NOT enabled, if a new presentation of the card is required during a transaction, the transaction will be terminated immediately. |
void |
enableForceOnline(boolean forceOnline)
Set force-online option
|
int |
getCardPollTimeoutMs()
Gets the card poll timeout in milliseconds
|
java.lang.String |
getCategoryCode()
Gets the transaction category code
|
java.lang.String |
getCurrencyAlphabeticCode()
Gets Currency Alphabetic Code of the currency set in the EMV configuration
|
java.lang.Integer |
getCurrencyNumericCode()
Gets Currency Numeric Code of the currency set in the EMV configuration
|
EMVKernelType[] |
getEmvKernelTypes()
Gets the list of EMV kernels to use for the transaction
|
EMVTagReader |
getGatewayConfigTagStore()
Gets the configTagStore to use during the transaction
|
java.util.Map<java.lang.String,java.lang.String> |
getGatewayData()
Get the custom data for the gateway
|
java.lang.String |
getMerchantID()
Get merchant ID specified within the EMV configuration
|
int |
getTransactionTimeout()
Gets the transaction processing timeout in seconds
|
boolean |
isAutoSettle()
Checks if auto-settlement feature is enabled within the EMV configuration
|
boolean |
isEntryPointEnabled()
Checks if the entry-point option is enabled within the EMV configuration
|
boolean |
isForceOnline()
Checks whether force online authorization is enabled or not
|
void |
setAutoSettle(boolean autoSettle)
Sets the auto-settlement feature.
|
void |
setCardPollTimeoutMs(int cardPollTimeoutMs)
Sets the card poll timeout in milliseconds
|
void |
setCategoryCode(java.lang.String categoryCode)
Sets the transaction category code
|
void |
setCurrency(int currencyNumericCode)
Sets the currency of the EMV configuration
|
void |
setCurrency(java.lang.String currencyAlphabeticCode)
Sets the currency of the EMV configuration
|
void |
setEmvKernelTypes(EMVKernelType[] emvKernelTypes)
Sets the list of EMV kernels to use for the transaction
|
void |
setGatewayConfigTagStore(EMVTagReader gatewayConfigTagStore)
Sets the configTagStore to use during the transaction
|
void |
setGatewayData(java.util.Map<java.lang.String,java.lang.String> gatewayData)
Set the custom data for the gateway
|
void |
setMerchantID(java.lang.String merchantID)
Sets the merchant ID
|
void |
setTransactionTimeout(int transactionTimeoutSeconds)
Sets the transaction processing timeout in seconds
|
public TransactionConfiguration(java.lang.String currencyAlphabeticCode, java.lang.String merchantID, boolean forceOnline, boolean enableEntryPoint, boolean autoSettle) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
currencyAlphabeticCode
- Currency Alphabetic code as defined by ISO 4217merchantID
- String ID of the merchantforceOnline
- Indicate whether to force online authorization for each transactionenableEntryPoint
- Indicate whether to enable entry point option
(More information provided in
enableEntryPoint(boolean)
autoSettle
- Indicates whether to automatically settle the transaction with the
transaction gateway if the transaction is approved.
NOTE: if the transaction gateway requires auto-settlement, transaction will
automatically be settled upon approval whether or not autoSettle parameter
is set within the EMV configuration.java.lang.NullPointerException
- if currencyAlphabeticCode is not valid (null, empty or invalid)java.lang.IllegalArgumentException
- if merchantID string is null or emptypublic boolean isForceOnline()
public void enableForceOnline(boolean forceOnline)
forceOnline
- Boolean indicating whether to force online authorization for
each transactionpublic java.lang.String getCurrencyAlphabeticCode()
public java.lang.Integer getCurrencyNumericCode()
public void setCurrency(java.lang.String currencyAlphabeticCode) throws java.lang.NullPointerException
currencyAlphabeticCode
- Currency Alphabetic Code as defined by ISO 4217java.lang.NullPointerException
- if currencyAlphabeticCode is not valid (null, empty or invalid)public void setCurrency(int currencyNumericCode) throws java.lang.NullPointerException
currencyNumericCode
- Currency Numeric Code as defined by ISO 4217java.lang.NullPointerException
- if currencyNumericCode is not validpublic java.lang.String getCategoryCode()
public void setCategoryCode(java.lang.String categoryCode) throws java.lang.IllegalArgumentException
categoryCode
- String identifying the transaction category codejava.lang.IllegalArgumentException
- if categoryCode is null or is emptypublic boolean isEntryPointEnabled()
public void enableEntryPoint(boolean enable)
enable
- Boolean indicating whether to enable entry-point option.public java.lang.String getMerchantID()
public void setMerchantID(java.lang.String merchantID) throws java.lang.IllegalArgumentException
merchantID
- String identifying the merchant IDjava.lang.IllegalArgumentException
- if merchantID is null or emptypublic boolean isAutoSettle()
public void setAutoSettle(boolean autoSettle)
autoSettle
- Boolean indicating wheter or not to auto-settle the EMV transaction upon
approval.public int getCardPollTimeoutMs()
public void setCardPollTimeoutMs(int cardPollTimeoutMs)
cardPollTimeoutMs
- card poll timeout in milliseconds. If cardPollTimeoutMs is <= 0,
internal default timeout will be used.public int getTransactionTimeout()
public void setTransactionTimeout(int transactionTimeoutSeconds)
transactionTimeoutSeconds
- transaction processing timeout in seconds.
If transactionTimeoutSeconds is <= 0, internal default
timeout will be used.public EMVKernelType[] getEmvKernelTypes()
EMVKernelType
public void setEmvKernelTypes(EMVKernelType[] emvKernelTypes)
emvKernelTypes
- byte array of EMVKernelType
public EMVTagReader getGatewayConfigTagStore()
EMVTagReader
containing the config tags to usepublic void setGatewayConfigTagStore(EMVTagReader gatewayConfigTagStore)
gatewayConfigTagStore
- EMVTagReader
containing the config tags to usepublic void setGatewayData(java.util.Map<java.lang.String,java.lang.String> gatewayData)
gatewayData
- custom data that can be required by the gateway for the transactionpublic java.util.Map<java.lang.String,java.lang.String> getGatewayData()
Copyright © 2019 Yello. All rights reserved.