Probme In Integrate With A Payment Gateway

After payment in payment gateway, it returns back to my website through payment_return.php



Some codes is as below:

if($verify_result) {

$order_info = fn_get_order_info($order_id);

if ($order_info['status'] == 'N' || $order_info['status'] == 'I') {

if ($order_status == 'WAIT_SELLER_SEND_GOODS') {

fn_change_order_status($order_id, 'P', '', true);



}

else {

fn_change_order_status($order_id, 'F', '', true);

}

}



fn_order_placement_routines($order_id);

}



When doing the test, payment is successful and order status is already 'P'.So not call the fn_change_order_status($order_id, 'P', '', true);. here.

And $order_status == 'WAIT_SELLER_SEND_GOODS' returned from payment gateway.



But find in method fn_order_placement_routines($order_id);, the status for this order is still 'N'.

The code is

$order_info = fn_get_order_info($order_id, true);

$order_info['status'] equals to N, but should be P already before fn_order_placement_routines($order_id) is called.



Where is it changed to N?

Look closely at fn_finish_payment() for the proper return URL too use and how to verify the payment info is valid.

Did some debug. Updated my question. Thank you.



The original system is not done by me. Just new to cs-cart, don't understand how it works.



In method fn_order_placement_routines($order_id);

this method fn_set_notification is called, how come it is N?

if ($order_info['status'] == 'N') {

fn_set_notification('W', fn_get_lang_var('important'), fn_get_lang_var('this_my_test'));

}





at the end of this method fn_order_placement_routines($order_id);, it calls fn_redirect to redirect to another page.

Then how come the notificaiton message set previously displayed in the redirected page?

Appreciate any help. I can provide any information if necessary.

Notifications are queued until displayed. N is notify, W is warn. You are confusing status and other flags. Cs-cart doesn't use defines so the character usage is extremely overloaded and confusing.