diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php
index e11cd9f4..0d4a916f 100644
--- a/webht/third_party/pay/controllers/AlipayTradeService.php
+++ b/webht/third_party/pay/controllers/AlipayTradeService.php
@@ -79,7 +79,10 @@ class AlipayTradeService extends CI_Controller
log_message('error','Alipay ERROR gateway_url should not be NULL!');
}
}
-
+ public function index()
+ {
+ $this->note_list();
+ }
/*!
* 异步通知
* 必须返回"success"给支付系统
@@ -562,4 +565,134 @@ class AlipayTradeService extends CI_Controller
return $image;
}
+ public function note_list()
+ {
+ $data = array();
+ $data["paytext"] = $this->payment_status();
+ $data["keywords"] = $this->input->get_post("keywords");
+ $data["date"] = $this->input->get_post("date");
+ empty($data['date']) ? $data['date'] = date('Y-m-d') : false;
+ if (!empty($data['keywords'])) {
+ $data['notelist'] = $this->Alipay_note_model->search_key($data['keywords']);
+ } else {
+ $data['notelist'] = $this->Alipay_note_model->search_date($data['date']);
+ }
+ $this->load->view("alipay_list",$data);
+ return;
+ }
+ //失败记录列表
+ public function note_faillist() {
+ $data = array();
+ $data["paytext"] = $this->payment_status();
+ //有关键词则不限制日期
+ $data['search_key'] = $this->input->post('keywords');
+ $data['date'] = $this->input->get_post('date');
+ empty($data['date']) ? $data['date'] = date('Y-m-d') : false;
+ $data['notelist'] = $this->Alipay_note_model->failnote(100);
+ $this->load->view("alipay_list",$data);
+ }
+ //用于HT--交易详情
+ public function receipt($pm_transaction_id) {
+ if ( ! $pm_transaction_id) {
+ return false;
+ }
+ $data = array();
+ $data = $this->Alipay_note_model->note($pm_transaction_id);
+ $this->load->view('alipay_receipt_mail', $data);
+ }
+
+ //获取note详情,以便后续修改各项数据
+ public function note_modal($pn_txn_id = false, $pn_invoice = false ,$notice_time = false) {
+ $data = array();
+ $data['IPL_orderId'] = $pn_invoice;
+ if (!empty($pn_txn_id)) {
+ $data['note'] = $this->Alipay_note_model->note($pn_txn_id);
+ if (!empty($data['note'])) {
+ if (!empty($pn_invoice)) {
+ $orderid_info = analysis_orderid($pn_invoice);
+ } else {
+ $orderid_info = analysis_orderid($data['note']->IPL_orderId);
+ }
+ if (!empty($orderid_info)) {
+ $orderid_info = json_decode($orderid_info);
+ $data['order_info'] = $this->Alipay_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype);
+ }
+ $data["paytext"] = $this->payment_status();
+ echo json_encode($this->load->view('alipay_note_setting', $data, true));
+ return true;
+ }
+ }
+ echo json_encode('没找到数据!');
+ return;
+ }
+ public function note_order_modal($old_order,$pn_invoice = false ,$notice_time = false) {
+ $data = array();
+ $data['IPL_orderId'] = $pn_invoice;
+ if (!empty($pn_invoice)) {
+ $data['note'] = $this->Alipay_note_model->note_order($old_order,$notice_time);
+ if (!empty($data['note'])) {
+ if (!empty($pn_invoice)) {
+ $orderid_info = analysis_orderid($pn_invoice);
+ } else {
+ $orderid_info = analysis_orderid($data['note']->IPL_orderId);
+ }
+ if (!empty($orderid_info)) {
+ $orderid_info = json_decode($orderid_info);
+ $data['order_info'] = $this->Alipay_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype);
+ }
+ $data["paytext"] = $this->payment_status();
+ echo json_encode($this->load->view('alipay_note_setting', $data, true));
+ return true;
+ }
+ }
+ echo json_encode('没找到数据!');
+ return;
+ }
+
+ //关闭note通知,用于手动处理通知后
+ public function close_note($pn_txn_id) {
+ $data = array();
+ $data['note'] = $this->Alipay_note_model->note($pn_txn_id);
+ if (!empty($data['note'])) {
+ $this->Alipay_note_model->update_send($pn_txn_id, 'send');
+ echo json_encode('通知已经关闭!');
+ return true;
+ }
+ echo json_encode('没找到数据!');
+ return;
+ }
+
+ //修改订单名
+ public function note_modal_save() {
+ $data = array();
+
+ $pn_txn_id = $this->input->post('pn_txn_id');
+ $pn_invoice = $this->input->post('pn_invoice');
+
+ if (!empty($pn_txn_id) && !empty($pn_invoice)) {
+ $orderid_info = analysis_orderid($pn_invoice);
+ if (!empty($orderid_info)) {
+ $orderid_info = json_decode($orderid_info);
+ $advisor_info = $this->Alipay_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
+ if (!empty($advisor_info)) {
+ $this->Alipay_note_model->set_invoice($pn_txn_id, $pn_invoice);
+ $this->send_alipay($pn_txn_id);
+ echo json_encode('修改成功!');
+ return true;
+ }
+ }
+ }
+ echo json_encode('没找到数据!');
+ return;
+ }
+
+ public function payment_status()
+ {
+ return array(
+ "WAIT_BUYER_PAY" => "Pending",
+ "TRADE_SUCCESS" => "Payment success",
+ "TRADE_FINISHED" => "Payment success"
+ );
+ }
+
}
diff --git a/webht/third_party/pay/views/alipay_list.php b/webht/third_party/pay/views/alipay_list.php
new file mode 100644
index 00000000..7bb47876
--- /dev/null
+++ b/webht/third_party/pay/views/alipay_list.php
@@ -0,0 +1,256 @@
+
+* @date 2017-09-06
+*/
+?>
+
+
+
+
+
+ Alipay Notes - China Highlights
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
通知状态:
+
1.send 表示通知正确发送给外联
+
2.unsend 表示通知在等待处理,5~10分钟系统处理一遍
+
3.sendfail 状态的需要手工设置正确的订单号
+
4.Pending 还未到账,需要人工检查,确认支付或者取消,需要手工关闭此通知
+
5.Denied 银行拒付,需要手工关闭此通知
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/webht/third_party/pay/views/alipay_note_setting.php b/webht/third_party/pay/views/alipay_note_setting.php
new file mode 100644
index 00000000..90332bba
--- /dev/null
+++ b/webht/third_party/pay/views/alipay_note_setting.php
@@ -0,0 +1,53 @@
+
diff --git a/webht/third_party/pay/views/alipay_receipt_mail.php b/webht/third_party/pay/views/alipay_receipt_mail.php
new file mode 100644
index 00000000..3233bb72
--- /dev/null
+++ b/webht/third_party/pay/views/alipay_receipt_mail.php
@@ -0,0 +1 @@
+ Transaction ID:
Hello Guilin China International Travel Service Co.,Ltd, You received a payment of Thanks for using iPayLinks.You can now ship any items.To see all the transaction details,log in to your iPayLinks account. It may take a few moments for this transaction to appear in your account. Seller Protection-