ajaykakde21 Posted June 28, 2017 Share Posted June 28, 2017 Hi Team, When customer makes payment after that no confirmation mail is sending to customer as well as admin. Payment is successfully credited on my Payu account. I really need your help. For reference Please see my success.php file. <?php include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/../../init.php'); include(dirname(__FILE__).'/payubiz.php'); include(dirname(__FILE__).'/../../header.php'); include(dirname(__FILE__).'/payubiz_common.inc'); // require_once dirname(__FILE__).'/../../classes/order/Order.php'; // require_once dirname(__FILE__).'/../../classes/order/OrderHistory.php'; $payu = new payubiz(); $response=$_REQUEST; $key=Configuration::get('PAYUBIZ_MERCHANT_ID'); $salt=Configuration::get('PAYUBIZ_MERCHANT_SALT'); $log=Configuration::get('PAYUBIZ_LOGS'); $baseUrl=Tools::getShopDomain(true, true).__PS_BASE_URI__; $order_id= $response['txnid']-40000; $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); $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); $result = Db::getInstance()->getRow('SELECT * FROM ' . _DB_PREFIX_ . 'orders WHERE id_cart = ' . (int)$cart->id); //$objOrder = new Order($result['id_order']); //order with id=1 // $history = new OrderHistory(); // $history->id_order = (int)$objOrder->id; // $objOrder->setCurrentState(Configuration::get('PS_OS_PAYMENT')); // $i = $history->changeIdOrderState(Configuration::get('PS_OS_PAYMENT'), (int)($objOrder->id)); //order status=3 } else { $payu->validateOrder((int)$cart->id, Configuration::get('PS_OS_PREPARATION'), $total, $payu->displayName, NULL, NULL, (int)$currency->id, false, $customer->secure_key); $result = Db::getInstance()->getRow('SELECT * FROM ' . _DB_PREFIX_ . 'orders WHERE id_cart = ' . (int)$cart->id); // $objOrder = new Order($result['id_order']); //order with id=1 // $history = new OrderHistory(); // $history->id_order = (int)$objOrder->id; // $objOrder->setCurrentState(Configuration::get('PS_OS_PREPARATION')); // $history->changeIdOrderState(Configuration::get('PS_OS_PREPARATION'), (int)($objOrder->id)); //order status=3 } $smarty->display('success.tpl'); $result = Db::getInstance()->getRow('SELECT * FROM ' . _DB_PREFIX_ . 'orders WHERE id_cart = ' . (int)$cart->id); if($log==1 ) { pblog( 'payubiz Data: '. print_r( $response, true ) ); $responseValue= str_replace( "'"," ",implode(",",$response)); $successQuery="update ps_payubiz_order set payment_response='$responseValue', payment_method= '".$response["payment_source"]."', payment_status= '".$response["status"]."', id_order='".$result["id_order"]."' where id_transaction= ".$response['txnid']; Db::getInstance()->Execute($successQuery); } Tools::redirectLink(__PS_BASE_URI__ . 'order-detail.php?id_order=' . $result['id_order']); } } include(dirname(__FILE__).'/../../footer.php'); ?> Link to comment Share on other sites More sharing options...
bellini13 Posted June 28, 2017 Share Posted June 28, 2017 nothing in that file sends an email. If you are referring to the order confirmation email that the customer receives, that is Prestashop core sending the email, not your payu payment module. Link to comment Share on other sites More sharing options...
ajaykakde21 Posted June 28, 2017 Author Share Posted June 28, 2017 Thanks for reply... Ok got it. For that what i need to do. PFA is the screenshot for the page which i see after payment. Link to comment Share on other sites More sharing options...
ajaykakde21 Posted June 28, 2017 Author Share Posted June 28, 2017 Sorry, Please see screenshot Link to comment Share on other sites More sharing options...
bellini13 Posted June 28, 2017 Share Posted June 28, 2017 seems to me you should contact the author of this module for support Link to comment Share on other sites More sharing options...
ajaykakde21 Posted June 29, 2017 Author Share Posted June 29, 2017 (edited) I have been contacted to Payu.... Waiting for there response. Apart from there support can you please help me. Its really urgent for me. Right now I have Set " Enable SSL For All Pages " -> yes. No order is created neither mail confirmation. But When I Set "Enable SSL For All Pages " -> No. then Order is created at backoffice but no mail confirmation. PFA screenshot after setting "Enable SSL For All Pages " -> No Please help me. Edited June 29, 2017 by ajaykakde21 (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted June 29, 2017 Share Posted June 29, 2017 sounds like their module needs to be fixed. I don't use their module or their services, so I can't be of much help here. Link to comment Share on other sites More sharing options...
ajaykakde21 Posted July 10, 2017 Author Share Posted July 10, 2017 Hi, But the thing is when i add product to cart and procced for payment and then if i am not doing payment and can cle the order then i got mail from prestashop that your order has been canceled. Then why not customer receive mail after making payment. I had call with Payu the said there is no problem with PayU module. Please suggest me its really urgent for me. PFA Link to comment Share on other sites More sharing options...
ajaykakde21 Posted July 10, 2017 Author Share Posted July 10, 2017 Hi, Please help me to sort this out. Its really urgent for me. Currently i am not able to live my portal because of no confirmation mail to customer & admin. Link to comment Share on other sites More sharing options...
ajaykakde21 Posted July 10, 2017 Author Share Posted July 10, 2017 Anyone??? Please help me with solution... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now