【问题标题】:Payment method not working properly in cs cart付款方式在 cs 购物车中无法正常工作
【发布时间】:2015-11-07 16:32:14
【问题描述】:

我在 cscart 中创建了一个新的支付网关。从支付网关获取成功结果后,cs购物车将其重定向到结帐页面并显示结帐不完整。请帮我解决这个问题。

【问题讨论】:

  • 请将您的问题缩小到您使用的支付网关。

标签: php e-commerce payment-gateway checkout cs-cart


【解决方案1】:

因为你没有提供任何代码,所以我做了一个处理响应的示例代码:

if ($mode == 'return') {
    // this means, that the payment processor returned from 3rd party checkout page

    $order_info = fn_get_order_info($_REQUEST['order_id'], true);

    // you should have a response code (this section depends on your payment gateway)
    if ($_REQUEST['response_code'] == "S") {
        // the transaction was successful!
        $pp_response['order_status'] = 'P';
        $pp_response['transaction_id'] = $_REQUEST['transaction_id'];
        $pp_response["reason_text"] = $_REQUEST['response_code'] . ": " . $_REQUEST['transaction_id']);


        fn_finish_payment($_REQUEST['order_id'], $pp_response, false);
        fn_order_placement_routines('route', $_REQUEST['order_id']);
    } else {
        // the transaction was NOT successful!
        $pp_response['order_status'] = 'N';
        $pp_response['transaction_id'] = $_REQUEST['transaction_id'];
        $pp_response["reason_text"] = $_REQUEST['response_code'] . ": " . $_REQUEST['transaction_id']);

        fn_order_placement_routines('route', $_REQUEST['order_id'], false);
    }
}

关键的“功能”是:fn_finish_payment()fn_order_placement_routines()。如果您没有完成付款,您将被重定向到结帐页面,因为这意味着出了点问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-25
    • 2013-05-22
    • 2015-04-19
    • 2011-10-10
    • 1970-01-01
    • 2021-09-02
    • 1970-01-01
    • 2018-01-11
    相关资源
    最近更新 更多