public class PPCDataConverter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
The IBM copyright notice field.
|
Modifier and Type | Method and Description |
---|---|
static com.ibm.commerce.payments.plugincontroller.Batch |
buildBatch(com.ibm.commerce.payments.plugincontroller.beans.PPCBatchData batchData,
java.util.ArrayList financialTransactionList)
This method is used to build the batch value object of WebSphere commerce payments level
from batch data access bean.
|
static Credit |
buildCreditWithPaymentInstruction(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData creditData,
PaymentContext paymentContext)
This method builds a Credit value object and the associated PaymentInstruction value object from the database.
|
static Credit |
buildCreditWithWholeTree(java.lang.String creditId,
PaymentContext paymentContext)
This method builds a Credit value object from the database.
|
static FinancialTransaction |
buildFinancialTransactionWithCredit(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData paymentTranData,
Credit creditVO,
PaymentContext paymentContext)
This method builds the
FinancialTransaction value object with Credit object. |
static FinancialTransaction |
buildFinancialTransactionWithPayment(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData paymentTranData,
Payment paymentVO,
PaymentContext paymentContext)
This method builds the
FinancialTransaction value object with Payment object. |
static java.util.HashMap |
buildHashMapExtendedData(java.util.Collection extDataDataCollection,
PaymentContext context)
This method builds a HaspMap extendedData from a collection of PPCExtDataData.
|
static PaymentInstruction |
buildPaymentInstruction(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData,
java.util.Collection extendedData,
java.lang.Boolean maskSensitiveData,
PaymentContext context)
This method builds a PaymentInstruction value object from a PPCPayInstData and a collection of PPCExtDataBean.
|
static PaymentInstruction |
buildPaymentInstructionWithWholeTree(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData,
PaymentContext paymentContext)
This method builds a PaymentInstruction value object from a PPCPayInstData and the database.
|
static Payment |
buildPaymentWithPaymentInstruction(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData paymentData,
PaymentContext paymentContext)
MaskSensitiveData builds a Payment value object with a PaymentInsruction from the database.
|
static Payment |
buildPaymentWithWholeTree(java.lang.String paymentId,
PaymentContext paymentContext)
This method builds a Payment value object from the database.
|
static void |
filtersPPCPIExtendedData(PluginAdapter adapter,
java.util.Collection ppcExtendedDataColl)
This method filters out garbage properties Before PPC persistent payment instruction extended data to database.
|
static void |
updatePPCCreditData(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData creditData,
Credit credit)
This method updates the data bean of PPCCredit using the information of the Credit value object.
|
static void |
updatePPCExtDataCollection(java.util.Collection ppcExtendedData,
java.util.HashMap extendedData,
PaymentContext paymentContext)
This method updates a collection of data beans of PPCExtData using the information of the HashMap extendedData.
|
static void |
updatePPCPayInstData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData,
PaymentInstruction paymentInst)
This method updates the data bean of PPCPayInst using the information of the PaymentInstruction value object.
|
static void |
updatePPCPaymentData(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData paymentData,
Payment payment)
This method updates the data bean of PPCPayment using the information of the Payment value object.
|
public static final java.lang.String COPYRIGHT
public static Credit buildCreditWithPaymentInstruction(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData creditData, PaymentContext paymentContext) throws CreditNotFoundException, PaymentInstructionNotFoundException, ConfigException, InternalException
This method builds a Credit value object and the associated PaymentInstruction value object from the database.
creditData
- The data bean of EJB PPCCredit.paymentContext
- The payment context.CreditNotFoundException
- The PPCCredit is not found or deleted.PaymentInstructionNotFoundException
- The PPCPayInst is not found or deleted.ConfigException
- Exception occurs when the configuration can not be retrieved for the plugin.InternalException
- The internal exceptions.public static Credit buildCreditWithWholeTree(java.lang.String creditId, PaymentContext paymentContext) throws PaymentNotFoundException, CreditNotFoundException, PaymentInstructionNotFoundException, ConfigException, InternalException
This method builds a Credit value object from the database. The PaymentInstruction and all the related Payments and Credits are all navigatable from this Credit value object.
creditId
- The id of the credit.paymentContext
- The payment context.PaymentNotFoundException
- This exception is thrown if some related PPCPayment are not found or deleted.CreditNotFoundException
- This exception is thrown if some related or this PPCCredit are not found or deleted.PaymentInstructionNotFoundException
- This exception is thrown if the related PPCPayInst is not found or deleted.ConfigException
- Exception occurs when the configuration can not be retrieved for the plugin.InternalException
- The internal exceptions.public static java.util.HashMap buildHashMapExtendedData(java.util.Collection extDataDataCollection, PaymentContext context) throws InternalException
This method builds a HaspMap extendedData from a collection of PPCExtDataData.
extDataDataCollection
- The collection of PPCExtDataData.context
- The payment context.InternalException
- This exception is thrown if IOException and ClassNotFoundException occurs when reading the Object from the byte array.public static PaymentInstruction buildPaymentInstruction(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData, java.util.Collection extendedData, java.lang.Boolean maskSensitiveData, PaymentContext context) throws ConfigException, InternalException
This method builds a PaymentInstruction value object from a PPCPayInstData and a collection of PPCExtDataBean. The returned PaymentInstruction value object has no payment or credit attached to it.
piData
- The PPCPayInstData data bean.extendedData
- Collection Extended Data.maskSensitiveData
- Indicate if mask sensitive data.context
- The payment context.ConfigException
- Exception occurs when the configuration can not be retrieved for the plugin.InternalException
- Exception occurs when building the hash map extendedData.public static PaymentInstruction buildPaymentInstructionWithWholeTree(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData, PaymentContext paymentContext) throws PaymentNotFoundException, CreditNotFoundException, PaymentInstructionNotFoundException, ConfigException, InternalException
This method builds a PaymentInstruction value object from a PPCPayInstData and the database. The return PaymentInstruction value object has all the associated payments and credits attached.
piData
- The PPCPayInstData data bean.paymentContext
- The payment context.PaymentNotFoundException
- This exception is thrown if some payment is deleted.CreditNotFoundException
- This exception is thrown if some credit is deleted.PaymentInstructionNotFoundException
- This exception is thrown if the PaymentInstruction is deleted.ConfigException
- Exception occurs when the configuration can not be retrieved for the pluginInternalException
- This exception is thrown if other exceptions occur.public static Payment buildPaymentWithPaymentInstruction(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData paymentData, PaymentContext paymentContext) throws PaymentNotFoundException, PaymentInstructionNotFoundException, ConfigException, InternalException
MaskSensitiveData builds a Payment value object with a PaymentInsruction from the database.
paymentData
- The PPCPaymentData.paymentContext
- The payment context.PaymentNotFoundException
- This exception is thrown if the payment is deleted.PaymentInstructionNotFoundException
- This exception is thrown if the associated PaymentInstruction is not found.ConfigException
- Exception occurs when the configuration can not be retrieved for the plugin.InternalException
- This exception is thrown if other exceptions occur.public static FinancialTransaction buildFinancialTransactionWithPayment(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData paymentTranData, Payment paymentVO, PaymentContext paymentContext) throws InternalException
FinancialTransaction
value object with Payment
object.paymentTranData
- the data access bean of payment transaction datapaymentVO
- The Payment
value objectpaymentContext
- the PaymentContext
value objectFinancialTransaction
value object with Payment
objectInternalException
- in case of InternalException
public static FinancialTransaction buildFinancialTransactionWithCredit(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData paymentTranData, Credit creditVO, PaymentContext paymentContext) throws InternalException
FinancialTransaction
value object with Credit
object.paymentTranData
- the data access bean of payment transaction datacreditVO
- the Credit
value objectpaymentContext
- the PaymentContext
objectFinancialTransaction
value object with Credit
objectInternalException
- in case of InternalException
public static Payment buildPaymentWithWholeTree(java.lang.String paymentId, PaymentContext paymentContext) throws PaymentNotFoundException, CreditNotFoundException, PaymentInstructionNotFoundException, ConfigException, InternalException
This method builds a Payment value object from the database. The associated PaymentInstruction and all related Payments and Credits can be navigatable from this Payment.
paymentId
- The payment unique identification, this ID is used to retrieve Payment information from the database.paymentContext
- The payment context.PaymentNotFoundException
- This exception is thrown when the Payment is not found.CreditNotFoundException
- This exception is thrown when some related Credit is not found.PaymentInstructionNotFoundException
- This exception is thrown when the associated PaymentInstruction is deleted or not found.ConfigException
- Exception occurs when the configuration can not be retrieved for the plugin.InternalException
- This exception is thrown when other exceptions occur.public static void updatePPCCreditData(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData creditData, Credit credit)
This method updates the data bean of PPCCredit using the information of the Credit value object.
creditData
- The PPCCreditData to be updated, and this is also where the caller to get the updated information.credit
- A Credit that contains all the information to update the databean.public static void updatePPCExtDataCollection(java.util.Collection ppcExtendedData, java.util.HashMap extendedData, PaymentContext paymentContext) throws InternalException
This method updates a collection of data beans of PPCExtData using the information of the HashMap extendedData.
In order to support that only those data needed to be changed is passed, there are three options here:If the element in old extended data is also in the new data, just modify it.
If the element in new extended data is not in old data, just add it.
If the element in old extended data is not in the new data, do nothing.
ppcExtendedData
- The collection of PPCExtDataData to be updated, and this is also where the
caller to get the updated information.extendedData
- Contains all the information to update the databeans.paymentContext
- The payment context.InternalException
- Other exception.public static void updatePPCPayInstData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData, PaymentInstruction paymentInst)
This method updates the data bean of PPCPayInst using the information of the PaymentInstruction value object.
piData
- The PPCPayInstData to be updated, and this is also where the caller to get the updated information.paymentInst
- A PaymentInstruction that contains all the information to update the databean.public static void updatePPCPaymentData(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData paymentData, Payment payment)
This method updates the data bean of PPCPayment using the information of the Payment value object.
paymentData
- The PPCPaymentData to be updated, and this is also where the caller to get the updated information.payment
- A Payment that contains all the information to update the databean.public static void filtersPPCPIExtendedData(PluginAdapter adapter, java.util.Collection ppcExtendedDataColl)
adapter
- The adapter.ppcExtendedDataColl
- A collection of payment instruction extended data, which will be filtered.public static com.ibm.commerce.payments.plugincontroller.Batch buildBatch(com.ibm.commerce.payments.plugincontroller.beans.PPCBatchData batchData, java.util.ArrayList financialTransactionList) throws InternalException
batchData
- financialTransactionList
- InternalException