Package com.atosorigin.services.cad.apipayment.web

Examples of com.atosorigin.services.cad.apipayment.web.SIPSApiWeb


    LOGGER.debug("Price ="+price);

    try {
      //CA call preparation
      LOGGER.debug("CA call preparation");
      SIPSApiWeb api = new SIPSApiWeb(getPaymentInitFile());
      SIPSDataObject call = (SIPSDataObject) new SIPSCallParm();
      if(Portal.isPaymentDevMode()) {
        call.setValue("merchant_id", "013044876511111");
      } else {
        call.setValue("merchant_id", "047959265100018");//0+jayasoft siret
      }

            String locale = "en";
            Context ctx = ContextHolder.getContext();
            if (ctx!=null) {
                locale = ctx.getLocale().getLanguage();
            }
            call.setValue("language", locale);
      call.setValue("order_id", String.valueOf(o.getId()));
      call.setValue("customer_id", String.valueOf(o.getBuyer().getId()));
      call.setValue("merchant_country", "fr");
      //TODO compute Tax
      call.setValue("amount", ""+Math.round(price*100));
      call.setValue("currency_code", "978");
      call.setValue("normal_return_url", server+"/account/register/validateBillingForm.do?" + Params.GENERAL.PARAMS.LOCALE + "=" + locale);
      call.setValue("cancel_return_url", server+"/cancelPaymentServlet?" + Params.GENERAL.PARAMS.LOCALE + "=" + locale);
      call.setValue("automatic_response_url", server+"/account/register/validatePayment.do?" + Params.GENERAL.PARAMS.LOCALE + "=" + locale);
      LOGGER.info("CA call to render card html");
      return api.sipsPaymentCallFunc(call);
    } catch (FileNotFoundException e) {
      throw ServiceException.create("Internal error", "Configuration file not found", e);
    } catch (RegistrationException e) {
      throw ServiceException.create("Internal error", "Unable to add user", e);
    } catch (SIPSException e) {
View Full Code Here


  }
 
  public PaymentInfo validatePayment(String cypheredtxt) throws ServiceException {
    try {
      LOGGER.info("CA call preparation for payment validation");
      SIPSApiWeb api = new SIPSApiWeb(getPaymentInitFile());
      // Initialisation de l'objet reponse
      SIPSDataObject resp = (SIPSDataObject) new SIPSResponseParm();
      // Recuperation de la variable cryptee postee
      // Decryptage de la reponse
      resp = api.sipsPaymentResponseFunc(cypheredtxt);   
      String orderId = resp.getValue("order_id");
      LOGGER.debug("orderId ="+orderId);
      String authorisationId = resp.getValue("authorisation_id");
     
      LOGGER.debug("authorisationId ="+authorisationId);
View Full Code Here

TOP

Related Classes of com.atosorigin.services.cad.apipayment.web.SIPSApiWeb

Copyright © 2018 www.massapicom. 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.