com.ibm.commerce.payments.plugincontroller.plugin

Class PaymentsDataHelper

  • java.lang.Object
    • com.ibm.commerce.payments.plugincontroller.plugin.PaymentsDataHelper


  • public class PaymentsDataHelper
    extends java.lang.Object
    This class is a utility class which only has the static function. It mainly converts the value objects (payment, Credit, PaymentInstruction, FinancialTransaction) in the Plugin Specification version 1.0 to/from the data bean of EJB. It includes PPCPaymentData, PPCCreditData, PPCPayInstData, PPCPayTranData.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • buildAllPaymentTransactionsForPayment

        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.

        Parameters:
        payTransDataCollection - The collection of PPCPayTranData associated to the payment.
        payment - The payment for which we are building the transactions.
        Returns:
        ArrayList The return ArrayList of the PaymentTransaction associated to the payment.
        Throws:
        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.
      • buildPaymentInstruction

        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.

        Parameters:
        piData - The PPCPayInstData data bean.
        extendedDataCollection - The collection of PPCExtDataBean.
        Returns:
        PaymentInstruction The return value object.
        Throws:
        InternalException - Exception occurs when building the hash map extendedData.
      • updateBatchData

        public 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.
        Parameters:
        batchData -
        batch -
      • updatePPCCreditData

        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.

        Parameters:
        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.
      • updatePPCExtendedDataCollection

        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.

        Parameters:
        extendedDataCollection - The collection of PPCExtDataData needs to be modified.
        pluginExtendedData - The PluginExtendedData which contains all the information to update the databean.
        Returns:
        The modified PPCExtDataData collection.
        Throws:
        InternalException - The IOException when writing the serializable object into byte array.
      • updatePPCPaymentInstructionData

        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.

        Parameters:
        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.
        Throws:
        InternalException - Any exception occurs during the update.
      • updatePPCTransData

        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.

        Parameters:
        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.
      • updatePaymentData

        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.

        Parameters:
        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.