Ejemplo n.º 1
0
  private void inheritParentPI() {
    // inherit parent PI's if customer has privilege
    try {
      List<String> privileges =
          mobBasePage.getDefaultPrivileges(
              customer.getCustomerTypeId(), customer.getRiskCategoryId());
      if (PortalUtils.exists(privileges) && privileges.contains(Constants.PRIV_AUTO_INHERIT_PIS)) {
        List<WalletEntry> weList =
            mobBasePage.getWalletEntryList(customer.getParentId(), null, null);
        if (PortalUtils.exists(weList)) {
          for (WalletEntry we : weList) {
            LOG.debug(
                "# add sva["
                    + we.getPaymentInstrumentId()
                    + "] to the wallet of customer["
                    + customer.getId()
                    + "]");

            mobBasePage.createAgentWalletEntry(
                customer.getId(), we.getPaymentInstrumentId(), we.getAlias());
          }
        }
      }
    } catch (Exception e) {
      error(getLocalizer().getString("ERROR.CREATE_AGENT_FAILURE", this));

      LOG.error("# An error occurred while creating new customer's wallet Entry", e);
    }
  }