5 Replies Latest reply on Apr 19, 2017 10:59 AM by 1020515

    customized parameters to payment related pipeline

    1020515

      Hi Guys,

       

      ProcCreateGiftcardInfo this is the one of the processor in payment pipeline and in the

      runprocess(Object param,PipelineResult result)

       

      i want to add/customize parameters what ever we are passing to runprocess method how we can achive this.

       

       

      can any give me the clear idea with any configuration information.

       

      Note : please don't share google docs related to it.need code related info not the theoretical info.

       

       

      Thanks....

        • 1. Re: customized parameters to payment related pipeline
          Nooruddin Shaik

          Override the method ProcCreateGiftcardInfo.runProcess() and add/modify the parameters then call super

           

          MyProcCreateGiftcardInfo extends ProcCreateGiftcardInfo{

          runprocess(Object param,PipelineResult result){

            // modify the parameters

          return super.runprocess(param,result);

          }

           

          And make the changes in Component file to use the customized class.

           

          Peace

          Shaik

           

           

          • 2. Re: customized parameters to payment related pipeline
            1020515

            thanks for your information

             

            i need other info regarding it

             

            from where the param will pass to runprocess() method ,if i want to add extra parameters to the Object param where we need to do customization.

             

            for ex in Object param contain 4 parameters like getamount(),getorder()...

            i want to add 3 more parameters like getxxxx(), get yyy()

             

            how we can achieve it can you please clarify it .

             

            Thanks

            • 3. Re: customized parameters to payment related pipeline
              Nooruddin Shaik

              PaymentManager.runProcess() method calls the payments pipeline chains.

              You can override this method to add extra parameters.

               

              MyPipelineManager extends PipelineManager{

               

              protected PipelineResult runProcessorChain(String pChainName, PaymentManagerPipelineArgs pParameters)

                throws CommerceException {

                  //add more parameters to pParameters

                  pParameters.put("key", "vaue");

                  return super.runProcess(pChainName, pParameters);

                }

               

              }

               

              Peace

              Shaik

              • 4. Re: customized parameters to payment related pipeline
                1020515

                thank you Nooruddin i got it now.

                • 5. Re: customized parameters to payment related pipeline
                  1020515

                  its just an rough way of explanation

                  an one need fallow the OOTB way, will get know the clear way.

                   

                   

                  1.in commercepipeline.xml created new pipeline moveToPaymentPage with the link repriceNeededChain.

                  2.in your billing form handler call your pipeline chain by passing the parameters

                  3.here  we are calling moveToPaymentPage by adding parameters

                  4.atg will call moveToPaymentPage chain and pass the parameters to its processor.

                  you need to create component for all the below classes

                   

                   

                  commercepipeline.xml

                   

                   

                  <pipelinechain name="moveToPaymentPage" headlink="repriceNeededChain" transaction="TX_REQUIRED" xml-combine="replace">

                          <pipelinelink name="repriceNeededChain" transaction="TX_MANDATORY">

                          <processor jndi="/com/ecommerce/pricing/processor/PaymentRepriceNeeded"/>

                         </pipelinelink>

                    </pipelinechain>

                  </pipelinechain>

                   

                   

                   

                   

                  MyBillingInfoFormHandler.java

                  boolean doRepricePayment(){

                  Boolean prepriceNeeded = true;

                  l_oResult = ((MyPaymentGroupManager) getPaymentGroupManager()).runMoveToPaymentPageProcessor(pOrder, pProfile, prepriceNeeded);

                  }

                   

                   

                  EcomPaymentGroupManager.java extends PaymentGroupManager

                  runMoveToPaymentPageProcessor(pOrder, pProfile, prepriceNeeded){

                  Map<String, Object> l_oParamMap = new HashMap<String, Object>();

                          l_oParamMap.put("ORDER", pOrder);

                          l_oParamMap.put("PROFILE", pProfile);

                          l_oParamMap.put("needed",prepriceNeeded);

                    l_oParamMap.put("chainId",moveToPaymentPage);

                    //from here you can pass your customized parameters to your chain

                          PipelineResult l_oResult = getOrderManager().getPipelineManager().runProcess("moveToPaymentPage", l_oParamMap);

                          return l_oResult;

                  }

                   

                   

                  PaymentRepriceNeeded.java extends PipelineProcessor

                  public int runProcess(Object pParam, PipelineResult pResult) throws Exception {

                          if (isEnable()) {

                              Map l_oParamMap = (HashMap) pParam;

                              String chain = (String) l_oParamMap.get(pParam.get("chainId"));

                              Boolean l_bIsRepriceNeeded = (Boolean) l_oParamMap.get("needed");

                          }

                          return SUCCESS_REPRICE;

                      }