JoelWebsites Posted November 28, 2014 Share Posted November 28, 2014 (edited) Hi, I need to know what is the prestashop code or function used to update the cart to the orders at the end of the checkout process ..thanks Edited November 28, 2014 by joeljfernandes (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted November 28, 2014 Share Posted November 28, 2014 PaymentModule class, validateOrder method Link to comment Share on other sites More sharing options...
JoelWebsites Posted November 28, 2014 Author Share Posted November 28, 2014 So payment gateway response code should look like If(sucessful transaction= true) { validateOrder(); sucessful message }else{ show failure template }; Please let me know if the above is the correct way to call this method? because i am not sure ..thanks Link to comment Share on other sites More sharing options...
JoelWebsites Posted November 28, 2014 Author Share Posted November 28, 2014 I have a ebs payment module it has this code it seems that there must be some input parameters if($response['ResponseCode'] == 0){ $status_code = "Ok"; if($response['IsFlagged'] == "NO" && $response['Amount'] == $amount){ $status = Configuration::get('EBS_ID_ORDER_SUCCESS'); $message= "Transaction Successful"; } else{ $status = Configuration::get('EBS_ID_ORDER_PENDING'); $responseMsg .= ". The payment has been kept on hold until the manual verification is completed and authorized by EBS"; $message = "Transaction Successful"; } } else{ $status_code = "Failed"; $status = Configuration::get('EBS_ID_ORDER_FAILED'); $message = "Transaction Failed, Retry!!"; } $history_message = $responseMsg.'. EBS Payment ID: '.$response['PaymentID']; $ebs = new EBS(); $ebs->validateOrder(intval($cart->id), $status, $response['Amount'], $ebs->displayName, $history_message, $extras, '', false, $cart->secure_key); $this->context->smarty->assign(array( 'status' => $status_code, 'responseMsg' => $message, 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/' )); $this->setTemplate('payment_response.tpl'); } } 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