public class WCPaymentsPluginBean
extends java.lang.Object
implements javax.ejb.SessionBean
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
WCPaymentsPluginBean() |
Modifier and Type | Method and Description |
---|---|
FinancialTransaction | approve(PluginContext pluginContext, FinancialTransaction approveTransaction, boolean retry)
Approves an amount against a Payment Instruction.
|
FinancialTransaction | approveAndDeposit(PluginContext pluginContext, FinancialTransaction approveAndDepositTransaction, boolean retry)
Deposits a payment without a prior approval.
|
boolean | checkHealth()
Check whether XML configuration for the Plugin is available.
|
void | checkPaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction)
Checks if a Payment instruction has all required parameters and is syntactically correct.
|
FinancialTransaction | credit(PluginContext pluginContext, FinancialTransaction creditTransaction, boolean retry)
Credits the requested amount.
|
FinancialTransaction | deposit(PluginContext pluginContext, FinancialTransaction depositTransaction, boolean retry)
Deposits an amount against an Approved Payment.
|
void | ejbActivate()
ejbActivate
|
void | ejbCreate()
ejbCreate
|
void | ejbPassivate()
ejbPassivate
|
void | ejbRemove()
ejbRemove
|
java.math.BigDecimal | getAvailableBalance(PluginContext pluginContext, PaymentInstruction paymentInstruction)
Gets the Available Balance for the specified PaymentInstruction.
|
Credit | getCredit(PluginContext pluginContext, Credit aCredit)
Refreshes the current attributes of the Credit object.
|
java.lang.String | getMessage(PluginContext pluginContext, java.lang.String messageKey)
Gets the Translated error String associated to the particular error key.
|
Payment | getPayment(PluginContext pluginContext, Payment payment)
Refreshes the current attributes of the Payment object.
|
javax.ejb.SessionContext | getSessionContext()
Gets the session context.
|
FinancialTransaction | reverseApproval(PluginContext pluginContext, FinancialTransaction reverseApprovalTransaction, boolean retry)
Reverse all or partial of approved amount in a payment.
|
FinancialTransaction | reverseCredit(PluginContext pluginContext, FinancialTransaction reverseCreditTransaction, boolean retry)
Cancels the specified credit.
|
FinancialTransaction | reverseDeposit(PluginContext pluginContext, FinancialTransaction reverseDepositTransaction, boolean retry)
Cancels a deposited amount against a the specified payment.
|
void | setSessionContext(javax.ejb.SessionContext ctx)
Sets the session context.
|
void | validatePaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction)
Refreshes the current attributes of the Payment object.
|
public static final java.lang.String COPYRIGHT
public java.math.BigDecimal getAvailableBalance(PluginContext pluginContext, PaymentInstruction paymentInstruction) throws PluginException
Gets the Available Balance for the specified PaymentInstruction. Typically used for Store Value/Gift cards or Line of Credit plugins.
WebSphere Commerce Payments Plugin does not support this API. If invoked, FunctionNotSupportedException will be thrown.
public Credit getCredit(PluginContext pluginContext, Credit aCredit) throws PluginException
Refreshes the current attributes of the Credit object.
WC Payments Plugin will issue QUERYCREDITS command to WebSphere Commerce Payments. It is used to get the information of each transaction associated with the Credit and update the Credit too.
public java.lang.String getMessage(PluginContext pluginContext, java.lang.String messageKey) throws PluginException
Gets the Translated error String associated to the particular error key.
public Payment getPayment(PluginContext pluginContext, Payment payment) throws PluginException
Refreshes the current attributes of the Payment object.
WC Payments Plugin will issue QUERYPAYMENTS command to WebSphere Commerce Payments, then update the payment object and the associated transactions.
public void setSessionContext(javax.ejb.SessionContext ctx)
public javax.ejb.SessionContext getSessionContext()
public FinancialTransaction approve(PluginContext pluginContext, FinancialTransaction approveTransaction, boolean retry) throws PluginException
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 to authorization.
WCPaymentsPlugin will use Cashier to create an order in WebSphere Commerce Payments, then issue APPROVE command against the created order.
public FinancialTransaction approveAndDeposit(PluginContext pluginContext, FinancialTransaction approveAndDepositTransaction, boolean retry) throws PluginException
Deposits a payment without a prior approval. Some systems call this a "sale" transaction and others an "auth with capture" transaction.
WCPaymentsPlugin will use Cashier to create an order in WebSphere Commerce Payments, then issue APPROVE command with the AUTODEPOSIT flag against the created order.
public void checkPaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction) throws PluginException
Checks if a Payment instruction has all required parameters and is syntactically correct.
WCPaymentsPlugin will check the currency, storeId and orderId are exist or not.
public FinancialTransaction credit(PluginContext pluginContext, FinancialTransaction creditTransaction, boolean retry) throws PluginException
Credits the requested amount. This single credit method supports both dependent and independent credits.
WCPaymentsPlugin will issue REFUND command to WebSphere Commerce Payments. If the creditTransaction is referenced by only a Credit, it is an independent credit. WCPayments Plugin will search if there is a WebSphere Commerce Payments order created for this Credit container. If not, WC Payments Plugin will create a WebSphere Commerce Payments order first. Then issue REFUND command for this independent credit. If the creditTransactin is referenced by both a credit and a payment, it is a dependent credit. WC Payments Plugin will search for the WebSphere Commerce Payments order which is used during APPROVE command. Then issue REFUND command against that order.
public FinancialTransaction deposit(PluginContext pluginContext, FinancialTransaction depositTransaction, boolean retry) throws PluginException
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.
WCPaymentsPlugin will issue DEPOSIT command using Cashier to WebSphere Commerce Payments to deposit the amount
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
Reverse all or partial of approved amount in a payment.
A payment has approved amount. This plugin will let financial institution know we don't need all or partial of approved amount anymore. The amount to reverse is specified in parameter reverseApprovalTransaction.
WC Payments Plugin will support partial approve reverse since WebSphere Commerce Payments framework supports it. If some cassettes do not support, WC Payments Plugin will throw a FunctionNotSupportedException. WC Payments Plugin will issue APPROVEREVERSAL command to WebSphere Commerce Payments.
public FinancialTransaction reverseCredit(PluginContext pluginContext, FinancialTransaction reverseCreditTransaction, boolean retry) throws PluginException
Cancels the specified credit.
WCPayments Plugin will not support partial reverse since WebSphere Commerce Payments framework does not support. WCPayments Plugin will issue REFUNDREVERSAL command to WebSphere Commerce payments.
public FinancialTransaction reverseDeposit(PluginContext pluginContext, FinancialTransaction reverseDepositTransaction, boolean retry) throws PluginException
Cancels a deposited amount against a the specified payment.
WC Payments Plugin will not support partial reverse since WebSphere Commerce Payments framework does not support. WC Payments Plugin will issue DEPOSITREVERSAL command to WebSphere Commerce Payments to process the API.
public void validatePaymentInstruction(PluginContext pluginContext, PaymentInstruction paymentInstruction) throws PluginException
WC Payments Plugin does not support this API. It will throw FunctionNotSupportedException.
public boolean checkHealth()
Check 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.