Php 新的支付网关插件错误
我正在做一些测试来开发cscart中的定制支付网关插件 开发过程非常简单直观,但有一件事我快疯了 一周。交易完成后,用户将被重定向到index.php?dispatch=checkout.complete&order\u id=20036,但绿色弹出通知不会像其他付款一样出现 代码看起来很正常。。我看了所有其他付款脚本,所有都是正常的 /core/fn.cart.php fn_order_placement_例程中的最后一个函数使用通知数据fn_set_notification('N',..)正确地对$会话变量进行赋值 这是密码Php 新的支付网关插件错误,php,cs-cart,Php,Cs Cart,我正在做一些测试来开发cscart中的定制支付网关插件 开发过程非常简单直观,但有一件事我快疯了 一周。交易完成后,用户将被重定向到index.php?dispatch=checkout.complete&order\u id=20036,但绿色弹出通知不会像其他付款一样出现 代码看起来很正常。。我看了所有其他付款脚本,所有都是正常的 /core/fn.cart.php fn_order_placement_例程中的最后一个函数使用通知数据fn_set_notification('N',..)正
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_例程应根据订单状态显示绿色或红色弹出窗口…无..不显示
提前感谢您,因为我可以看到您正在使用自定义订单状态成功完成交易:
$pp_response['order_status'] = "E";
因此,要显示通知,此状态的'inventory'选项应设置为'reduced'。在这种情况下,E状态将包含在fn\u get\u order\u paid\u status()的结果中函数和fn\u顺序\u放置\u例程中的以下代码将起作用:
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'));
}
}
致以最良好的祝愿