diff --git a/webht/third_party/pay/controllers/PaymentService.php b/webht/third_party/pay/controllers/PaymentService.php
index c01d4a43..0e39d8da 100644
--- a/webht/third_party/pay/controllers/PaymentService.php
+++ b/webht/third_party/pay/controllers/PaymentService.php
@@ -40,10 +40,6 @@ log_message('error','send_notify begin ----');
}
// 开始处理
foreach ($data['unsend_list'] as $key => $item) {
- //显示处理记录
- if (empty($transaction_id)) {
- echo ++$show_index . ' ' . $item->OPN_transactionId . '
';
- }
// 只处理完成状态
if ($item->OPN_transactionResult != 'completed') {
continue;
@@ -76,17 +72,17 @@ log_message('error','send_notify begin ----');
// 开始查找订单和录入
$handpick = empty($transaction_id) ? false : true;
$advisor_info = $this->account_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, $handpick);
- $ssje = $this->account_model->get_ssje($item->OPN_orderAmount, $item->OPN_accountMethod, mb_strtoupper($item->OPN_currency));
+ $ssje = $this->account_model->get_ssje($item->OPN_orderAmount, mb_strtoupper($item->OPN_currency), $item->OPN_accountMethod);
$ssje = $old_ssje===NULL ? $ssje : $old_ssje;
$ht_memo = '交易号(自动录入):' . $item->OPN_transactionId;
- if ( ! isset($advisor_info->ordertype)) {
+ if ( empty($advisor_info)) {
// record fail
$this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'sendfail');
continue;
}
$COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0;
$update_note_column = array();
- if ($advisor_info->ordertype == 0) {
+ if ($advisor_info->order_type == 0) {
/* 商务订单 */
if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP') {
/* APP */
@@ -141,7 +137,7 @@ log_message('error','send_notify begin ----');
$update_note_column['OPN_accountType'] = 'B';
$update_note_column['OPN_accountStatus'] = 'recorded';
$update_note_column['OPN_accountTime'] = date('Y-m-d H:i:s');
- } elseif ($advisor_info->ordertype == 1) {
+ } elseif ($advisor_info->order_type == 1) {
/* 传统 */
$gai_sn = $this->account_model->add_tour_account_info(
$COLI_SN,
@@ -194,8 +190,12 @@ log_message('error','send_notify begin ----');
$this->account_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'payment note', 'payment note');
//添加邮件发送记录 end
- $this->note_model->update_send($item->OPN_SN, $item->pn_txn_id, 'send');
+ $this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'send');
+ //显示处理记录
+ if (empty($transaction_id)) {
+ echo ++$show_index . ' ' . $item->OPN_transactionId . '
';
+ }
}
return;
diff --git a/webht/third_party/pay/controllers/WxpayService.php b/webht/third_party/pay/controllers/WxpayService.php
index 5f7f8e74..1f39a0ed 100644
--- a/webht/third_party/pay/controllers/WxpayService.php
+++ b/webht/third_party/pay/controllers/WxpayService.php
@@ -100,7 +100,7 @@ log_message('error','notify begin ----');
return false;
}
if ($this->make_sign($xml_arr) !== $xml_arr['sign']) {
- log_message('error','Wxpay notify error: sign.');
+ log_message('error','Wxpay notify error: sign.' . $this->make_sign($xml_arr));
return false;
}
if ($this->wx_site_config['app_id'] !== $xml_arr['appid']) {
diff --git a/webht/third_party/pay/models/Online_payment_note_model.php b/webht/third_party/pay/models/Online_payment_note_model.php
index 5d0205e3..e4eefeea 100644
--- a/webht/third_party/pay/models/Online_payment_note_model.php
+++ b/webht/third_party/pay/models/Online_payment_note_model.php
@@ -35,7 +35,7 @@ class Online_payment_note_model extends CI_Model {
//设置订单号
public function set_invoice($id, $pn_invoice)
{
- $column = array("OPN_orderId" => $send);
+ $column = array("OPN_orderId" => $pn_invoice);
$where = " OPN_SN=" . $id;
return $this->update_note($where, $column);
}