This commit is contained in:
aozhiwei 2020-10-20 12:30:43 +08:00
parent b5c0c9dd6b
commit 0b3f582982

View File

@ -102,7 +102,26 @@ class UnifiedWeiXin extends BaseSdk {
public function payNotify()
{
$raw_data = file_get_contents('php://input');
$xml = new \SimpleXMLElement($raw_data);
if ($xml->return_code == 'SUCCESS') {
$this->spPayConfirm(
$xml->out_trade_no,
$xml->transaction_id,
$xml->total_fee
);
$data = array(
'return_code' => 'SUCCESS',
'return_msg' => 'OK'
);
echo phpcommon\objectToXml($params);
} else {
$data = array(
'return_code' => 'FAIL',
'return_msg' => '交易失败'
);
echo phpcommon\objectToXml($params);
}
}
}