New payment gateway addon incredible error

Hello, i'm making some tests to develop a custom payment gateway addon



The development has been very simple and intuitive, but there is a thing i am going crazy

for 1 week. After the transaction as been completed the user is redirected to index.php?dispatch=checkout.complete&order_id=20036 but the green popup notification dosn't appear as on the other payments…



The code looks like normal… i look on all other payments script and all is regular



the final function in /core/fn.cart.php fn_order_placement_routines valorize correctly the $_SESSION var with the notification data fn_set_notification('N',…



this is the code



if (!defined('AREA') ) { die('Access denied'); }
if (defined('PAYMENT_NOTIFICATION')) {
if ($mode == 'notify' && !empty($_REQUEST['order_id'])) {
if (fn_check_payment_script('gateway.php', $_REQUEST['order_id'], $processor_data)) {
$order_id = $_REQUEST['order_id'];
$order_info = fn_get_order_info($order_id);
$pp_response = array(
'reason_text' => '',
'order_status' => 'F'
);
if (empty($processor_data)) {
$processor_data = fn_get_processor_data($order_info['payment_id']);
}
$returnvalue = $_POST['PROCESSING_RESULT'];
if ($returnvalue && strstr($returnvalue,"ACK")) {
$pp_response['order_status'] = "E";
$pp_response['reason_text'] .= "Status: OK";
}else {
$pp_response['order_status'] = "N";
$pp_response["reason_text"] = fn_get_lang_var('text_transaction_cancelled');
}
if (isSet($_REQUEST['IDENTIFICATION_UNIQUEID'])) {
$pp_response['transaction_id'] = $_REQUEST['IDENTIFICATION_UNIQUEID'];
}
[b] fn_finish_payment($_REQUEST['order_id'], $pp_response, false);
fn_order_placement_routines($_REQUEST['order_id'], true);[/b]
}
}
} else {
if ($mode == 'place_order') {
//call the gateway, assign response url etc
// $current_location."/".$index_script."?dispatch=payment_notification.notify&payment=gateway.php&order_id=".$order_id;
}
}




the fn_order_place_routine should be show by default the green or red popup based on the status of the order… nothing… dosn't appear





thanks in advance

when you say “the user is redirected”, but the question is where is the payment processor doing the callback to? Should be to payment_notification (see controllers/common/payment_notification.php) with the appropriate arguments for that payment provider. That in turn will include the payment processing script which should (at the end) call fn_order_proessing_routines()…

[quote name='tbirnseth' timestamp='1386140398' post='172867']

when you say “the user is redirected”, but the question is where is the payment processor doing the callback to? Should be to payment_notification (see controllers/common/payment_notification.php) with the appropriate arguments for that payment provider. That in turn will include the payment processing script which should (at the end) call fn_order_proessing_routines()…

[/quote]



Hi tbirnseth,



the callback notification happen here ?dispatch=payment_notification.notify&payment=gateway.php&order_id=".$order_id;

and is correctly handled in:



controllers/common/payment_notification.php print_r(_REQUEST)





[TRANSACTION_RESPONSE] => ASYNC

[dispatch] => payment_notification.notify

[payment] => heidelpay

[order_id] => 20063



/payments/heidelpay.php



if ($mode == 'notify' && !empty($_REQUEST['order_id'])) {
if (fn_check_payment_script('heidelpay.php', $_REQUEST['order_id'], $processor_data)) {
$order_id = $_REQUEST['order_id'];
$order_info = fn_get_order_info($order_id);
if (empty($processor_data)) {
$processor_data = fn_get_processor_data($order_info['payment_id']);
}
$returnvalue = $_POST['PROCESSING_RESULT'];
if ($returnvalue && strstr($returnvalue,"ACK")) {
$pp_response['order_status'] = "E";
$pp_response['reason_text'] .= "Status: OK";
}else {
$pp_response['order_status'] = "N";
$pp_response["reason_text"] = fn_get_lang_var('text_transaction_cancelled');
}
if (isSet($_REQUEST['IDENTIFICATION_UNIQUEID'])) {
$pp_response['transaction_id'] = $_REQUEST['IDENTIFICATION_UNIQUEID'];
}
fn_finish_payment($_REQUEST['order_id'], $pp_response, false);
fn_order_placement_routines($_REQUEST['order_id'], true);
}
}
}




i have also check in /core/fn.cart.php on the function fn_order_placement_routines



the function valorize correctly the $_SESSION['notificaitons']… and then redirect the ?checkout.complete&orderid=…

The fn_set_notification() should be done for you in the fn_finish_payment() area (or possibly the fn_order_placement_routines()). Suggest you walk through that code to determine where/why things might be bailing out on you.



Are you getting the proper pp_response stored with the order?