public class PaymentInstructionImpl extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable, PaymentInstruction
This class is a value object containing detailed information required by plug-ins to process financial transactions (FinancialTransaction).
The PaymentInstruction(PI) is a container that aggregates the data the plug-ins need to execute financial transactions while processing payment-related and credit-related transactions. It contains account, billing address, amounts, and so on. It does not contain any specific information used to track a particular financial transaction with the back-end system, though. For tracking purposes, the Payment, Credit and FinancialTransaction are used instead.
The amount on the PaymentInstruction can be used by plug-ins to determine what is the maximum target amount the Payment Plug-in Controller intends to collectively consume. PPC often compares the amount in the PaymentInstruction with the requested amount for approve and credit transactions. PPC has to make sure that the PaymentInstruction amount is always equal or greater than the requested amount.
The ExtendedData contains all the data related to the a payment instruction that is not defined as an attribute in PaymentInstruction. This is required because all the protocol parameters for a Plugin are not known beforehand by the Payment Plugin Controller. WebSphere Commerce defines a number of keywords to identify common protocol parameters that are not part of the PaymentInstruction set of attributes. The Plugin should take these keywords and map them to their own back-end system definitions. Because it is not possibly to define all the possible keywords for all potential plug-ins, additional keywords might need to be defined by the plug-ins. Plug-ins are responsible for documenting these additional keywords. So that a store might be able to pass these attributes down to the Payment Plugin Controller and then to the Plugin. Then, ExtendedData is in summary, the mechanism by which WebSphere Commerce passes all information related to a PaymentInstruction and required for financial transactions. In addition, if the Plugin has specific needs during Plugin.checkPaymentInstruction(PluginContext, PaymentInstruction) and Plugin.validatePaymentInstruction(PluginContext, PaymentInstruction), the Plugin can add specific keywords and the Payment Plugin Controller will store those keywords and use them in subsequent transactions against that PaymentInstruction.
Containers: Class Diagram
-------------------- --------------------| PaymentInstruction |<------------ | -------------------- | | ^ 1 | | | | | |----------- | v 1 | | | -------------- | | | | ExtendedData | v 0..n v 0..n | -------------- --------- -------- | ^ 1 | Payment | | Credit | | | --------- -------- | | | 1 | 1 | | | | | | | | | | v 0..n v 0..n | | ---------------------- | -------------------| FinancialTransaction |------------ ----------------------
Constructor and Description |
---|
PaymentInstructionImpl(java.lang.String piId, java.lang.String currency, java.math.BigDecimal amount, ExtendedData extendedData, java.lang.String store)
This method constructs a PaymentInstruction uniquely identified with an associated amount.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object | clone()
This method returns a shallow copy of this PaymentInstructionImpl instance.
|
java.lang.String | getAccount()
This method gets the account associated with the PaymentInstruction.
|
java.math.BigDecimal | getAmount()
This method gets the target amount to be processed by associated financial transactions.
|
java.math.BigDecimal | getApprovedAmount()
This method gets the currently approved amount on this PaymentInstruction.
|
java.math.BigDecimal | getApprovingAmount()
This method gets the amount being approved.
|
java.math.BigDecimal | getCreditedAmount()
This method gets the currently credited amount on this PaymentInstruction.
|
java.math.BigDecimal | getCreditingAmount()
This method gets the amount being credited.
|
java.util.ArrayList | getCredits()
This method gets the list of associated Credit containers.
|
java.lang.String | getCurrency()
This method gets the currency of the PaymentInstruction.
|
java.math.BigDecimal | getDepositedAmount()
This method gets the currently deposited amount on this PaymentInstruction.
|
java.math.BigDecimal | getDepositingAmount()
This method gets the amount being deposited.
|
ExtendedData | getExtendedData()
This method gets the extra protocol data associated with this PaymentInstruction.
|
java.lang.String | getId()
This method gets the unique identifier of the PaymentInstruction container.
|
java.lang.String | getOrderId()
This method gets the order associated with the PaymentInstruction.
|
java.util.ArrayList | getPayments()
This method gets a list of Payment containers associated with this PaymentInstruction.
|
java.lang.String | getPaymentSystemName()
This method gets the payment system name to which the PaymentInstruction is associated with.
|
java.lang.String | getRmaId()
This method gets the Return Merchandizing Authorization ID associated with the PaymentInstruction.
|
short | getState()
This method gets the current state of the PaymentInstruction.
|
static java.lang.String | getStateAsString(int state)
This method gets a non-globalized human-readable representation of a payment instruction state.
|
java.lang.String | getStore()
This method gets the merchant's store to which the PaymentInstruction belongs to.
|
long | getTimeCreated()
This method gets the time when the PaymentInstruction was created.
|
long | getTimeUpdate()
This method gets the most recent time that the PaymentInstruction was updated.
|
void | setAccount(java.lang.String accountNumber)
This method sets the account of the PaymentInstruction.
|
void | setAmount(java.math.BigDecimal amount)
This method sets the target amount to be processed on one or more payment or credit transactions.
|
void | setApprovedAmount(java.math.BigDecimal approvedAmount)
This method sets the currently approved amount on this PaymentInstruction.
|
void | setApprovingAmount(java.math.BigDecimal approvingAmount)
This method sets the current amount being approved.
|
void | setCreditedAmount(java.math.BigDecimal creditAmount)
This method sets the currently credited amount on this PaymentInstruction.
|
void | setCreditingAmount(java.math.BigDecimal creditingAmount)
This method sets the amount being credited.
|
void | setCredits(java.util.ArrayList credits)
This method sets a list of Credit containers associated with this .
|
void | setCurrency(java.lang.String currency)
This method sets the currency to be used in financial transactions associated with the PaymentInstruction.
|
void | setDepositedAmount(java.math.BigDecimal depositedAmount)
This method sets the currently deposited amount on this PaymentInstruction.
|
void | setDepositingAmount(java.math.BigDecimal depositingAmount)
This method sets the amount being deposited.
|
void | setExtendedData(ExtendedData extendedData)
This method sets the extra protocol data associated with the PaymentInstruction.
|
void | setOrderId(java.lang.String orderId)
This method sets the unique order identifier associated with the PaymentInstruction.
|
void | setPayments(java.util.ArrayList payments)
This method sets the list of Payment containers associated with this PaymentInstruction.
|
void | setPaymentSystemName(java.lang.String paymentSystemName)
This method sets the payment system that will process this PaymentInstruction.
|
void | setRmaId(java.lang.String rmaId)
This method sets the Return Merchandizing Authorization ID associated with the PaymentInstruction.
|
void | setState(short state)
This method sets the state of the PaymentInstruction.
|
void | setStore(java.lang.String storeId)
This method sets the unique identifier of the merchant's store.
|
void | setTimeCreated(long timeCreated)
This method sets the time that the PaymentInstruction was created.
|
void | setTimeUpdate(long timeUpdate)
This method sets the time the PaymentInstruction was last changed.
|
java.lang.String | toString()
This method obtains a human-readable representation of the PaymentInstruction financial container.
|
public PaymentInstructionImpl(java.lang.String piId, java.lang.String currency, java.math.BigDecimal amount, ExtendedData extendedData, java.lang.String store)
This method constructs a PaymentInstruction uniquely identified with an associated amount.
public void setAccount(java.lang.String accountNumber)
This method sets the account of the PaymentInstruction.
The Plugin is responsible for setting the account based on the name-value pairs in extended data.
The default reserved keyword for the account is as defined in keywords.xml.
public java.lang.String getAccount()
This method gets the account associated with the PaymentInstruction.
public void setAmount(java.math.BigDecimal amount)
This method sets the target amount to be processed on one or more payment or credit transactions.
This amount is usually a hint for the actual amount to be processed. Plugin implementations might decide to support amounts exceeding the target amount or not.
public java.math.BigDecimal getAmount()
This method gets the target amount to be processed by associated financial transactions.
public void setApprovedAmount(java.math.BigDecimal approvedAmount)
This method sets the currently approved amount on this PaymentInstruction.
public java.math.BigDecimal getApprovedAmount()
This method gets the currently approved amount on this PaymentInstruction.
public void setApprovingAmount(java.math.BigDecimal approvingAmount)
This method sets the current amount being approved.
public java.math.BigDecimal getApprovingAmount()
This method gets the amount being approved.
public void setCreditedAmount(java.math.BigDecimal creditAmount)
This method sets the currently credited amount on this PaymentInstruction.
public java.math.BigDecimal getCreditedAmount()
This method gets the currently credited amount on this PaymentInstruction.
public void setCreditingAmount(java.math.BigDecimal creditingAmount)
This method sets the amount being credited.
public java.math.BigDecimal getCreditingAmount()
This method gets the amount being credited.
public void setCredits(java.util.ArrayList credits)
This method sets a list of Credit containers associated with this .
public java.util.ArrayList getCredits()
This method gets the list of associated Credit containers.
public void setCurrency(java.lang.String currency)
This method sets the currency to be used in financial transactions associated with the PaymentInstruction.
public java.lang.String getCurrency()
This method gets the currency of the PaymentInstruction.
public void setDepositedAmount(java.math.BigDecimal depositedAmount)
This method sets the currently deposited amount on this PaymentInstruction.
public java.math.BigDecimal getDepositedAmount()
This method gets the currently deposited amount on this PaymentInstruction.
public void setDepositingAmount(java.math.BigDecimal depositingAmount)
This method sets the amount being deposited.
public java.math.BigDecimal getDepositingAmount()
This method gets the amount being deposited.
public void setExtendedData(ExtendedData extendedData)
This method sets the extra protocol data associated with the PaymentInstruction.
public ExtendedData getExtendedData()
This method gets the extra protocol data associated with this PaymentInstruction.
public java.lang.String getId()
public void setOrderId(java.lang.String orderId)
This method sets the unique order identifier associated with the PaymentInstruction.
This is an optional field, since there might not be any order associated with the PaymentInstruction.
public java.lang.String getOrderId()
This method gets the order associated with the PaymentInstruction.
public java.lang.String getRmaId()
This method gets the Return Merchandizing Authorization ID associated with the PaymentInstruction.
public void setRmaId(java.lang.String rmaId)
This method sets the Return Merchandizing Authorization ID associated with the PaymentInstruction.
This is an optional field, since there might not be any returns associated with the PaymentInstruction.
public void setPaymentSystemName(java.lang.String paymentSystemName)
This method sets the payment system that will process this PaymentInstruction.
The payment system name is typically the name of the plugin implementation defined in the Plugin configuration. However, since multiple payment systems can be associated with the same Plugin. The payment system name can be used by the Plugin to distinguish which back-end system or protocol the Plugin needs to use. This n-to-1 mapping is relevant only to plug-ins that support multiple payment protocols.
public java.lang.String getPaymentSystemName()
This method gets the payment system name to which the PaymentInstruction is associated with.
public void setPayments(java.util.ArrayList payments)
This method sets the list of Payment containers associated with this PaymentInstruction.
public java.util.ArrayList getPayments()
This method gets a list of Payment containers associated with this PaymentInstruction.
public short getState()
This method gets the current state of the PaymentInstruction.
Valid values:
public void setState(short state)
This method sets the state of the PaymentInstruction.
Valid values:
public void setStore(java.lang.String storeId)
This method sets the unique identifier of the merchant's store.
public java.lang.String getStore()
This method gets the merchant's store to which the PaymentInstruction belongs to.
public void setTimeCreated(long timeCreated)
This method sets the time that the PaymentInstruction was created.
The time should follow GMT standard time.
public long getTimeCreated()
This method gets the time when the PaymentInstruction was created.
public void setTimeUpdate(long timeUpdate)
This method sets the time the PaymentInstruction was last changed.
public long getTimeUpdate()
This method gets the most recent time that the PaymentInstruction was updated.
public java.lang.String toString()
This method obtains a human-readable representation of the PaymentInstruction financial container.
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
This method returns a shallow copy of this PaymentInstructionImpl instance.
public static java.lang.String getStateAsString(int state)