public class PaymentInstruction
extends java.lang.Object
implements java.io.Serializable
This class is the plugin instruction that represents all the data the plugins will need to issue any payment action, in terms of representing the payment method. It will contain account number, billing address, and so on. It does not contain any information used to track a payment against the back end. For that purpose, the transactions are used.
The amount on this Payment instruction is not typically used on most plugins. But it will let the plugin know up to the amount the Payment Plugin Controller will allow approve to occurs in the system.
The plugin controller will look at the amount in the PI and check against the requested approve amount. It will check if the Payment Instruction amount is equal to or greater than the requested approve amount. If the check is good then the approve will continue. If the requested approved amount is greater than the Payment amount it will not allow the approve to happen.
The extendedData will contain all the data related to the Payment method/Type that is not defined as a field. WebSphere Commerce will have a number of Key Words to identify pieces of the Payment methods or types. The plugin will take those key words and map them to their respective backend definitions. Because Commerce will not be able to define all of the different Key words the system will allow for additional key words to be added. The plugin will be responsible for documenting the additional key words that a store needs to pass down. So a store developer/integrator can configure the system to pass those fields. In addition if the plugin has specific needed during checkPaymentInstruction, verifyPaymentInstruction and ValidatePaymentInstruction. It can add plugin specific keywords and the controller will store those key words and use them in follow-on actions against that Payment Instruction.
Modifier and Type | Field and Description |
---|---|
static short |
STATE_CLOSED
State for paymentInstruction when it is closed, no action can be processed under this PaymentInstruction
except deletePaymentInstruction.
|
static short |
STATE_INVALID
The state of
PaymentInstruction after a failed validation. |
static short |
STATE_NEW
The state of the
PaymentInstruction just after its creation and before
validation. |
static short |
STATE_VALID
The state of
PaymentInstruction after a successful validation. |
Constructor and Description |
---|
PaymentInstruction(PaymentInstruction pi)
This method constructs a Payment Instruction from an existing Payment Instruction.
|
PaymentInstruction(java.lang.String id,
java.math.BigDecimal amount,
java.lang.String currency,
java.lang.String store,
java.lang.String paymentSystemName,
java.util.HashMap extendedData)
This method constructs a Payment Instruction.
|
PaymentInstruction(java.lang.String id,
java.lang.String store,
java.lang.String paymentSystemName)
This method constructs a Payment Instruction.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAccountNumber()
This method returns the accountNumber.
|
java.math.BigDecimal |
getAmount()
This method returns the amount associated to this Payment Instruction.
|
java.math.BigDecimal |
getApprovedAmount()
This method returns the approvedAmount.
|
java.math.BigDecimal |
getApprovingAmount()
This method returns the approvingAmount.
|
java.math.BigDecimal |
getCreditedAmount()
This method returns the total creditedAmount from multiple Credits associated.
|
java.math.BigDecimal |
getCreditingAmount()
This method returns the total crediting amount from multiple Credits associated.
|
java.util.ArrayList |
getCredits()
This method returns all the Credits associated.
|
java.lang.String |
getCurrency()
This method returns the currency.
|
java.math.BigDecimal |
getDepositedAmount()
This method returns the depositedAmount.
|
java.math.BigDecimal |
getDepositingAmount()
This method returns the depositingAmount.
|
java.util.HashMap |
getExtendedData()
This method returns the extendedData.
|
java.lang.String |
getId()
This method returns the Payments Instruction ID.
|
java.lang.String |
getOrderId()
This method returns the orderId.
|
java.lang.String |
getPaymentConfigurationId()
This method returns the payment configuration id.
|
java.lang.String |
getPaymentPluginName()
This method returns the name of the payment plugin the Payment instructions are associated to.
|
java.util.ArrayList |
getPayments()
This method sets all the Payments associated.
|
java.lang.String |
getPaymentSystemName()
This method returns the name of the payment systems the Payment instructions are associated to, this is typically
the plugin's name.
|
PluginException |
getPluginException()
This method returns the plugin exception.
|
EDPException |
getPPCException()
This method returns the PPC exception.
|
java.math.BigDecimal |
getReversingApprovedAmount()
This method returns the total reversing approved amount from multiple Payments associated.
|
java.math.BigDecimal |
getReversingCreditedAmount()
This method returns the total reversing credited amount from multiple Payments associated.
|
java.math.BigDecimal |
getReversingDepositedAmount()
This method returns the total reversing deposited amount from multiple Payments associated.
|
java.lang.String |
getRmaId()
This method returns the rmaId.
|
short |
getState()
This method returns the state of the Payment Instruction.
|
java.lang.String |
getStore()
This method returns the store the Payment instruction is associated to.
|
long |
getTimeCreated()
This method returns the time on which the Payment instruction was created.
|
long |
getTimeUpdated()
This method returns the time on which the Payment instruction was updated.
|
boolean |
isPaymentInstructionRetriable()
This method checks if this PaymentInstruction is retriable in spite that the previous transaction failed.
|
void |
setAccountNumber(java.lang.String accountNumber)
This method sets the accountNumber.
|
void |
setAmount(java.math.BigDecimal amount)
This method sets the amount of this PaymentInstruction.
|
void |
setApprovedAmount(java.math.BigDecimal approvedAmount)
This method sets the approvedAmount.
|
void |
setApprovingAmount(java.math.BigDecimal approvingAmount)
This method sets the approvingAmount.
|
void |
setCreditedAmount(java.math.BigDecimal creditedAmount)
This method sets the creditedAmount.
|
void |
setCreditingAmount(java.math.BigDecimal creditingAmount)
This method sets the total crediting amount from multiple Credits associated.
|
void |
setCredits(java.util.ArrayList credits)
This method sets all the Credits associated.
|
void |
setCurrency(java.lang.String currency)
This method sets the currency.
|
void |
setDepositedAmount(java.math.BigDecimal depositedAmount)
This method sets the depositedAmount.
|
void |
setDepositingAmount(java.math.BigDecimal depositingAmount)
This method sets the depositing amount.
|
void |
setExtendedData(java.util.HashMap extendedData)
This method sets the extendedData.
|
void |
setOrderId(java.lang.String orderId)
This method sets the orderId.
|
void |
setPaymentConfigurationId(java.lang.String string)
This method sets the payment configuration id.
|
void |
setPaymentInstructionRetriable(boolean localIsPaymentInstructionRetriable)
This method sets if this PaymentInstruction is retriable in spite that the previous transaction failed.
|
void |
setPaymentPluginName(java.lang.String paymentPluginName)
This method sets the name of the payment plugin.
|
void |
setPayments(java.util.ArrayList payments)
This method sets all the Payments associated.
|
void |
setPaymentSystemName(java.lang.String paymentSystemName)
This method sets the name of the payment systems.
|
void |
setPluginException(PluginException exception)
this method sets the plugin exception.
|
void |
setPPCException(EDPException exception)
This method sets the PPC exception.
|
void |
setReversingApprovedAmount(java.math.BigDecimal reversingApprovedAmount)
This method sets the total reversing approved amount from multiple Payments associated.
|
void |
setReversingCreditedAmount(java.math.BigDecimal reversingCreditedAmount)
This method sets the total reversing credited amount from multiple Payments associated.
|
void |
setReversingDepositedAmount(java.math.BigDecimal reversingDepositedAmount)
This method sets the total reversing deposited amount from multiple Payments associated.
|
void |
setRmaId(java.lang.String rmaId)
This method sets the rmaId.
|
void |
setState(short state)
This method sets the state.
|
void |
setStore(java.lang.String store)
This method sets the store.
|
void |
setTimeCreated(long timeCreated)
This method sets the create time.
|
void |
setTimeUpdated(long timeUpdated)
This method sets the update time.
|
java.lang.String |
toString()
This method returns a readable form of the PaymentInstruction object.
|
public static final short STATE_NEW
PaymentInstruction
just after its creation and before
validation.public static final short STATE_VALID
PaymentInstruction
after a successful validation.public static final short STATE_INVALID
PaymentInstruction
after a failed validation.public static final short STATE_CLOSED
public PaymentInstruction(PaymentInstruction pi)
This method constructs a Payment Instruction from an existing Payment Instruction.
pi
- A PaymentInstruction
that represents the payment
instructions this Payment is associated to.public PaymentInstruction(java.lang.String id, java.math.BigDecimal amount, java.lang.String currency, java.lang.String store, java.lang.String paymentSystemName, java.util.HashMap extendedData)
This method constructs a Payment Instruction.
id
- A String that specifies the unique identifier of the Payment.amount
- A BigDecimal that specifies the maximum amount used for the payment instruction.currency
- A String that specifies the currency used for the payment instruction per ISO 4217.store
- A String that represents the store the PI is associated to.paymentSystemName
- A String that specifies the name of the payment system which
PPC used to find out the plugin.extendedData
- A HashMap that contains all of the data needed by the plugin to process payment actions.public PaymentInstruction(java.lang.String id, java.lang.String store, java.lang.String paymentSystemName)
This method constructs a Payment Instruction.
id
- A String that specifies the unique identifier of the Payment.store
- A String that represents the store the PI is associated to.paymentSystemName
- A String that specifies the name of the payment system
which PPC used to find out the plugin.public java.lang.String getId()
public java.lang.String getOrderId()
This method returns the orderId.
public void setOrderId(java.lang.String orderId)
This method sets the orderId.
orderId
- A String that specifies the orderId to set.public void setRmaId(java.lang.String rmaId)
This method sets the rmaId.
rmaId
- A String that specifies the rmaId to set.public java.lang.String getRmaId()
This method returns the rmaId.
public java.lang.String getPaymentSystemName()
This method returns the name of the payment systems the Payment instructions are associated to, this is typically the plugin's name.
public void setPaymentSystemName(java.lang.String paymentSystemName)
paymentSystemName
- A String that specifies the name of the payment systems to set.public java.lang.String getPaymentPluginName()
This method returns the name of the payment plugin the Payment instructions are associated to.
public void setPaymentPluginName(java.lang.String paymentPluginName)
paymentPluginName
- A String that specifies the name of the payment plugin to set.public short getState()
This method returns the state of the Payment Instruction.
short
that indicates the state of the payment instruction .public void setState(short state)
This method sets the state.
state
- A short
that indicates the state to set.public java.lang.String getStore()
This method returns the store the Payment instruction is associated to.
public void setStore(java.lang.String store)
store
- A String that specifies the store to set.public java.lang.String getAccountNumber()
This method returns the accountNumber.
public void setAccountNumber(java.lang.String accountNumber)
This method sets the accountNumber. The plugin is mainly responsible of setting this value. Since the plugin is the only entity that will definitely know what the account number real name-value pair is within the protocolData. We will have a commerce keyWord to represent account number for Payment method, the KeyWord is AccountNumber.
accountNumber
- A String that specifies the value of the account number associated to this PaymentInstruction.public java.math.BigDecimal getAmount()
This method returns the amount associated to this Payment Instruction. Typically this amount is used if there is some validation the plugin needs to do for the PaymentInstruction base on amount.
public void setAmount(java.math.BigDecimal amount)
This method sets the amount of this PaymentInstruction.
amount
- A BigDecimal that specifies the amount to set.public java.lang.String getCurrency()
This method returns the currency.
public void setCurrency(java.lang.String currency)
This method sets the currency.
currency
- A String that specifies the currency to set.public java.util.HashMap getExtendedData()
This method returns the extendedData.
public void setExtendedData(java.util.HashMap extendedData)
This method sets the extendedData. It should be used to store information associated to the Payment Instruction that is intended to be persisted. The information will be added into the existing map, if any mapped value exist it will be replaced with the new one. The data is expected as name-value pairs with simple data types in order to easily stored them in the database. The expected value types are: Integer, Boolean, BigDecimal, Long, String, Binary.
extendedData
- A HashMap of name-value pairs representing extended payment information.public java.math.BigDecimal getApprovedAmount()
This method returns the approvedAmount. This amount is the total approvedAmount from multiple Payments associated.
public void setApprovedAmount(java.math.BigDecimal approvedAmount)
This method sets the approvedAmount. This amount is the total approvedAmount from multiple Payments associated.
approvedAmount
- A BigDecimal that specifies the amount to be set.public java.math.BigDecimal getApprovingAmount()
This method returns the approvingAmount. This amount is the total approvingAmount from multiple Payments associated.
public void setApprovingAmount(java.math.BigDecimal approvingAmount)
This method sets the approvingAmount. This amount is the total approvingAmount from multiple Payments associated.
approvingAmount
- A BigDecimal that specifies the approving amount to be set.public java.math.BigDecimal getDepositedAmount()
This method returns the depositedAmount. This amount is the total depositedAmount from multiple Payments associated.
public void setDepositedAmount(java.math.BigDecimal depositedAmount)
This method sets the depositedAmount. This amount is the total depositedAmount from multiple Payments associated.
depositedAmount
- A BigDecimal that specifies the deposited amount to be set.public java.math.BigDecimal getDepositingAmount()
This method returns the depositingAmount. This amount is the total depositingAmount from multiple Payments associated.
public void setDepositingAmount(java.math.BigDecimal depositingAmount)
This method sets the depositing amount. This amount is the total depositing amount from multiple Payments associated.
depositingAmount
- A BigDecimal that specifies the depositing amount to be set.public java.math.BigDecimal getCreditedAmount()
This method returns the total creditedAmount from multiple Credits associated.
public void setCreditedAmount(java.math.BigDecimal creditedAmount)
This method sets the creditedAmount. This amount is the total creditedAmount from multiple Credits associated.
creditedAmount
- A BigDecimal that specifies the credited amount to set.public java.math.BigDecimal getCreditingAmount()
This method returns the total crediting amount from multiple Credits associated.
public void setCreditingAmount(java.math.BigDecimal creditingAmount)
This method sets the total crediting amount from multiple Credits associated.
creditingAmount
- A BigDecimal that specifies the crediting amount to set.public java.math.BigDecimal getReversingApprovedAmount()
This method returns the total reversing approved amount from multiple Payments associated.
public void setReversingApprovedAmount(java.math.BigDecimal reversingApprovedAmount)
This method sets the total reversing approved amount from multiple Payments associated.
reversingApprovedAmount
- A BigDecimal that specifies the reversing approved amount to set.public java.math.BigDecimal getReversingDepositedAmount()
This method returns the total reversing deposited amount from multiple Payments associated.
public void setReversingDepositedAmount(java.math.BigDecimal reversingDepositedAmount)
This method sets the total reversing deposited amount from multiple Payments associated.
reversingDepositedAmount
- A BigDecimal that specifies the reversing deposited amount to set.public java.math.BigDecimal getReversingCreditedAmount()
This method returns the total reversing credited amount from multiple Payments associated.
public void setReversingCreditedAmount(java.math.BigDecimal reversingCreditedAmount)
This method sets the total reversing credited amount from multiple Payments associated.
reversingCreditedAmount
- A BigDecimal that specifies the reversing credited amount to set.public long getTimeCreated()
This method returns the time on which the Payment instruction was created.
long
that specifies the time on which the Payment instruction was created.public void setTimeCreated(long timeCreated)
This method sets the create time.
timeCreated
- A long
that specifies the create time to set.public long getTimeUpdated()
This method returns the time on which the Payment instruction was updated.
long
that specifies the time on which the Payment instruction was updated.public void setTimeUpdated(long timeUpdated)
This method sets the update time.
timeUpdated
- A long
that specifies the update time to set.public java.util.ArrayList getCredits()
This method returns all the Credits associated.
public void setCredits(java.util.ArrayList credits)
This method sets all the Credits associated.
credits
- the ArrayList that specifies the credits list to be set.public java.util.ArrayList getPayments()
This method sets all the Payments associated.
public void setPayments(java.util.ArrayList payments)
This method sets all the Payments associated.
payments
- The payments ArrayList to be set.public boolean isPaymentInstructionRetriable()
This method checks if this PaymentInstruction is retriable in spite that the previous transaction failed.
public void setPaymentInstructionRetriable(boolean localIsPaymentInstructionRetriable)
This method sets if this PaymentInstruction is retriable in spite that the previous transaction failed.
localIsPaymentInstructionRetriable
- A boolean that indicates if the PaymentInstruction retriable.public java.lang.String toString()
This method returns a readable form of the PaymentInstruction object.
Warning: not localized, for debugging purposes only!toString
in class java.lang.Object
public PluginException getPluginException()
public void setPluginException(PluginException exception)
exception
- A PluginException that represents the plugin exception.public EDPException getPPCException()
public void setPPCException(EDPException exception)
exception
- The EDP exception.public java.lang.String getPaymentConfigurationId()
public void setPaymentConfigurationId(java.lang.String string)
string
- A String that specifies the payment configuration id.