我正在进行一些测试,以便在cscart中开发自定义支付网关插件
开发非常简单直观,但我有点疯狂 为期一周。交易完成后,用户被重定向到index.php?dispatch = checkout.complete& order_id = 20036但绿色弹出通知不会出现在其他付款上....
代码看起来很正常..我查看所有其他付款脚本,所有都是常规的
/ core/fn.cart.php中的最后一个函数fn_order_placement_routines正确地使用通知数据fn_set_notification('N',.....
对$ _SESSION var进行正确定值这是代码
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;
}
}
fn_order_place_routine默认情况下应显示基于订单状态的绿色或红色弹出窗口....没有..不会出现
提前致谢
答案 0 :(得分:1)
我可以看到您正在使用自定义订单状态进行成功交易:
$pp_response['order_status'] = "E";
因此,要显示通知,此状态的'
if (in_array($status, fn_get_order_paid_statuses())) {
if ($action == 'repay') {
fn_set_notification('N', __('congratulations'), __('text_order_repayed_successfully'));
} else {
fn_set_notification('N', __('order_placed'), __('text_order_placed_successfully'));
}
}
最好的问候。