Class PIAPaymentTypePanel

All Implemented Interfaces:
PIAPaymentTypePanelBean, PAppComponent, PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PViewDataChangeListener, ContainerListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, Remote, EventListener, Accessible
Direct Known Subclasses:
PCreditCardPanel, PFUSADirDebitPanel, PIADefaultPaymentTypePanel, PInvoicePOPanel, PSepaPanel, PSepaRegisterPanel

public class PIAPaymentTypePanel extends PI18NPanel implements PIAPaymentTypePanelBean
Base class for the panels displaying payment types (credit card, dir debit, etc.) for creating or updating an account. This class provides a common collectData method that adds any required default or additional data.
See Also:
  • Constructor Details

    • PIAPaymentTypePanel

      public PIAPaymentTypePanel()
      Default constructor the the payment type panel
  • Method Details

    • collectData

      public void collectData(PCollectDataEvent event)
      Collects data from this panel for three different cases:
      1) During page validation when changing tabs during account creation (event.getReason() is PCollectDataEvent.FOR_VALIDATION),
      2) When saving a new account (event.getReason() is PCollectDataEvent.FOR_STORING),
      3) When updating an existing account (event.getReason() is PCollectDataEvent.FOR_DIRTY).
      Each of these three cases involves different data collection:
      1) For page validation, the additional data that needs to be collected are a FldPayinfo type-only POID (appropriate to the billing type) and the FldBillType.
      2) For saving a new account, data is required for all fields (whether the user has entered data or not), a FldPayinfo type-only POID (appropriate to the billing type) and the FldBillType.
      3) For updating an account, the additional data that needs to be collected are the FldPayinfoObj's POID and the FldBillType.
      Specified by:
      collectData in interface PCollectDataListener
      Overrides:
      collectData in class PIACustomizablePanel
      Parameters:
      event - The collect data event containing the reason code and model handle.
    • setAccountCreationPanel

      public void setAccountCreationPanel(boolean b)
      Determines whether the panel should exhibit account creation- or maintenance-time behavior
      Parameters:
      b - should be false when the panel is used during account maintenance. True by default.
    • isAccountCreationPanel

      public boolean isAccountCreationPanel()
      Determines if the panel should exhibit account creation behavior
      Returns:
      true if this panel is being used during account creation
    • setReceivedSharedData

      public void setReceivedSharedData(boolean b)
      Determines whether the panel should exhibit account creation- or maintenance-time behavior
      Parameters:
      b - should be true when the panel receives shared data, false by default
    • hasReceivedSharedData

      public boolean hasReceivedSharedData()
      Determines if the panel has been given any shared data
      Returns:
      true if this panel has received shared data
    • shareInData

      public void shareInData()
      Called during account creation to allow subclasses of this class to share in data. Payment panels will likely be interested in shared data from the billing contact. This base class implementation does nothing.
    • shareInData

      public void shareInData(PModelHandle pm)
      Called at maintenance time when changing payment types to allow subclasses of this class to share in data from the passed-in account. Payment panels will likely be interested in shared data from the billing contact. This base class implementation does nothing.
      Parameters:
      pm - account model handle.
    • handleWizardValidationError

      public int handleWizardValidationError(com.portal.app.util.CustomerError error)
      Handles account creation validate-time errors. This base class implementation makes use of default validate-time error handling provided by the wizard framework.
      Parameters:
      error - The error.
      Returns:
      WizardValidationManager.VALIDATION_NOMATCH if no matching error field is found or WizardValidationManager.VALIDATION_IGNOREERROR if the user chooses to ignore a validation error or WizardValidationManager.VALIDATION_FIXERROR if the user chooses to fix the error or
    • handleWizardCommitError

      public boolean handleWizardCommitError(com.portal.app.util.CustomerError error)
      Handles account creation commit-time errors. This base class implementation makes use of default commit-time error handling provided by the wizard framework.
      Parameters:
      error - The error.
      Returns:
      true if the payment panel will handle the error; otherwise false.
    • validatePaymentPanel

      public boolean validatePaymentPanel()
      Validates the fields in the payment panel. This is a mechanism for the individual payment panels to do payment-specific validation. This validation supplements any Portal-level validation.
      Returns:
      boolean - true if all fields in individual payment panel are valid, false otherwise. The default implementation in this (base) payment panel just returns true since there is no validation done here.
    • defaultsForUpdate

      public boolean defaultsForUpdate(PModelHandle model) throws RemoteException
      Implement the PIAPaymentPanelBean interface(s) These are dummy set of interfaces in place to allow the control to transfer to the right payment bean(invoice,credit etc.,) at run time
      Specified by:
      defaultsForUpdate in interface PIAPaymentTypePanelBean
      Parameters:
      model -
      Returns:
      false if the model handle for the view for this component is null; true otherwise
      Throws:
      RemoteException
    • defaultsForStoring

      public void defaultsForStoring(PModelHandle model) throws RemoteException
      Implement the PIAPaymentTypePanelBean interface
      Specified by:
      defaultsForStoring in interface PIAPaymentTypePanelBean
      Parameters:
      model -
      Throws:
      RemoteException
    • defaultsForValidation

      public void defaultsForValidation(PModelHandle model) throws RemoteException
      Implement the PIAPaymentTypePanelBean interface.
      Specified by:
      defaultsForValidation in interface PIAPaymentTypePanelBean
      Parameters:
      model -
      Throws:
      RemoteException
    • getNameAddressData

      public NameAddressData getNameAddressData(PModelHandle model) throws RemoteException
      Implement the PIAPaymentTypePanelBean interface
      Specified by:
      getNameAddressData in interface PIAPaymentTypePanelBean
      Parameters:
      model - Model from which name/address etc., are to be extracted
      Returns:
      nameAddress Name and Address Data
      Throws:
      RemoteException
    • getFullName

      protected String getFullName(String firstName, String middleName, String lastName)
      Formats the passed-in first, middle, and last names into a full name.
      Parameters:
      firstName - first name
      middleName - middle name
      lastName - last name
      Returns:
      a full name based upon either the contactname.twonamesformat or contactname.threenamesformat message format string depending on how many non-empty (or non-null) name strings are passed in.