Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
Copyright.
|
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.
|
java.lang.String |
getMessage(PluginContext pluginContext,
java.lang.String messageKey)
This method returns the Translated error String associated to an error key.
|
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 |
validatePaymentInstruction(PluginContext pluginContext,
PaymentInstruction paymentInstruction)
This method refreshes the current attributes of the Payment object.
|
public static final java.lang.String COPYRIGHT
public java.lang.String getMessage(PluginContext pluginContext, java.lang.String messageKey)
This method returns the Translated error String associated to an error key.
getMessage
in interface Plugin
pluginContext
- includes the target locale used by the client requesting the translated message.messageKey
- represents the error for which the translated message needs to be obtained.PluginException
- This exception is not thrown by SimpleOffline plug-in.public FinancialTransaction approve(PluginContext pluginContext, FinancialTransaction approveTransaction, boolean retry) throws CommunicationException, 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.
approve
in interface Plugin
pluginContext
- contains all the information needed by a plugin to process the request which are obtained from the deployment descriptor.approveTransaction
- contains the payment instruction and the amount requested to be approvedretry
- indicates this is a retry of the operationFinancialTransaction
that represents the updated approve financial transaction.InvalidPaymentInstructionException
- thrown when the SimpleOfflineConstants.PAYMENT_METHOD is not included in the Payment instruction's extended dataPluginException
- Thrown when any exception conditions specified by the
PluginException
hierarchy are met; for more details, read the
plug-in exceptions hierarchy Javadocs.CommunicationException
Plugin.approve(PluginContext,FinancialTransaction,boolean)
public FinancialTransaction approveAndDeposit(PluginContext pluginContext, FinancialTransaction approveAndDepositTransaction, boolean retry) throws FunctionNotSupportedException, 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.
approveAndDeposit
in interface Plugin
pluginContext
- contains all the information needed by a plugin to process the request which are obtained from the deployment descriptor.approveAndDepositTransaction
- contains the amount and other payment protocol data required to process the transaction.retry
- indicates this is a retry of the operationFinancialTransaction
that represents the updated approveAndDeposit financial transaction.InvalidPaymentInstructionException
- thrown when the SimpleOfflineConstants.PAYMENT_METHOD is not included in the Payment instruction's extended dataPluginException
- Thrown when any exception conditions specified by the
PluginException
hierarchy are met; for more details, read the
plug-in exceptions hierarchy Javadocs.FunctionNotSupportedException
Plugin.approveAndDeposit(PluginContext,FinancialTransaction,boolean)
public void checkPaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction) throws InvalidPaymentInstructionException, ConfigurationException, InvalidDataException
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.
checkPaymentInstruction
in interface Plugin
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.InvalidPaymentInstructionException
- thrown when the extended data do not have the required protocol data defined in the SimpleOffline configuration file or the length of the protocol data is not in the allowed rangeConfigurationException
InvalidDataException
Plugin.checkPaymentInstruction(PluginContext,PaymentInstruction)
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.
credit
in interface Plugin
pluginContext
- contains all the information needed by a plugin to process the request which are obtained from the deployment descriptor.creditTransaction
- contains the required information to process the creditretry
- indicates this is a retry of the operationFinancialTransaction
that represents the updated credit financial transaction.InvalidPaymentInstructionException
- thrown when the PaymentInstruction.PAYMENT_METHOD is not included in the Payment instruction's extended dataPluginException
- Thrown when any exception conditions specified by the
PluginException
hierarchy are met; for more details, read the
plug-in exceptions hierarchy Javadocs.Plugin.credit(PluginContext,FinancialTransaction,boolean)
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.
deposit
in interface Plugin
pluginContext
- contains all the information needed by a plugin to process the request which are obtained from the deployment descriptor.depositTransaction
- contains the payment instruction and the amount requested to be approvedretry
- indicates this is a retry of the operationFinancialTransaction
that represents the updated deposit financial transaction.InvalidPaymentInstructionException
- thrown when the PaymentInstruction.PAYMENT_METHOD is not included in the Payment instruction's extended dataPluginException
- Thrown when any exception conditions specified by the
PluginException
hierarchy are met; for more details, read the
plug-in exceptions hierarchy Javadocs.Plugin.deposit(PluginContext,FinancialTransaction,boolean)
public FinancialTransaction reverseApproval(PluginContext pluginContext, FinancialTransaction reverseApprovalTransaction, boolean retry) throws CommunicationException, 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.
reverseApproval
in interface Plugin
pluginContext
- contains all the information needed by a plugin to process the request which are obtained from the deployment descriptor.reverseApprovalTransaction
- contains the amount and other data required to process the action.retry
- indicates this is a retry of the operationFinancialTransaction
that represents the updated reverseApproval financial transaction.InvalidPaymentInstructionException
- thrown when the PaymentInstruction.PAYMENT_METHOD is not included in the Payment instruction's extended dataPluginException
- Thrown when any exception conditions specified by the
PluginException
hierarchy are met; for more details, read the
plug-in exceptions hierarchy Javadocs.CommunicationException
Plugin.reverseApproval(PluginContext,FinancialTransaction,boolean)
public FinancialTransaction reverseCredit(PluginContext pluginContext, FinancialTransaction reverseCreditTransaction, boolean retry) throws InvalidPaymentInstructionException, FunctionNotSupportedException, InvalidDataException
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.
reverseCredit
in interface Plugin
pluginContext
- contains all the information needed by a plugin to process the request which are obtained from the deployment descriptor.reverseCreditTransaction
- contains the amount and other data required to process the action.retry
- indicates this is a retry of the operationFinancialTransaction
that represents the updated reverseCredit financial transaction.InvalidPaymentInstructionException
- thrown when the PaymentInstruction.PAYMENT_METHOD is not included in the Payment instruction's extended dataFunctionNotSupportedException
InvalidDataException
Plugin.reverseCredit(PluginContext,FinancialTransaction,boolean)
public FinancialTransaction reverseDeposit(PluginContext pluginContext, FinancialTransaction reverseDepositTransaction, boolean retry) throws FunctionNotSupportedException, 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.
reverseDeposit
in interface Plugin
pluginContext
- contains all the information needed by a plugin to process the request which are obtained from the deployment descriptor.reverseDepositTransaction
- contains the amount and other data required to process the action.retry
- indicates this is a retry of the operationFinancialTransaction
that represents the updated reverseDeposit financial transaction.InvalidPaymentInstructionException
- thrown when the PaymentInstruction.PAYMENT_METHOD is not included in the Payment instruction's extended dataPluginException
- Thrown when any exception conditions specified by the
PluginException
hierarchy are met; for more details, read the
plug-in exceptions hierarchy Javadocs.FunctionNotSupportedException
Plugin.reverseDeposit(PluginContext,FinancialTransaction,boolean)
public void validatePaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction) throws InvalidPaymentInstructionException, FunctionNotSupportedException
The SimpleOffline Plugin does not support this API.
validatePaymentInstruction
in interface Plugin
pluginContext
- contains all the information needed by a plugin to process the request as obtained from the deployment descriptor.paymentInstruction
- contains all the information needed by a plugin to query the paymentFunctionNotSupportedException
- always throws this exception since the SimpleOffline Plugin does not support this API.InvalidPaymentInstructionException
Plugin.validatePaymentInstruction(com.ibm.commerce.payments.plugin.PluginContext,com.ibm.commerce.payments.plugin.PaymentInstruction)
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.
checkHealth
in interface Plugin
boolean
that is true if the plugin has been configured correctly and false otherwise. A plugin is configured correctly if there is an XML configuration file defined.