|
|
|
@ -509,29 +509,24 @@ class AlipayTradeService extends CI_Controller
|
|
|
|
|
$request = new AlipayTradeQueryRequest();
|
|
|
|
|
$request->setBizContent ( $biz_content );
|
|
|
|
|
|
|
|
|
|
$response = $this->aopclientRequestExecute ($request,true);
|
|
|
|
|
$response = $this->aopclientRequestExecute ($request);
|
|
|
|
|
$response = $response->alipay_trade_query_response;
|
|
|
|
|
|
|
|
|
|
return $response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function query_pay($dealId,$orderId=NULL)
|
|
|
|
|
public function query_pay($dealId=NULL,$orderId=NULL)
|
|
|
|
|
{
|
|
|
|
|
if ($dealId === NULL) {
|
|
|
|
|
$dealId = $this->input->get_post('dealid');
|
|
|
|
|
$dealId = trim($dealId);
|
|
|
|
|
}
|
|
|
|
|
$this->AlipayTradeQueryContentBuilder->setTradeNo($dealId);
|
|
|
|
|
if ($orderId) {
|
|
|
|
|
$this->AlipayTradeQueryContentBuilder->setOutTradeNo($orderId);
|
|
|
|
|
}
|
|
|
|
|
$response = $this->Query($this->AlipayTradeQueryContentBuilder);
|
|
|
|
|
if ( strcmp(trim($response->code), "10000")) {
|
|
|
|
|
log_message('error',"Alipay query failed! error code:".$response->code."; result Msg: ".$response->msg.'; orderId:'.$response->out_trade_no.'; dealId:'.$response->trade_no."; ");
|
|
|
|
|
}
|
|
|
|
|
$html = '<table>';
|
|
|
|
|
foreach ($response as $key => $value) {
|
|
|
|
|
$html .= "<tr><td>$key</td><td>$value</td>";
|
|
|
|
|
}
|
|
|
|
|
$html .= '</table>';
|
|
|
|
|
echo $html;
|
|
|
|
|
return;
|
|
|
|
|
return $response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
@ -624,6 +619,30 @@ var_dump($response->$responseNode);
|
|
|
|
|
empty($data['date']) ? $data['date'] = date('Y-m-d') : false;
|
|
|
|
|
if (!empty($data['keywords'])) {
|
|
|
|
|
$data['notelist'] = $this->Alipay_note_model->search_key($data['keywords']);
|
|
|
|
|
/** 手动查询通过收钱码的收款, 必须输入交易号 */
|
|
|
|
|
if (empty($data['notelist'])) {
|
|
|
|
|
$query_pay = $this->query_pay($data["keywords"]);
|
|
|
|
|
if ( ! empty($query_pay) && strval($query_pay->code)==="10000" && strval($query_pay->trade_status)==="TRADE_SUCCESS") {
|
|
|
|
|
$pay_type = $query_pay->total_amount>0 ? "pay" : "refund";
|
|
|
|
|
$new_record = $this->Alipay_note_model->save_alipay(
|
|
|
|
|
strval($query_pay->trade_no)
|
|
|
|
|
,strval($query_pay->out_trade_no)
|
|
|
|
|
,"CNY"
|
|
|
|
|
,strval($query_pay->total_amount)
|
|
|
|
|
,NULL
|
|
|
|
|
,NULL
|
|
|
|
|
,strval($query_pay->send_pay_date)
|
|
|
|
|
,strval($query_pay->send_pay_date)
|
|
|
|
|
,json_encode($query_pay)
|
|
|
|
|
,$pay_type
|
|
|
|
|
,NULL
|
|
|
|
|
,strval($query_pay->trade_status)
|
|
|
|
|
,NULL
|
|
|
|
|
,strval($query_pay->buyer_logon_id)
|
|
|
|
|
);
|
|
|
|
|
$data['notelist'][] = $new_record;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$data['notelist'] = $this->Alipay_note_model->search_date($data['date']);
|
|
|
|
|
}
|
|
|
|
@ -743,6 +762,7 @@ var_dump($response->$responseNode);
|
|
|
|
|
return array(
|
|
|
|
|
"WAIT_BUYER_PAY" => "Pending",
|
|
|
|
|
"TRADE_SUCCESS" => "Payment success",
|
|
|
|
|
"TRADE_CLOSED" => "Payment closed",
|
|
|
|
|
"TRADE_FINISHED" => "Payment success"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|