Package com.atosorigin.services.cad.common

Examples of com.atosorigin.services.cad.common.SIPSDataObject


    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) {
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);
      /*
       00 Autorisation accepte?e
       02 demande d�autorisation par te?le?phone a? la banque a? cause d�un
       de?passement de plafond d�autorisation sur la carte
       03 � Champ merchant_id invalide, ve?rifier la valeur renseigne?e
       dans la reque?te
       � Contrat de vente a? distance inexistant, contacter votre
       banque.
       05 Autorisation refuse?e
       12 Transaction invalide, ve?rifier les parame?tres transfe?re?s dans la
       reque?te.
       17 Annulation de l�internaute
       30 Erreur de format.
       34 Suspicion de fraude
       75 Nombre de tentatives de saisie du nume?ro de carte de?passe?. 
       90 Service temporairement indisponible
       */
      String bankResponseCode = resp.getValue("response_code");
      LOGGER.debug("bankResponseCode ="+bankResponseCode);
      String transactionId = resp.getValue("transaction_id");
      LOGGER.debug("transactionId ="+transactionId);
     
      Order pendingOrder = Portal.getInstance().getPricingService().getOrder(Long.valueOf(orderId));
      LOGGER.debug("pendingOrder ="+pendingOrder);
      //payment authorized
View Full Code Here

TOP

Related Classes of com.atosorigin.services.cad.common.SIPSDataObject

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.