Skip to content

Commit 77f5b41

Browse files
committed
添加支付类Xml输出函数
1 parent 9039358 commit 77f5b41

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Wechat/WechatPay.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,22 @@ public function getNotify() {
148148
return $notifyInfo;
149149
}
150150

151+
152+
/**
153+
* 支付XML统一回复
154+
* @param array $data 需要回复的XML内容数组
155+
* @param bool $isReturn 是否返回XML内容,默认不返回
156+
* @return string
157+
*/
158+
public function replyXml(array $data, $isReturn = false) {
159+
$xml = Tools::arr2xml($data);
160+
if ($isReturn) {
161+
return $xml;
162+
}
163+
ob_clean();
164+
exit($xml);
165+
}
166+
151167
/**
152168
* 获取预支付ID
153169
* @param string $openid 用户openid,JSAPI必填

0 commit comments

Comments
 (0)