Examples of PaymentGateway


Examples of com.jada.jpa.entity.PaymentGateway

 
  static Logger logger = Logger.getLogger(PaymentExpressEngine.class);
 
  public PaymentExpressEngine(Site site, Long paymentGatewayId) throws Exception {
    this.site = site;
    PaymentGateway paymentGateway = PaymentGatewayDAO.load(site.getSiteId(), paymentGatewayId);
    PaymentExpress paymentExpress = (PaymentExpress) Utility.joxUnMarshall(PaymentExpress.class, paymentGateway.getPaymentGatewayData());

    postUsername = paymentExpress.getPostUsername();
    postPassword = paymentExpress.getPostPassword();
    environment = paymentExpress.getEnvironment();
   
View Full Code Here

Examples of com.jada.jpa.entity.PaymentGateway

          siteCurrency.setActive(Constants.VALUE_NO);
        }
        siteCurrency.setRecUpdateBy(user.getUserId());
        siteCurrency.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
            if (!Format.isNullOrEmpty(siteCurrencyForm.getPaymentGatewayId())) {
              PaymentGateway paymentGateway = (PaymentGateway) em.find(PaymentGateway.class, Format.getLong(siteCurrencyForm.getPaymentGatewayId()));
              siteCurrency.setPaymentGateway(paymentGateway);
            }
            else {
              siteCurrency.setPaymentGateway(null);
            }
            if (!Format.isNullOrEmpty(siteCurrencyForm.getPayPalPaymentGatewayId())) {
              PaymentGateway paymentGateway = (PaymentGateway) em.find(PaymentGateway.class, Format.getLong(siteCurrencyForm.getPayPalPaymentGatewayId()));
              siteCurrency.setPayPalPaymentGateway(paymentGateway);
            }
            else {
              siteCurrency.setPayPalPaymentGateway(null);
            }
View Full Code Here

Examples of com.jada.jpa.entity.PaymentGateway

    vector.add(new LabelValueBean("", ""));
        query = em.createQuery("from PaymentGateway where siteId = :siteId order by paymentGatewayName");
        query.setParameter("siteId", form.getSiteId());
        iterator = query.getResultList().iterator();
        while (iterator.hasNext()) {
          PaymentGateway paymentGateway = (PaymentGateway) iterator.next();
          LabelValueBean bean = new LabelValueBean(paymentGateway.getPaymentGatewayName(), Format.getLong(paymentGateway.getPaymentGatewayId()));
          vector.add(bean);
        }
        LabelValueBean paymentGateways[] = new LabelValueBean[vector.size()];
        vector.copyInto(paymentGateways);
        form.setPaymentGateways(paymentGateways);
       
    vector = new Vector<LabelValueBean>();
    vector.add(new LabelValueBean("", ""));
        query = em.createQuery("from PaymentGateway where siteId = :siteId and paymentGatewayProvider = :paymentGatewayProvider order by paymentGatewayName");
        query.setParameter("siteId", form.getSiteId());
        query.setParameter("paymentGatewayProvider", PaymentExpressEngine.class.getSimpleName());
        iterator = query.getResultList().iterator();
        while (iterator.hasNext()) {
          PaymentGateway paymentGateway = (PaymentGateway) iterator.next();
          LabelValueBean bean = new LabelValueBean(paymentGateway.getPaymentGatewayName(), Format.getLong(paymentGateway.getPaymentGatewayId()));
          vector.add(bean);
        }
        LabelValueBean payPalPaymentGateways[] = new LabelValueBean[vector.size()];
        vector.copyInto(payPalPaymentGateways);
        form.setPayPalPaymentGateways(payPalPaymentGateways);
View Full Code Here

Examples of com.jada.jpa.entity.PaymentGateway

        calcPage(adminBean, form, list, pageNo);
        Vector<PaymentGatewayDisplayForm> vector = new Vector<PaymentGatewayDisplayForm>();
        int startRecord = (form.getPageNo() - 1) * adminBean.getListingPageSize();
        int endRecord = startRecord + adminBean.getListingPageSize();
        for (int i = startRecord; i < list.size() && i < endRecord; i++) {
          PaymentGateway paymentGateway = (PaymentGateway) list.get(i);
          PaymentGatewayDisplayForm paymentGatewayDisplay = new PaymentGatewayDisplayForm();
          paymentGatewayDisplay.setPaymentGatewayName(paymentGateway.getPaymentGatewayName());
          paymentGatewayDisplay.setPaymentGatewayId(paymentGateway.getPaymentGatewayId().toString());
            vector.add(paymentGatewayDisplay);
        }
        PaymentGatewayDisplayForm paymentGateways[] = new PaymentGatewayDisplayForm[vector.size()];
        vector.copyInto(paymentGateways);
        form.setPaymentGateways(paymentGateways);
View Full Code Here

Examples of com.jada.jpa.entity.PaymentGateway

            PaymentGatewayDisplayForm paymentGateways[] = form.getPaymentGateways();
            for (int i = 0; i < paymentGateways.length; i++) {
              if (!paymentGateways[i].isRemove()) {
                continue;
              }
                PaymentGateway paymentGateway = new PaymentGateway();
                paymentGateway = PaymentGatewayDAO.load(getAdminBean(request).getSite().getSiteId(), Format.getLong(paymentGateways[i].getPaymentGatewayId()));
                em.remove(paymentGateway);
            }
            em.getTransaction().commit();
          }
View Full Code Here

Examples of com.jada.jpa.entity.PaymentGateway

                              HttpServletRequest request,
                              HttpServletResponse response)
        throws Throwable {
      Site site = getAdminBean(request).getSite();
        PaymentGatewayMaintActionForm form = (PaymentGatewayMaintActionForm) actionForm;
        PaymentGateway paymentGateway = new PaymentGateway();
        paymentGateway = PaymentGatewayDAO.load(getAdminBean(request).getSite().getSiteId(), Format.getLong(form.getPaymentGatewayId()));
        form.setMode("U");
        copyProperties(form, paymentGateway);
        initForm(form, site);
        FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
View Full Code Here

Examples of com.jada.jpa.entity.PaymentGateway

   
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    PaymentGatewayMaintActionForm form = (PaymentGatewayMaintActionForm) actionForm;
 
    try {
      PaymentGateway paymentGateway = PaymentGatewayDAO.load(getAdminBean(request).getSite().getSiteId(), Format.getLong(form.getPaymentGatewayId()));
      em.remove(paymentGateway);
      em.getTransaction().commit();
    }
    catch (Exception e) {
      if (Utility.isConstraintViolation(e)) {
View Full Code Here

Examples of com.jada.jpa.entity.PaymentGateway

    AdminBean adminBean = getAdminBean(request);
    Site site = adminBean.getSite();
    String siteId = site.getSiteId();

    PaymentGateway paymentGateway = new PaymentGateway();
    if (!insertMode) {
      paymentGateway = PaymentGatewayDAO.load(siteId, Format.getLong(form.getPaymentGatewayId()));
    }

    ActionMessages errors = validate(form, insertMode);
    if (errors.size() != 0) {
      saveMessages(request, errors);
      initForm(form, site);
      return mapping.findForward("error");
    }

    if (insertMode) {
      paymentGateway.setSite(site);
      paymentGateway.setRecCreateBy(adminBean.getUser().getUserId());
      paymentGateway.setRecCreateDatetime(new Date(System.currentTimeMillis()));
    }
    paymentGateway.setPaymentGatewayName(form.getPaymentGatewayName());
    String provider = form.getPaymentGatewayProvider();
    paymentGateway.setPaymentGatewayProvider(provider);
    String paymentGatewayData = paymentGateway.getPaymentGatewayData();
    if (provider.equals(AuthorizeNetEngine.class.getSimpleName())) {
      AuthorizeNet authorizeNet = new AuthorizeNet();
      if (!insertMode) {
        authorizeNet = (AuthorizeNet) Utility.joxUnMarshall(AuthorizeNet.class, paymentGatewayData);
      }
      authorizeNet.setLoginId(form.getAuthorizeNetLoginId());
      if (!Format.isNullOrEmpty(form.getAuthorizeNetTranKey())) {
        authorizeNet.setTranKey(form.getAuthorizeNetTranKey());
      }
      authorizeNet.setEnvironment(form.getAuthorizeNetEnvironment());
      paymentGatewayData = Utility.joxMarshall("AuthorizeNet", authorizeNet);
    }
    if (provider.equals(PsiGateEngine.class.getSimpleName())) {
      PSIGate psiGate = new PSIGate();
      if (!insertMode) {
        psiGate = (PSIGate) Utility.joxUnMarshall(PSIGate.class, paymentGatewayData);
      }
      psiGate.setStoreId(form.getPsiGateStoreId());
      if (!Format.isNullOrEmpty(form.getPsiGatePassPhrase())) {
        psiGate.setPassPhrase(form.getPsiGatePassPhrase());
      }
      psiGate.setEnvironment(form.getPsiGateEnvironment());
      paymentGatewayData = Utility.joxMarshall("PSIGate", psiGate);
    }
    if (provider.equals(PayPalEngine.class.getSimpleName())) {
      PayPalExpressCheckOut payPalExpressCheckOut = new PayPalExpressCheckOut();
      if (!insertMode) {
        payPalExpressCheckOut = (PayPalExpressCheckOut) Utility.joxUnMarshall(PayPalExpressCheckOut.class, paymentGatewayData);
      }
      payPalExpressCheckOut.setPaymentPaypalCustClassId(Format.getLong(form.getPaymentPaypalCustClassId()));
      payPalExpressCheckOut.setPaymentPaypalApiUsername(form.getPaymentPaypalApiUsername());
      payPalExpressCheckOut.setPaymentPaypalEnvironment(form.getPaymentPaypalEnvironment());
      if (!Format.isNullOrEmpty(form.getPaymentPaypalExtraAmount())) {
        payPalExpressCheckOut.setPaymentPaypalExtraAmount(Format.getDouble(form.getPaymentPaypalExtraAmount()));
      }
      if (!Format.isNullOrEmpty(form.getPaymentPaypalExtraPercentage())) {
        payPalExpressCheckOut.setPaymentPaypalExtraPercentage(Format.getDouble(form.getPaymentPaypalExtraPercentage()));
      }
      if (!Format.isNullOrEmpty(form.getPaymentPaypalApiPassword())) {
        payPalExpressCheckOut.setPaymentPaypalApiPassword(AESEncoder.getInstance().encode(form.getPaymentPaypalApiPassword()));
      }
      if (!Format.isNullOrEmpty(form.getPaymentPaypalSignature())) {
        payPalExpressCheckOut.setPaymentPaypalSignature(AESEncoder.getInstance().encode(form.getPaymentPaypalSignature()));
      }
      paymentGatewayData = Utility.joxMarshall("PayPalExpressCheckOut", payPalExpressCheckOut);
    }
    if (provider.equals(PayPalWebsitePaymentProEngine.class.getSimpleName())) {
      PayPalWebsitePaymentPro payPalWebsitePaymentPro = new PayPalWebsitePaymentPro();
      if (!insertMode) {
        payPalWebsitePaymentPro = (PayPalWebsitePaymentPro) Utility.joxUnMarshall(PayPalWebsitePaymentPro.class, paymentGatewayData);
      }
      payPalWebsitePaymentPro.setPaypalApiUsername(form.getPaypalWebsitePaymentProApiUsername());
      payPalWebsitePaymentPro.setPaypalEnvironment(form.getPaypalWebsitePaymentProEnvironment());
      if (!Format.isNullOrEmpty(form.getPaypalWebsitePaymentProApiPassword())) {
        payPalWebsitePaymentPro.setPaypalApiPassword(AESEncoder.getInstance().encode(form.getPaypalWebsitePaymentProApiPassword()));
      }
      if (!Format.isNullOrEmpty(form.getPaypalWebsitePaymentProSignature())) {
        payPalWebsitePaymentPro.setPaypalSignature(AESEncoder.getInstance().encode(form.getPaypalWebsitePaymentProSignature()));
      }
      paymentGatewayData = Utility.joxMarshall("PayPalWebsitePaymentProEngine", payPalWebsitePaymentPro);
    }
    if (provider.equals(PaymentExpressEngine.class.getSimpleName())) {
      PaymentExpress paymentExpress = new PaymentExpress();
      if (!insertMode) {
        paymentExpress = (PaymentExpress) Utility.joxUnMarshall(PaymentExpress.class, paymentGatewayData);
      }
      paymentExpress.setPostUsername(form.getPaymentExpressPostUsername());
      if (!Format.isNullOrEmpty(form.getPaymentExpressPostPassword())) {
        paymentExpress.setPostPassword(form.getPaymentExpressPostPassword());
      }
      paymentExpress.setEnvironment(form.getPaymentExpressEnvironment());
      paymentGatewayData = Utility.joxMarshall("PaymentExpress", paymentExpress);
    }
    if (provider.equals(PayPalPayFlowEngine.class.getSimpleName())) {
      PayPalPayFlow paypalPayFlow = new PayPalPayFlow();
      if (!insertMode) {
        paypalPayFlow = (PayPalPayFlow) Utility.joxUnMarshall(PayPalPayFlow.class, paymentGatewayData);
      }
      paypalPayFlow.setUser(form.getPaypalPayFlowUser());
      paypalPayFlow.setVendor(form.getPaypalPayFlowVendor());
      paypalPayFlow.setPartner(form.getPaypalPayFlowPartner());
      if (!Format.isNullOrEmpty(form.getPaypalPayFlowPassword())) {
        paypalPayFlow.setPassword(AESEncoder.getInstance().encode(form.getPaypalPayFlowPassword()));
      }
      paypalPayFlow.setEnvironment(form.getPaypalPayFlowEnvironment());
      paymentGatewayData = Utility.joxMarshall("PayPalPayFlow", paypalPayFlow);
    }
    if (provider.equals(EWayCVNAustraliaEngine.class.getSimpleName())) {
      EWayCVNAustralia eWayCVNAustralia = new EWayCVNAustralia();
      if (!insertMode) {
        eWayCVNAustralia = (EWayCVNAustralia) Utility.joxUnMarshall(EWayCVNAustralia.class, paymentGatewayData);
      }
      eWayCVNAustralia.setCustomerId(form.getEWayCVNAustraliaCustomerId());
      eWayCVNAustralia.setEnvironment(form.getEWayCVNAustraliaEnvironment());
      paymentGatewayData = Utility.joxMarshall("EWayCVSAustralia", eWayCVNAustralia);
    }
    paymentGateway.setPaymentGatewayData(paymentGatewayData);
   
    paymentGateway.setRecUpdateBy(adminBean.getUser().getUserId());
    paymentGateway.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    if (insertMode) {
      em.persist(paymentGateway);
    }
    form.setMode("U");
        initForm(form, site);
    form.setPaymentGatewayId(paymentGateway.getPaymentGatewayId().toString());
        FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
    return mapping.findForward("success");
  }
View Full Code Here

Examples of com.jada.jpa.entity.PaymentGateway

public class PaymentGatewayDAO extends Currency {
  private static final long serialVersionUID = -8086202210621920693L;
  public static PaymentGateway load(String siteId, Long paymentGatewayId) throws SecurityException, Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    PaymentGateway paymentGateway = (PaymentGateway) em.find(PaymentGateway.class, paymentGatewayId);
    if (paymentGateway == null) {
      return null;
    }
    if (!paymentGateway.getSite().getSiteId().equals(siteId)) {
      throw new SecurityException();
    }
    return paymentGateway;
  }
View Full Code Here

Examples of com.jada.jpa.entity.PaymentGateway

 
  static Logger logger = Logger.getLogger(PsiGateEngine.class);
 
  public PsiGateEngine(Site site, Long paymentGatewayId) throws Exception {
    this.site = site;
    PaymentGateway paymentGateway = PaymentGatewayDAO.load(site.getSiteId(), paymentGatewayId);
    PSIGate psiGate = (PSIGate) Utility.joxUnMarshall(PSIGate.class, paymentGateway.getPaymentGatewayData());

    String value = "";
    SiteDomainParamBean siteDomainParamBean = SiteDomainDAO.getSiteDomainParamBean(site.getSiteDomainDefault().getSiteDomainLanguage(),
                                             site.getSiteDomainDefault().getSiteDomainLanguage());
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.