Skip to content

Commit

Permalink
添加响应后台通知接口
Browse files Browse the repository at this point in the history
  • Loading branch information
pysnow530 committed Dec 25, 2014
1 parent 86c6009 commit 491b367
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions WechatPayment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,27 @@ public function get_back_data() {
if ($this->validate($data)) {
return $data;
} else {
$this->response_back("FAIL", "签名失败");
return null;
}
}

/**
* 响应微信支付后台通知
* @param $return_code 返回状态码 SUCCESS/FAIL
* @param $return_msg 返回信息
*/
public function response_back($return_code="SUCCESS", $return_msg=null) {
$data = array();
$data["return_code"] = $return_code;
if ($return_msg) {
$data["return_msg"] = $return_msg;
}
$xml = $this->array2xml($data);

print $xml;
}

/**
* 订单查询接口
* $param out_trade_no 商户订单号
Expand Down

0 comments on commit 491b367

Please sign in to comment.