vendor/codeages/omnipay-alipay/src/Requests/LegacyCloseRequest.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace Omnipay\Alipay\Requests;
class LegacyCloseRequest
{
protected $url = 'https://mapi.alipay.com/gateway.do';
public function __construct(array $options = null)
{
$this->options = $options;
}
public function setParams(array $params)
{
$this->params = $params;
return $this;
}
public function send()
{
$result = $this->postRequest($this->url, $this->convertParams($this->params));
return $this->parseResponse($result);
}
private function parseResponse($result)
{
$doc = new \DOMDocument('1.0', 'UTF-8');
$doc->loadXML($result);
if (!empty($doc->getElementsByTagName('alipay')->item(0)->nodeValue)) {
$success = $doc->getElementsByTagName('is_success')->item(0)->nodeValue;
if ('F' == $success) {
return new AlipayResponse(false, $doc->getElementsByTagName('error')->item(0)->nodeValue);
}
}
return new AlipayResponse(true);
}
private function postRequest($url, $params)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_USERAGENT, 'Topxia Payment Client 1.0');
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 0);
if (!empty($params)) {
$url = $url.(strpos($url, '?') ? '&' : '?').http_build_query($params);
}
curl_setopt($curl, CURLOPT_URL, $url);
$response = curl_exec($curl);
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。