com.ibm.commerce.payments.plugincontroller

Class PPCDataConverter

  • java.lang.Object
    • com.ibm.commerce.payments.plugincontroller.PPCDataConverter


  • public class PPCDataConverter
    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) in the PaymentsInterface (the interface between PDP and PPC) to the data bean of EJB. It includes PPCPaymentData, PPCCreditData and PPCPayInstData.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      The IBM copyright notice field.
    • Method Summary

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

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

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM copyright notice field.
        See Also:
        Constant Field Values
    • Method Detail

      • buildHashMapExtendedData

        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.

        Parameters:
        extDataDataCollection - The collection of PPCExtDataData.
        context - The payment context.
        Returns:
        The extended data.
        Throws:
        InternalException - This exception is thrown if IOException and ClassNotFoundException occurs when reading the Object from the byte array.
      • buildPaymentInstruction

        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.

        Parameters:
        piData - The PPCPayInstData data bean.
        extendedData - Collection Extended Data.
        maskSensitiveData - Indicate if mask sensitive data.
        context - The payment context.
        Returns:
        The value object.
        Throws:
        ConfigException - Exception occurs when the configuration can not be retrieved for the plugin.
        InternalException - Exception occurs when building the hash map extendedData.
      • buildFinancialTransactionWithPayment

        public static FinancialTransaction buildFinancialTransactionWithPayment(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData paymentTranData,
                                                                                Payment paymentVO,
                                                                                PaymentContext paymentContext)
                                                                         throws InternalException
        This method builds the FinancialTransaction value object with Payment object.
        Parameters:
        paymentTranData - the data access bean of payment transaction data
        paymentVO - The Payment value object
        paymentContext - the PaymentContext value object
        Returns:
        the FinancialTransaction value object with Payment object
        Throws:
        InternalException - in case of InternalException
      • buildFinancialTransactionWithCredit

        public static FinancialTransaction buildFinancialTransactionWithCredit(com.ibm.commerce.payments.plugincontroller.beans.PPCPayTranData paymentTranData,
                                                                               Credit creditVO,
                                                                               PaymentContext paymentContext)
                                                                        throws InternalException
        This method builds the FinancialTransaction value object with Credit object.
        Parameters:
        paymentTranData - the data access bean of payment transaction data
        creditVO - the Credit value object
        paymentContext - the PaymentContext object
        Returns:
        the FinancialTransaction value object with Credit object
        Throws:
        InternalException - in case of InternalException
      • updatePPCCreditData

        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.

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

        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.

        Parameters:
        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.
        Throws:
        InternalException - Other exception.
      • updatePPCPayInstData

        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.

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

        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.

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

        public static void filtersPPCPIExtendedData(PluginAdapter adapter,
                                                    java.util.Collection ppcExtendedDataColl)
        This method filters out garbage properties Before PPC persistent payment instruction extended data to database.
        Parameters:
        adapter - The adapter.
        ppcExtendedDataColl - A collection of payment instruction extended data, which will be filtered.
      • buildBatch

        public static com.ibm.commerce.payments.plugincontroller.Batch buildBatch(com.ibm.commerce.payments.plugincontroller.beans.PPCBatchData batchData,
                                                                                  java.util.ArrayList financialTransactionList)
                                                                           throws InternalException
        This method is used to build the batch value object of WebSphere commerce payments level from batch data access bean.
        Parameters:
        batchData -
        financialTransactionList -
        Returns:
        The built batch value object of WebSphere commerce payments level.
        Throws:
        InternalException