Jump to content

[SOLVED] Payment success page


Recommended Posts

After intregate payumoney payment gateway and after transaction complete i get

 

http://www.put2kart.com/modules/payu/success.php this page. But it does not take

(<link href="/themes/put2kart/css/global.css" rel="stylesheet" type="text/css" media="all" />) this

 

stylesheet. How can i include this stylesheet in which page in the header porsion of which file?

 

Please help me.

post-779274-0-74736400-1399375501_thumb.jpeg

Link to comment
Share on other sites

Sure this is my code

 

<?php  
 
        include(dirname(__FILE__).'/../../config/config.inc.php');
        include(dirname(__FILE__).'/../../init.php');
        include(dirname(__FILE__).'/payu.php');
        include(dirname(__FILE__).'/../../header.php');
            
         $payu = new payu();
        
         $response=$_REQUEST;
        
         $key=Configuration::get('PAYU_MERCHANT_ID');
           $salt=Configuration::get('PAYU_SALT');
         $log=Configuration::get('PAYU_LOGS');
         
         $baseUrl=Tools::getShopDomain(true, true).__PS_BASE_URI__;    
         $order_id= $response['txnid'];
         $transactionId= $response['mihpayid'];
        
          
         $smarty->assign('baseUrl',$baseUrl);
         $smarty->assign('orderId',$order_id);
         $smarty->assign('transactionId',$transactionId);
        
        
         $amount        = $response['amount'];
         $productinfo   = $response['productinfo'];
         $firstname     = $response['firstname'];;
         $email         = $response['email'];
         $txnid         = $response['udf2'];
        
            
            
         if($response['status'] == 'success')
         {
            
            
                $Udf1 = $response['udf1'];
                 $Udf2 = $response['udf2'];
                 $Udf3 = $response['udf3'];
                 $Udf4 = $response['udf4'];
                 $Udf5 = $response['udf5'];
                 $Udf6 = $response['udf6'];
                 $Udf7 = $response['udf7'];
                 $Udf8 = $response['udf8'];
                 $Udf9 = $response['udf9'];
                 $Udf10 = $response['udf10'];
            
            
            
            
            
 $txnid=$response['txnid'];
          $keyString =  $key.'|'.$txnid.'|'.$amount.'|'.$productinfo.'|'.$firstname.'|'.$email.'|'.$Udf1.'|'.$Udf2.'|'.$Udf3.'|'.$Udf4.'|'.$Udf5.'|'.$Udf6.'|'.$Udf7.'|'.$Udf8.'|'.$Udf9.'|'.$Udf10;
          
          $keyArray = explode("|",$keyString);
          $reverseKeyArray = array_reverse($keyArray);
          $reverseKeyString=implode("|",$reverseKeyArray);
            
            
             if($log==1 )    
             {
               $responseValue= str_replace( "'"," ",implode(",",$response));
               $successQuery="update ps_payu_order set payment_response='$responseValue' where id_order= ".$order_id;;
               Db::getInstance()->Execute($successQuery);
             }                    
            
            
             $status=$response['status'];
             $saltString     = $salt.'|'.$status.'|'.$reverseKeyString;
             $sentHashString = strtolower(hash('sha512', $saltString));
                        // print_r($sentHashString);echo"                   ";
            
             $responseHashString=$_REQUEST['hash'];
            
            
                         //print_r($responseHashString);
             if($sentHashString != $responseHashString)
             {
                
                $history = new OrderHistory();
                $history->id_order = (int)($order_id);
                $history->changeIdOrderState(Configuration::get('PS_OS_ERROR'), $history->id_order);
                $history->add();
                
                $smarty->display('failure.tpl');
             }
             else
             {
                
                
                             $history = new OrderHistory();
                               
                $history->id_order = (int)$response['txnid'];
                                
                               $smarty->display('success.tpl');
                               
                                $history->changeIdOrderState(2, $history->id_order/*(int)($order_id)*/);
                
                                
                                $history->add();
                                
                
                                
             }                
                
            
                
          }
            
            
           include(dirname(__FILE__).'/../../footer.php');

 

Link to comment
Share on other sites

And my success.tpl file code

 

 

<strong>You have successfully paid your order.</strong>
<br /><br />
<strong>Your order-id is {$orderId} </strong>
<br /><br />
<p >
    <a href="{$baseUrl}" title="Continue Shopping">
            Continue Shopping
    </a>
        <link href="{$baseUrl}themes/default/css/grid_prestashop.css" rel="stylesheet" type="text/css" media="all" />
        <link href="{$baseUrl}themes/default/css/global.css" rel="stylesheet" type="text/css" media="all" />
</p>

 

 

 

 

I'think need to change (<link href="{$baseUrl}themes/default/css/global.css" rel="stylesheet" type="text/css" media="all" />) this to

 

<link href="{$baseUrl}themes/put2kart/css/global.css" rel="stylesheet" type="text/css" media="all" />.Is this right thinking ?

Link to comment
Share on other sites

try to change this:

       include(dirname(__FILE__).'/../../config/config.inc.php');
        include(dirname(__FILE__).'/../../init.php');
        include(dirname(__FILE__).'/payu.php');
        include(dirname(__FILE__).'/../../header.php');

to this:

        include(dirname(__FILE__).'/../../config/config.inc.php');
        include(dirname(__FILE__).'/../../init.php');
        include(dirname(__FILE__).'/payu.php');
        $context = Context::getContext();
        $fc=new Frontcontroller();
        $fc->setmedia();
        include(dirname(__FILE__).'/../../header.php');

and let me know what's going on then

  • Like 1
Link to comment
Share on other sites

  • 6 months later...

module doesnt support prestashop in version 1.6

as you can see in url bar, module executes .php file

 

this is not how payment modules in prestashop 1.6 works

 

you have to:

- create controller to support 1.6 version

- apply modifications that i suggested to use, it's not a solution for prestashop 1.6, it's a kind of workaround.

Link to comment
Share on other sites

  • 3 months later...
  • 4 months later...
  • 2 months later...

Hello Guys,

 
I'm using PS 1.6.0.14 and I post my problem many times and asked for solution.. but no one reply.. :(
 
Please go through the link below..
 
please check out with any product by using the credentials below..
 
Test Credit Card Name: Use your name
Test Card Number: 5123456789012346 
Test C.V.V: 123 
Test Expiry: May 2017 
 
Issue : After completion of  transaction (Payment accepted) it's redirected without any order ID and with out any success message.. it showing only the header part.. if you press the ENTER in the URL bar (https://www.freshwana.com/modules/payu/success.php) then it's showing order details page.. url will look like this example https://www.freshwana.com/index.php?controller=order-detail?id_order=38
 
******************************************* success.php *******************************************
 
<?php  
 
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../init.php');
include(dirname(__FILE__).'/payu.php');
$context = Context::getContext();
$fc=new Frontcontroller();
$fc->setmedia();
include(dirname(__FILE__).'/../../header.php');
 
$payu = new payu();
 
$response=$_REQUEST;             
 
$key=Configuration::get('PAYU_MERCHANT_ID');
$salt=Configuration::get('PAYU_SALT');
$log=Configuration::get('PAYU_LOGS');         
 
$baseUrl=Tools::getShopDomain(true, true).__PS_BASE_URI__;
$order_id= $response['txnid']-354572829452247;
$transactionId= $response['mihpayid'];
 
$smarty->assign('baseUrl',$baseUrl);
$smarty->assign('orderId',$order_id);
$smarty->assign('transactionId',$transactionId);
 
$amount        = $response['amount'];
$productinfo   = $response['productinfo'];
$firstname     = $response['firstname'];;
$email         = $response['email'];
 
 
if($response['status'] == 'success' || $response['status'] == 'in progress')
 
{
 
$Udf1 = $response['udf1'];
$Udf2 = $response['udf2'];
$Udf3 = $response['udf3'];
$Udf4 = $response['udf4'];
$Udf5 = $response['udf5'];
$Udf6 = $response['udf6'];
$Udf7 = $response['udf7'];
$Udf8 = $response['udf8'];
$Udf9 = $response['udf9'];
$Udf10 = $response['udf10'];
   $txnid=$response['txnid'];
 
 $keyString =  $key.'|'.$txnid.'|'.$amount.'|'.$productinfo.'|'.$firstname.'|'.$email.'|'.$Udf1.'|'.$Udf2.'|'.$Udf3.'|'.$Udf4.'|'.$Udf5.'|'.$Udf6.'|'.$Udf7.'|'.$Udf8.'|'.$Udf9.'|'.$Udf10;
 
 $keyArray = explode("|",$keyString);
 $reverseKeyArray = array_reverse($keyArray);
 $reverseKeyString=implode("|",$reverseKeyArray);
 
 
if($log==1 )
{
  $responseValue= str_replace( "'"," ",implode(",",$response));
  $successQuery="update ps_payu_order set payment_response='$responseValue' where id_order= ".$order_id;;
  Db::getInstance()->Execute($successQuery);
}
 
 
$status=$response['status'];
$saltString     = $salt.'|'.$status.'|'.$reverseKeyString;
$sentHashString = strtolower(hash('sha512', $saltString));
 
              
$responseHashString=$_REQUEST['hash'];
 
 
if($sentHashString != $responseHashString)
 
{
 
$history = new OrderHistory();
$history->id_order = (int)($order_id);
$history->changeIdOrderState(Configuration::get('PS_OS_ERROR'), $history->id_order);
$history->add();
 
$smarty->display('failure.tpl');
 
             }
 
else
 
{
global $cart,$cookie;
$total = $amount;
$currency = new Currency(Tools::getValue('currency_payement', false) ? Tools::getValue('currency_payement') : $cookie->id_currency);
$customer = new Customer((int)$cart->id_customer);
if($response['status'] == 'success')
$payu->validateOrder((int)$cart->id, Configuration::get('PS_OS_PAYMENT'), $total, $payu->displayName, NULL, NULL, (int)$currency->id, false, $customer->secure_key);                
else
  $payu->validateOrder((int)$cart->id, Configuration::get('PS_OS_PREPARATION'), $total, $payu->displayName, NULL, NULL, (int)$currency->id, false, $customer->secure_key);
 
$smarty->display('success.tpl');
$result = Db::getInstance()->getRow('SELECT * FROM ' . _DB_PREFIX_ . 'orders WHERE id_cart = ' . (int)$cart->id);
 
 
                Tools::redirectLink(__PS_BASE_URI__ . 'order-detail.php?id_order=' . $result['id_order']);
 
}
 }
           include(dirname(__FILE__).'/../../footer.php');
 
?>
 
 
****************************************************************************
 
******************************* success.tpl *******************************
 
<br />
<strong>You have successfully paid your order.</strong>
<br />
<strong>Your order-id is {$orderId} </strong>
<br /> <br />
<p >
<a href="{$baseUrl}" title="Continue Shopping">
Continue Shopping
<link href="{$baseUrl}themes/default/css/product_list.css" rel="stylesheet" type="text/css" media="all" />
<link href="{$baseUrl}themes/default/css/grid_prestashop.css" rel="stylesheet" type="text/css" media="all" />
<link href="{$baseUrl}themes/default/css/global.css" rel="stylesheet" type="text/css" media="all" />
</a>
</p>
 
****************************************************************************
 
 
Guys! please can any solve this issue..that will really help.. I can't live the site regarding this issue.. please help me.. plese help somebody..
 
Thanks a lot..
Link to comment
Share on other sites

  • 6 months later...
×
×
  • Create New...