Class LOCPluginBean
- java.lang.Object
-
- com.ibm.commerce.payments.plugin.loc.beans.LOCPluginBean
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
COPYRIGHT
Copyright.
-
Constructor Summary
Constructors Constructor and Description LOCPluginBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description FinancialTransaction
approve(PluginContext pluginContext, FinancialTransaction paymentTransaction, boolean retry)
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present.FinancialTransaction
approveAndDeposit(PluginContext pluginContext, FinancialTransaction depositTransaction, boolean retry)
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present.boolean
checkHealth()
This method checks whether XML configuration for the Plugin is available.void
checkPaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction)
This method checks if StoreID, buyerOrgID, credit line account number for the specified PaymentInstruction are present and indicate everything is OK.FinancialTransaction
credit(PluginContext pluginContext, FinancialTransaction creditTransaction, boolean retry)
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present.FinancialTransaction
deposit(PluginContext pluginContext, FinancialTransaction paymentTransaction, boolean retry)
This method receives the deposit request, checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present.java.lang.String
getMessage(PluginContext pluginContext, java.lang.String messageKey)
This method returns the message from thePluginContext
according to the key of the message.void
postConstruct()
This method is the implementation of theejbCreate()
method.FinancialTransaction
reverseApproval(PluginContext pluginContext, FinancialTransaction paymentTransaction, boolean retry)
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present.FinancialTransaction
reverseCredit(PluginContext pluginContext, FinancialTransaction creditTransaction, boolean retry)
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present.FinancialTransaction
reverseDeposit(PluginContext pluginContext, FinancialTransaction paymentTransaction, boolean retry)
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present.void
validatePaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction)
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present.
-
-
-
Field Detail
-
COPYRIGHT
public static final java.lang.String COPYRIGHT
Copyright.- See Also:
- Constant Field Values
-
-
Method Detail
-
getMessage
public java.lang.String getMessage(PluginContext pluginContext, java.lang.String messageKey)
This method returns the message from thePluginContext
according to the key of the message.- Specified by:
getMessage
in interfacePlugin
- Parameters:
pluginContext
- The plug-in context to be used in this request.messageKey
- The error unique key.- Returns:
- The translated error message if available; otherwise the
messageKey
itself. - See Also:
Plugin.getMessage(PluginContext,String)
-
approve
public FinancialTransaction approve(PluginContext pluginContext, FinancialTransaction paymentTransaction, boolean retry) throws CommunicationException, PluginException
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.- Specified by:
approve
in interfacePlugin
- Parameters:
pluginContext
- Contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.paymentTransaction
- Contains the payment instruction and the amount requested to be approved.retry
- Indicates if this is a retry of the operation or not.- Returns:
- The financial transaction.
- Throws:
PluginInvalidParameterException
- raised with message PLUGIN_PARAMS_INVALID whenever account number or storeid or buyerorgid the payment transaction associated to is null.PluginException
- Thrown when any exception conditions specified by thePluginException
hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.CommunicationException
- See Also:
Plugin.approve(PluginContext,FinancialTransaction,boolean)
-
approveAndDeposit
public FinancialTransaction approveAndDeposit(PluginContext pluginContext, FinancialTransaction depositTransaction, boolean retry) throws FunctionNotSupportedException, PluginException
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.- Specified by:
approveAndDeposit
in interfacePlugin
- Parameters:
pluginContext
- Contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.depositTransaction
- Contains the amount and other data required to process the action.retry
- Indicates if his is a retry of the operation or not.- Returns:
- The financial transaction.
- Throws:
InvalidDataException
- raised with message PLUGIN_PARAM_INVALID whenever account number or store or buyerOrgid of PaymentInstructuon the transaction associated with is null.PluginException
- Thrown when any exception conditions specified by thePluginException
hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.FunctionNotSupportedException
- See Also:
Plugin.approveAndDeposit(PluginContext,FinancialTransaction,boolean)
-
checkPaymentInstruction
public void checkPaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction) throws InvalidPaymentInstructionException, ConfigurationException, InvalidDataException
This method checks if StoreID, buyerOrgID, credit line account number for the specified PaymentInstruction are present and indicate everything is OK.- Specified by:
checkPaymentInstruction
in interfacePlugin
- Parameters:
pluginContext
- contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.paymentInstruction
- contains the Payment Method information plus any additional data require to process the payment.- Throws:
InvalidDataException
- thrown with message PLUGIN_PARAMS_INVALID if the paymentInstruction contains null accountnumber or store or buyserorgid.InvalidPaymentInstructionException
ConfigurationException
- See Also:
Plugin.checkPaymentInstruction(PluginContext,PaymentInstruction)
-
credit
public FinancialTransaction credit(PluginContext pluginContext, FinancialTransaction creditTransaction, boolean retry) throws PluginException
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.- Specified by:
credit
in interfacePlugin
- Parameters:
pluginContext
- Contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.creditTransaction
- Contains the amount and other data required to process the action.retry
- Indicates if his is a retry of the operation or not.- Returns:
- The credit transaction.
- Throws:
InvalidDataException
- raised with message PLUGIN_PARAM_INVALID whenever account number or store or buyerOrgid of PaymentInstruction the transaction associated to is null.PluginException
- Thrown when any exception conditions specified by thePluginException
hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.- See Also:
Plugin.credit(PluginContext,FinancialTransaction,boolean)
-
deposit
public FinancialTransaction deposit(PluginContext pluginContext, FinancialTransaction paymentTransaction, boolean retry) throws PluginException
This method receives the deposit request, checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.- Specified by:
deposit
in interfacePlugin
- Parameters:
pluginContext
- Contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.paymentTransaction
- Contains the amount and other data required to process the action.retry
- Indicates if his is a retry of the operation or not.- Returns:
- The financial transaction.
- Throws:
InvalidDataException
- raised with message PLUGIN_PARAMS_INVALID when account number or storeid or buyerorgid the payment transaction associated to is null.PluginException
- Thrown when any exception conditions specified by thePluginException
hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.- See Also:
Plugin.deposit(PluginContext,FinancialTransaction,boolean)
-
postConstruct
@PostConstruct public void postConstruct()
This method is the implementation of theejbCreate()
method. It calls the methodLOCPluginInitializer.init()
to make sureLOCPlugin
logger initialization has run.- Throws:
javax.ejb.CreateException
-
reverseApproval
public FinancialTransaction reverseApproval(PluginContext pluginContext, FinancialTransaction paymentTransaction, boolean retry) throws CommunicationException, PluginException
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.- Specified by:
reverseApproval
in interfacePlugin
- Parameters:
pluginContext
- Contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.paymentTransaction
- Contains the amount and other data required to process the action.retry
- Indicates if his is a retry of the operation or not.- Returns:
- The financial transaction.
- Throws:
InvalidDataException
- raised with message PLUGIN_PARAM_INVALID whenever account number or store or buyerOrgid of PaymentInstruction the transaction associated to is null.PluginException
- Thrown when any exception conditions specified by thePluginException
hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.CommunicationException
- See Also:
Plugin.reverseApproval(PluginContext,FinancialTransaction,boolean)
-
reverseCredit
public FinancialTransaction reverseCredit(PluginContext pluginContext, FinancialTransaction creditTransaction, boolean retry) throws InvalidPaymentInstructionException, FunctionNotSupportedException, InvalidDataException
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.
The credit can be a dependent credit or independent credit transaction.
- Specified by:
reverseCredit
in interfacePlugin
- Parameters:
pluginContext
- Contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.creditTransaction
- Contains the amount and other data required to process the action.retry
- Indicates if his is a retry of the operation or not.- Returns:
- The credit transaction.
- Throws:
InvalidDataException
- raised with message PLUGIN_PARAM_INVALID whenever account number or store or buyerOrgid of paymentInstruction the transaction associated to is null.InvalidPaymentInstructionException
FunctionNotSupportedException
- See Also:
Plugin.reverseCredit(PluginContext,FinancialTransaction,boolean)
-
reverseDeposit
public FinancialTransaction reverseDeposit(PluginContext pluginContext, FinancialTransaction paymentTransaction, boolean retry) throws FunctionNotSupportedException, PluginException
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.- Specified by:
reverseDeposit
in interfacePlugin
- Parameters:
pluginContext
- Contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.paymentTransaction
- Contains the amount and other data required to process the action.retry
- Indicates if his is a retry of the operation or not.- Returns:
- The financial transaction.
- Throws:
InvalidDataException
- raised with message PLUGIN_PARAM_INVALID whenever account number or store or buyerOrgid of paymentInstruction the transaction associated to is null.PluginException
- Thrown when any exception conditions specified by thePluginException
hierarchy are met; for more details, read the plug-in exceptions hierarchy Javadocs.FunctionNotSupportedException
- See Also:
Plugin.reverseDeposit(PluginContext,FinancialTransaction,boolean)
-
validatePaymentInstruction
public void validatePaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction) throws InvalidPaymentInstructionException, FunctionNotSupportedException
This method checks if StoreID, buyerOrgID, credit line account number for the specified Payment Instruction are present. If yes, it returns successfully; if no, it throws exceptions.- Specified by:
validatePaymentInstruction
in interfacePlugin
- Parameters:
pluginContext
- contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.paymentInstruction
- contains the Payment Method information plus any additional data required to process the payment.- Throws:
PluginException
- by spec; InvalidDataException thrown with message PLUGIN_PARAM_INVALID whenever account number or store or buyerOrgid isnull
.InvalidPaymentInstructionException
FunctionNotSupportedException
- See Also:
Plugin.validatePaymentInstruction(PluginContext,PaymentInstruction)
-
checkHealth
public boolean checkHealth()
This method checks whether XML configuration for the Plugin is available. For the SimpleOffline, if the XML file is missing, or renamed, or its content is invalid, then false is returned; otherwise true is returned. And for other Plugin, always true is returned since no corresponding XML configuration file exists.
This API is used by PluginFactory in accelerator. When false is returned, PluginFacotry will not put this plugin into the available collection. And further it will not be listed in the available payment methods in accelerator.
- Specified by:
checkHealth
in interfacePlugin
- Returns:
- A
boolean
that istrue
if the XML configuration for the Plugin is available,otherwisefalse
.
-
-