public class PaymentsDataHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.ArrayList |
buildAllPaymentTransactionsForPayment(java.util.Collection payTransDataCollection,
PaymentImpl payment)
This method builds an ArrayList of PaymentTransaction value objects which are associated to the Payment.
|
static CreditImpl |
buildCredit(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData creditData,
PaymentInstructionImpl paymentInst)
This method builds a Credit value object and associate it to a existing PaymentInstruction value object.
|
static PaymentImpl |
buildPayment(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData paymentData,
PaymentInstructionImpl pi)
This method builds a Payment value object from a PPCPaymentData, and associates it to a passed down
PaymentInstruction.
|
static PaymentInstructionImpl |
buildPaymentInstruction(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData,
java.util.Collection extendedDataCollection)
This method builds a PaymentInstruction value object from a PPCPayInstData and a collection of
PPCExtDataBean.
|
static com.ibm.commerce.payments.plugin.impl.BatchImpl |
buildTreeFromBatch(com.ibm.commerce.payments.plugincontroller.beans.PPCBatchData batchData)
This method builds batch value object from PPCBatchData.
|
static PaymentInstructionImpl |
buildTreeFromPaymentInstruction(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData)
This method builds a PaymentInstruction value object from a PPCPayInstData and the PPCExtDataData from
the database.
|
static FinancialTransactionImpl |
buildTreeFromPaymentTransaction(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData payTranData)
This method builds a PaymentTransaction value object from a PPCPayTranData and the PPCExtDataData from
the database.
|
static void |
updateBatchData(com.ibm.commerce.payments.plugincontroller.beans.PPCBatchData batchData,
com.ibm.commerce.payments.plugin.Batch batch)
This method updates the data bean of PPCBatch using the information of the Batch value
object.
|
static void |
updatePaymentData(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData paymentData,
PaymentImpl payment)
This method updates the data bean of PPCPayment using the information of the Payment value object.
|
static void |
updatePPCCreditData(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData creditData,
CreditImpl credit)
This method updates the data bean of PPCCredit using the information of the Credit value object.
|
static java.util.Collection |
updatePPCExtendedDataCollection(java.util.Collection extendedDataCollection,
ExtendedData pluginExtendedData)
This method updates the extendedDataCollection from the pluginExtendedData.
|
static void |
updatePPCPaymentInstructionData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData,
java.util.Collection extendedDataCollection,
PaymentInstruction paymentInst)
This method updates the data bean of PPCPayInst using the information of the PaymentInstruction value
object.
|
static void |
updatePPCTransData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData payTranData,
FinancialTransaction paymentTran)
This method updates the data bean of PPCPayTran using the information of the PaymentTransaction value
object.
|
public static java.util.ArrayList buildAllPaymentTransactionsForPayment(java.util.Collection payTransDataCollection, PaymentImpl payment) throws InternalException, InvalidDataException
This method builds an ArrayList of PaymentTransaction value objects which are associated to the Payment. The information of these transactions is passed down as a Collection parameter . These transactions include APPROVE_TRANSACTION, APPROVE_AND_DEPOSIT_TRANSACTION, DEPOSIT_TRANSACTION, REVERSE_APPROVAL_TRANSACTION, REVERSE_DEPOSIT_TRANSACTION types.
payTransDataCollection
- The collection of PPCPayTranData associated to the payment.payment
- The payment for which we are building the transactions.InternalException
- This exception is thrown when other exceptions occur during the conversion.InvalidDataException
- This exception is thrown when setting the not-allowed values to the value
objects.public static CreditImpl buildCredit(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData creditData, PaymentInstructionImpl paymentInst) throws InternalException, CreditNotFoundException, InvalidDataException
This method builds a Credit value object and associate it to a existing PaymentInstruction value object.
creditData
- The data bean of EJB PPCCredit.paymentInst
- The related PaymentInstruction value object.InternalException
- Other exceptions during the conversion.CreditNotFoundException
- The credit object is deleted or not found in the dbInvalidDataException
- This exception is thrown when setting the not-allowed value to the value
objects.public static PaymentImpl buildPayment(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData paymentData, PaymentInstructionImpl pi) throws InternalException, PaymentNotFoundException, InvalidDataException
This method builds a Payment value object from a PPCPaymentData, and associates it to a passed down PaymentInstruction.
paymentData
- The data bean of PPCPaymentDatapi
- The associated PaymentInstructionInternalException
- Other exceptions.PaymentNotFoundException
- The payment is deleted during this function is executingInvalidDataException
- This exception is thrown when trying to set the not-allowed values to the
value object.public static PaymentInstructionImpl buildPaymentInstruction(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData, java.util.Collection extendedDataCollection) throws InternalException
This method builds a PaymentInstruction value object from a PPCPayInstData and a collection of PPCExtDataBean. The return PaymentInstruction value object has no payment or credit attached.
piData
- The PPCPayInstData data bean.extendedDataCollection
- The collection of PPCExtDataBean.InternalException
- Exception occurs when building the hash map extendedData.public static PaymentInstructionImpl buildTreeFromPaymentInstruction(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData) throws InternalException, PaymentInstructionNotFoundException, PaymentNotFoundException, CreditNotFoundException, InvalidDataException
This method builds a PaymentInstruction value object from a PPCPayInstData and the PPCExtDataData from the database. All the related Payments, Credits, and PaymentTransactions can be navigable from this return PaymentInstruction value object.
piData
- A PPCPayInstData data bean.InternalException
- Exception occurs when building the whole navigable value object
tree.PaymentInstructionNotFoundException
- The associated PPCPayInst is deleted or not
found.PaymentNotFoundException
- Some related PPCPayment is deleted or not found.CreditNotFoundException
- some related PPCCredit is deleted or not found.InvalidDataException
- This exception is thrown when setting the not-allowed values to the value
object.public static FinancialTransactionImpl buildTreeFromPaymentTransaction(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData payTranData) throws InternalException, PaymentInstructionNotFoundException, PaymentNotFoundException, CreditNotFoundException, InvalidDataException
This method builds a PaymentTransaction value object from a PPCPayTranData and the PPCExtDataData from the database. All the related PaymentInstrction, Payments, Credits, and other PaymentTransactions can be navigable from this return PaymentTransaction value object.
payTranData
- A PPCPayTranData data bean.InternalException
- Exception occurs when building the whole navigable value object
tree.PaymentInstructionNotFoundException
- The associated PPCPayInst is deleted or not
found.PaymentNotFoundException
- Some related PPCPayment is deleted or not found.CreditNotFoundException
- Some related PPCCredit is deleted or not found.InvalidDataException
- This exception is thrown when setting the not-allowed values to the value
object.public static com.ibm.commerce.payments.plugin.impl.BatchImpl buildTreeFromBatch(com.ibm.commerce.payments.plugincontroller.beans.PPCBatchData batchData) throws com.ibm.commerce.payments.plugincontroller.exception.BatchNotFoundException, PaymentInstructionNotFoundException, PaymentNotFoundException, CreditNotFoundException, InvalidDataException, FinancialTransactionNotFoundException, InternalException, javax.naming.NamingException, java.sql.SQLException
batchData
- com.ibm.commerce.payments.plugincontroller.exception.BatchNotFoundException
PaymentInstructionNotFoundException
PaymentNotFoundException
CreditNotFoundException
InvalidDataException
FinancialTransactionNotFoundException
InternalException
javax.naming.NamingException
java.sql.SQLException
public static void updateBatchData(com.ibm.commerce.payments.plugincontroller.beans.PPCBatchData batchData, com.ibm.commerce.payments.plugin.Batch batch)
batchData
- batch
- public static void updatePPCCreditData(com.ibm.commerce.payments.plugincontroller.beans.PPCCreditData creditData, CreditImpl 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 creditImpl that contains all the information to update the databean.public static java.util.Collection updatePPCExtendedDataCollection(java.util.Collection extendedDataCollection, ExtendedData pluginExtendedData) throws InternalException
This method updates the extendedDataCollection from the pluginExtendedData. We add/modify/remove the PPCExtData from the collection. The added PPCExtData and the modified ones will remain in parameter extendedDataCollection, and the removed PPCExtData has been removed from extendedDataCollection.
extendedDataCollection
- The collection of PPCExtDataData needs to be modified.pluginExtendedData
- The PluginExtendedData which contains all the information to
update the databean.InternalException
- The IOException when writing the serializable object into byte
array.public static void updatePPCPaymentInstructionData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayInstData piData, java.util.Collection extendedDataCollection, PaymentInstruction paymentInst) throws InternalException
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.extendedDataCollection
- The associated PPCExtDataData collection 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.InternalException
- Any exception occurs during the update.public static void updatePPCTransData(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData payTranData, FinancialTransaction paymentTran)
This method updates the data bean of PPCPayTran using the information of the PaymentTransaction value object.
payTranData
- The PPCPayTranData to be updated, and this is also where the caller to
get the updated information.paymentTran
- A FinancialTransaction that contains all the information to update the databean.public static void updatePaymentData(com.ibm.commerce.payments.plugincontroller.beans.PPCPaymentData paymentData, PaymentImpl 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 PaymentImpl that contains all the information to update the databean.