支付分紅兩部分php
1.訂單信息spa
2.支付日誌ID日誌
3.生成支付代碼code
一次性支付完成blog
// 支付信息 include_once('includes/lib_payment.php'); $order['log_id'] = insert_pay_log($order['order_id'], $order['order_amount'], PAY_ORDER); /* 取得支付信息,生成支付代碼 */ if ($order['order_amount'] > 0) { $payment = payment_info($order['pay_id']); include_once('includes/modules/payment/' . $payment['pay_code'] . '.php'); $pay_obj = new $payment['pay_code']; $pay_online = $pay_obj->get_code($order, unserialize_config($payment['pay_config'])); $order['pay_desc'] = $payment['pay_desc']; $smarty->assign('pay_online', $pay_online); }
隔斷時間支付ip
// 支付信息 include_once('includes/lib_payment.php'); //print_r($order['order_sn']); $log = $db->getRow("select p.log_id from ".$ecs->table('depot_order')." AS o,".$ecs->table('pay_log')." AS p where o.order_id = p.order_id and o.order_sn = ".$order['order_sn']); $order['log_id'] = $log['log_id']; /* 取得支付信息,生成支付代碼 */ if ($order['pay_status'] == 0) { $payment = payment_info($order['pay_id']); //print_r($payment); include_once('includes/modules/payment/' . $payment['pay_code'] . '.php'); $pay_obj = new $payment['pay_code']; $pay_online = $pay_obj->get_code($order, unserialize_config($payment['pay_config'])); // print_r($order); $smarty->assign('pay_online', $pay_online); } // 支付信息 End
兩種支付的區別在$order['log_id'] 的生成方式,第一種是生成支付日誌,而後返回生成的ID;第二種是根據訂單order_sn讀出order_id,關聯log_id,get
關鍵位置io
1.生成支付代碼function get_code (alipay.php第132行)table
'out_trade_no' => $order['order_sn'] . $order['log_id'], 訂單ID+支付日誌IDfunction
$button ,生成的支付按鈕信息
2.響應操做function respond( alipay.php第168行)
$order_sn = str_replace($_GET['subject'], '', $_GET['out_trade_no']); // 根據兩條件獲取,獲取支付日誌ID