mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2025-04-06 03:58:03 +08:00
[更新] 微信支付增加toXml方法,可用于回复通知处理
This commit is contained in:
parent
a9b26e3897
commit
8a38e24160
@ -120,6 +120,22 @@ class BasicPay
|
||||
return $this->callPostApi($url, ['long_url' => $longUrl]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数组直接转xml数据输出
|
||||
* @param array $data
|
||||
* @param bool $isReturn
|
||||
* @return string
|
||||
*/
|
||||
public function toXml(array $data, $isReturn = false)
|
||||
{
|
||||
$xml = Tools::arr2xml($data);
|
||||
if ($isReturn) {
|
||||
return $xml;
|
||||
}
|
||||
echo $xml;
|
||||
}
|
||||
|
||||
/**
|
||||
* 以Post请求接口
|
||||
* @param string $url 请求
|
||||
|
Loading…
x
Reference in New Issue
Block a user