public class SimpleOfflineBean
extends java.lang.Object
implements javax.ejb.SessionBean
Constructor and Description |
---|
SimpleOfflineBean()
The constructor of this class.
|
Modifier and Type | Method and Description |
---|---|
FinancialTransaction | approve(PluginContext pluginContext, FinancialTransaction approveTransaction, boolean retry)
This method approves an amount against a Payment Instruction.
|
FinancialTransaction | approveAndDeposit(PluginContext pluginContext, FinancialTransaction approveAndDepositTransaction, boolean retry)
This method deposits a payment without a prior approval.
|
boolean | checkHealth()
This method checks whether XML configuration for the Plugin is available.
|
void | checkPaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction)
This method checks if a Payment instruction has all required parameters and is syntactically correct.
|
FinancialTransaction | credit(PluginContext pluginContext, FinancialTransaction creditTransaction, boolean retry)
This method credits the requested amount.
|
FinancialTransaction | deposit(PluginContext pluginContext, FinancialTransaction depositTransaction, boolean retry)
This method deposits an amount against an Approved Payment.
|
void | ejbActivate()
This is the implementation of the ejbActivate method(It does nothing here).
|
void | ejbCreate()
This is the implementation of the ejbCreate method(It does nothing here).
|
void | ejbPassivate()
This is the implementation of the ejbPassivate method(It does nothing here).
|
void | ejbRemove()
This is the implementation of the ejbRemove method(It does nothing here).
|
java.lang.String | getMessage(PluginContext pluginContext, java.lang.String messageKey)
This method returns the Translated error String associated to an error key.
|
javax.ejb.SessionContext | getSessionContext()
This method returns the SessionContext.
|
FinancialTransaction | reverseApproval(PluginContext pluginContext, FinancialTransaction reverseApprovalTransaction, boolean retry)
This method cancels a payment that has been approved with no deposits against it.
|
FinancialTransaction | reverseCredit(PluginContext pluginContext, FinancialTransaction reverseCreditTransaction, boolean retry)
This method cancels the specified credit.
|
FinancialTransaction | reverseDeposit(PluginContext pluginContext, FinancialTransaction reverseDepositTransaction, boolean retry)
This method cancels a deposited amount against a the specified payment.
|
void | setSessionContext(javax.ejb.SessionContext ctx)
This method sets the SessionContext.
|
void | validatePaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction)
This method refreshes the current attributes of the Payment object.
|
public java.lang.String getMessage(PluginContext pluginContext, java.lang.String messageKey) throws PluginException
This method returns the Translated error String associated to an error key.
public void setSessionContext(javax.ejb.SessionContext ctx)
public javax.ejb.SessionContext getSessionContext()
public FinancialTransaction approve(PluginContext pluginContext, FinancialTransaction approveTransaction, boolean retry) throws PluginException
This method approves an amount against a Payment Instruction. Approve is meant to reserve funds on the particular payment method/type. For example in credit cards this maps auth to authorization.
The SimpleOffline Plugin will do nothing and return successfully when the payment method does not keep pending status. Otherwise the SimpleOffline plugin receives the approval request and set the financial transaction in PENDING state, this state is stored in PPC tables. The approval request will be processed offline.
public FinancialTransaction approveAndDeposit(PluginContext pluginContext, FinancialTransaction approveAndDepositTransaction, boolean retry) throws PluginException
This method deposits a payment without a prior approval. Some systems call this a "sale" transaction and others an "auth with capture" transaction.
The SimpleOffline Plugin will do nothing and return successfully when payment method does not keep pending status. Otherwise the SimpleOffline plugin receives the approvalAndDeposit request and set the financial transaction in PENDING state, this state is stored in PPC tables. The approvalAndDeposit request will be processed offline.
public void checkPaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction) throws PluginException
This method checks if a Payment instruction has all required parameters and is syntactically correct.
The SimpleOffline Plugin will check the parameters defined in the Payment Method XML file.
public FinancialTransaction credit(PluginContext pluginContext, FinancialTransaction creditTransaction, boolean retry) throws PluginException
This method credits the requested amount. This credit method supports both dependent and independent credits.
The SimpleOffline Plugin will do nothing and return successfully when payment method does not keep pending status. Otherwise SimpleOffline plugin receives the credit request and set the financial transaction in PENDING state, this state is stored in PPC tables. The credit transaction will be executed offline to transfer funds from the buyer to the seller. The credit can be a dependent credit or independent credit transaction.
public FinancialTransaction deposit(PluginContext pluginContext, FinancialTransaction depositTransaction, boolean retry) throws PluginException
This method deposits an amount against an Approved Payment. This is typically invoked after the merchant has shipped the goods and is now entitled to receive payment.
The SimpleOffline Plugin will do nothing and return successfully when payment method does not keep pending status. Otherwise the SimpleOffline Plugin receives the deposit request and set the financial transaction in PENDING state, this state is stored in PPC tables. The deposit transaction will be executed offline to transfer the allocated funds on the payment partially or totally from the buyer to the seller.
public void ejbActivate()
public void ejbCreate() throws javax.ejb.CreateException
public void ejbPassivate()
public void ejbRemove()
public FinancialTransaction reverseApproval(PluginContext pluginContext, FinancialTransaction reverseApprovalTransaction, boolean retry) throws PluginException
This method cancels a payment that has been approved with no deposits against it.
The SimpleOffline Plugin will do nothing and return successfully when payment method does not keep pending status. Otherwise SimpleOffline plugin receives the reverseApproval request and set the financial transaction in PENDING status, this status is stored in PPC tables. The reverseApproval transaction will be executed offline to cancel the allocation of fund on a payment already approved.
public FinancialTransaction reverseCredit(PluginContext pluginContext, FinancialTransaction reverseCreditTransaction, boolean retry) throws PluginException
This method cancels the specified credit.
The SimpleOffline Plugin will do nothing and return successfully when payment method does not keep pending status. Otherwise SimpleOffline plugin receives the reverseCredit request and set the financial transaction in PENDING state, this state is stored in PPC tables. The reverseCredit transaction will be executed offline to cancel the transfer of fund from a seller to a buyer of a credit transaction. The credit can be a dependent credit or independent credit transaction.
public FinancialTransaction reverseDeposit(PluginContext pluginContext, FinancialTransaction reverseDepositTransaction, boolean retry) throws PluginException
This method cancels a deposited amount against a the specified payment.
The SimpleOffline Plugin will do nothing and return successfully when payment method does not keep pending status. Otherwise the SimpleOffline plugin receives the reverseDeposit request and set the financial transaction in PENDING state, this state is stored in PPC tables. The reverseDeposit transaction will be executed offline to cancel the transfer of fund of a deposit transaction.
public void validatePaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction) throws PluginException
The SimpleOffline Plugin does not support this API.
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.