diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index c1d0de4d..e11cd9f4 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -119,6 +119,17 @@ class AlipayTradeService extends CI_Controller ,NULL ,$buyer ); + // 查询payer + $this->AlipayTradeQueryContentBuilder->setTradeNo($asyns_resp->data->trade_no); + if ($asyns_resp->data->out_trade_no) { + $this->AlipayTradeQueryContentBuilder->setOutTradeNo($asyns_resp->data->out_trade_no); + } + $response = $this->Query($this->AlipayTradeQueryContentBuilder); + $resp_arr = (Array) $response; + $query_resp = $this->check($resp_arr); + if (strcmp(strval($response->trade_status), "TRADE_SUCCESS") == 0) { + $this->Alipay_note_model->update_query($response->trade_no,$response->buyer_logon_id); + } } // 返回状态码200 echo "success"; diff --git a/webht/third_party/pay/models/Alipay_note_model.php b/webht/third_party/pay/models/Alipay_note_model.php index af2acc00..b9d8ea73 100644 --- a/webht/third_party/pay/models/Alipay_note_model.php +++ b/webht/third_party/pay/models/Alipay_note_model.php @@ -85,7 +85,7 @@ class Alipay_note_model extends CI_Model { } /*! - * 存储IPayLinks的实时通知 + * 存储实时通知 * @author LYT * @date 2017-08-29 */ @@ -180,15 +180,14 @@ class Alipay_note_model extends CI_Model { return $this->INFO->query($sql, array($pn_invoice, $pn_txn_id)); } - public function update_query($dealId,$stateCode,$payAmount) + public function update_query($dealId,$payer) { $sql = " UPDATE AlipayLog - SET ALI_stateCode = ?, - ALI_payAmount = ? + SET ALI_payerEmail = ? where ALI_dealId = ? "; - return $this->INFO->query($sql, array($stateCode,$payAmount,$dealId)); + return $this->INFO->query($sql, array($payer,$dealId)); } }