local/modules/Klikandpay/Klikandpay.php
/**
     *  Method used by payment gateway.
     *
     *  If this method return a \Thelia\Core\HttpFoundation\Response instance, this response is send to the
     *  browser.
     *
     *  In many cases, it's necessary to send a form to the payment gateway. On your response you can return this form already
     *  completed, ready to be sent
     *
     * @param  \Thelia\Model\Order $order processed order
     * @return null|\Thelia\Core\HttpFoundation\Response
     */
Method used by payment gateway.
If this method return a \Thelia\Core\HttpFoundation\Response instance, this response is send to the
browser.

In many cases, it's necessary to send a form to the payment gateway. On your response you can return this form already
completed, ready to be sent


Method used by payment gateway . If this method return a \ Thelia \ Core \ HttpFoundation \ Response instance this response is send to the browser . In many cases it ' s necessary to send a form to the payment gateway . On your response you can return this form already completed ready to be sent
public function pay(Order $order)
    {
        try {
            $parameters = $this->getParameters($order->getTotalAmount(), $order->getCustomer());
            $hash = $this->getHash($parameters, $order->getRef());
            $order->setTransactionRef($hash);
            $order->save();
            $parameters['RETOUR'] = $hash;
            if (ConfigQuery::read('klikandpay_retourvok') != "")
            {
                $parameters['RETOURVOK'] = $this->returnURL(ConfigQuery::read('klikandpay_retourvok'), $order);
            }
            if (ConfigQuery::read('klikandpay_retourvhs') != "")
            {
                $parameters['RETOURVHS'] = $this->returnURL(ConfigQuery::read('klikandpay_retourvhs'), $order);
            }
            $parameters['L'] = $this->getRequest()->getSession()->getLang()->getCode();
            return $this->render(
                KlikandpayFrontController::ORDER_PAY,
                array('fields' => $parameters, 'action' => $this->getAction())
            );
        } catch (\Exception $e) {
            return $this->render(KlikandpayFrontController::ORDER_FAILED);
        }
    }
public function pay ( Order $ order ) { try { $ parameters = $ this -> getParameters ( $ order -> getTotalAmount ( ) , $ order -> getCustomer ( ) ) ; $ hash = $ this -> getHash ( $ parameters , $ order -> getRef ( ) ) ; $ order -> setTransactionRef ( $ hash ) ; $ order -> save ( ) ; $ parameters [ 'RETOUR' ] = $ hash ; if ( ConfigQuery :: read ( 'klikandpay_retourvok' ) != " " ) { $ parameters [ 'RETOURVOK' ] = $ this -> returnURL ( ConfigQuery :: read ( 'klikandpay_retourvok' ) , $ order ) ; } if ( ConfigQuery :: read ( 'klikandpay_retourvhs' ) != " " ) { $ parameters [ 'RETOURVHS' ] = $ this -> returnURL ( ConfigQuery :: read ( 'klikandpay_retourvhs' ) , $ order ) ; } $ parameters [ 'L' ] = $ this -> getRequest ( ) -> getSession ( ) -> getLang ( ) -> getCode ( ) ; return $ this -> render ( KlikandpayFrontController :: ORDER_PAY , array ( 'fields' => $ parameters , 'action' => $ this -> getAction ( ) ) ) ; } catch ( \ Exception $ e ) { return $ this -> render ( KlikandpayFrontController :: ORDER_FAILED ) ; } }
Method used by payment gateway.
Method used by payment gateway .
// Array of data to send // Hash to secure the transaction // Send secured hash to Klik & Pay // Return URL (RETOURVOK : Variable used to complete the URL if the transaction is accepted) // Return URL (RETOURVHS : Variable used to complete the URL if the transaction is refused or cancelled) // Multilingual website