【问题标题】:New payment gateway addon incredible error新的支付网关插件令人难以置信的错误
【发布时间】:2013-12-03 15:31:43
【问题描述】:

我正在做一些测试以在 cscart 中开发自定义支付网关插件

开发一直非常简单直观,但是有件事我快疯了 1周。交易完成后,用户将被重定向到 index.php?dispatch=checkout.complete&order_id=20036 但绿色弹出通知不会出现在其他付款中......

代码看起来很正常。我查看了所有其他付款脚本,一切正常

/core/fn.cart.php fn_order_placement_routines 中的最后一个函数使用通知数据 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_routine 应该根据订单状态显示为绿色或红色弹出窗口......什么都没有......不会出现

提前致谢

【问题讨论】:

    标签: php cs-cart


    【解决方案1】:

    我可以看到您正在使用自定义订单状态来成功交易:

    $pp_response['order_status'] = "E";
    

    因此,要显示通知,此状态的 'inventory' 选项应设置为 'Decreased'。在这种情况下,E status 将包含在 fn_get_order_paid_statuses() 函数的结果中,并且 fn_order_placement_routines 函数中的以下代码将起作用:

    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'));
        }
    }
    

    最好的问候。

    【讨论】:

      猜你喜欢
      • 2013-10-09
      • 2021-11-15
      • 2013-10-10
      • 2016-02-25
      • 1970-01-01
      • 2019-06-05
      • 1970-01-01
      • 2014-12-23
      • 2015-03-20
      相关资源
      最近更新 更多