Jump to content

Payment Module Development. Loading Order details in TPL file


Recommended Posts

Hi there, I am developing a payment module. I have refered to payment example and i am stuck. I want to load the order details in my .tpl file so that i can process this data to third party API. Here is my code in paymentexample file. I want to load the data in paymemateview.tpl file. Now when i click on action i am directly taken to postProcess method in validation controller. But i first want to load the data in TPL file and then go to third party api. get the response and then save the data. I am a beginner. If anyone could help me please to do so.

 public function getExternalPaymentOption()
    {

         $externalOption = new PaymentOption();
         $formAction = $this->context->link->getModuleLink($this->name, 'validation', array(), true);
        // $this->smarty->assign(['action' => $formAction,'params'=>$this->displayName]);
         $new_params=$this->smarty->assign('params', $params['cart']);
          $paymentForm = $this->fetch('module:paymentexample/views/templates/front/paymemateview.tpl');
         $this->smarty->assign('cantidad','1234');

        $externalOption->setCallToActionText($this->l('PayMeMate'))
                       ->setAction($formAction)
                       ->setForm($paymentForm);

                    


        return $externalOption;
    }

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...