Search code examples
cs-cart

I am trying to add a new gateway to CS-cart and it seems having troubles when i am sent back from the gateway


basically my script so far send values to the gateway then get redirected to CS cart .. in that page i grab the values returned and manipulate them.

i use fn finish and fn change order status to finish the order but no matter what i do i get a 404 page not found . i've tried redirecting to the order page but its creates a problem.

Here is the code i use when returning from gateway.

$StaTus_message = "<br>Thank you for shopping with us. Your credit card has been charged and your transaction is successful. We will be shipping your order to you soon.";
$pp_response['customer_email'] = $_REQUEST['billing_cust_email'];   
$pp_response['client_id'] = $_REQUEST['billing_cust_name'];
$pp_response['order_status'] = 'C';
$pp_response['reason_text'] = $StaTus_message;
fn_finish_payment($_REQUEST['Order_Id'], $pp_response);
fn_change_order_status($_REQUEST['Order_Id'], $pp_response['order_status']);

I know this is not a popular subject but i thought I'll give it a go.

Also I've being searching everywhere for documentation both at CS-cart's forum and the internet and couldn't find much.

Thanks in advanced.


Solution

  • Okay. So, the solution to that was exiting the script after the script sent the client to the gate way, and then upon re-enter using fn_change_order_status - to whatever you need, and then using fn_order_placement_routines to actually finalize the order and send email to client/merchant.

    Hope that help people out there as I spent nearly 4 days to try and understand that.