qq支付退款
parent
b13df2344e
commit
fc0689a7f6
|
|
@ -403,7 +403,7 @@ class QQ
|
||||||
$data['sign'] = $this->GetSign($data);
|
$data['sign'] = $this->GetSign($data);
|
||||||
|
|
||||||
// 请求接口处理
|
// 请求接口处理
|
||||||
$result = $this->XmlToArray($this->HttpRequest('https://api.mch.weixin.qq.com/secapi/pay/refund', $this->ArrayToXml($data), true));
|
$result = $this->XmlToArray($this->HttpRequest('https://api.qpay.qq.com/cgi-bin/pay/qpay_refund.cgi', $this->ArrayToXml($data), true));
|
||||||
print_r($result);die;
|
print_r($result);die;
|
||||||
if(!empty($result['return_code']) && $result['return_code'] == 'SUCCESS' && !empty($result['return_msg']) && $result['return_msg'] == 'OK')
|
if(!empty($result['return_code']) && $result['return_code'] == 'SUCCESS' && !empty($result['return_msg']) && $result['return_msg'] == 'OK')
|
||||||
{
|
{
|
||||||
|
|
@ -570,24 +570,20 @@ class QQ
|
||||||
private function GetApiclientFile()
|
private function GetApiclientFile()
|
||||||
{
|
{
|
||||||
// 证书位置
|
// 证书位置
|
||||||
$apiclient_cert_file = ROOT.'runtime'.DS.'temp'.DS.'payment_weixin_pay_apiclient_cert.pem';
|
$apiclient_cert_file = ROOT.'runtime'.DS.'temp'.DS.'payment_qq_pay_apiclient_cert.pem';
|
||||||
$apiclient_key_file = ROOT.'runtime'.DS.'temp'.DS.'payment_weixin_pay_apiclient_key.pem';
|
$apiclient_key_file = ROOT.'runtime'.DS.'temp'.DS.'payment_qq_pay_apiclient_key.pem';
|
||||||
|
|
||||||
// 文件是否存在
|
// 文件是否存在
|
||||||
if(!file_exists($apiclient_cert_file))
|
$apiclient_cert = "-----BEGIN CERTIFICATE-----\n";
|
||||||
{
|
$apiclient_cert .= wordwrap($this->config['apiclient_cert'], 64, "\n", true);
|
||||||
$apiclient_cert = "-----BEGIN CERTIFICATE-----\n";
|
$apiclient_cert .= "\n-----END CERTIFICATE-----";
|
||||||
$apiclient_cert .= wordwrap($this->config['apiclient_cert'], 64, "\n", true);
|
file_put_contents($apiclient_cert_file, $apiclient_cert);
|
||||||
$apiclient_cert .= "\n-----END CERTIFICATE-----";
|
|
||||||
file_put_contents($apiclient_cert_file, $apiclient_cert);
|
$apiclient_key = "-----BEGIN PRIVATE KEY-----\n";
|
||||||
}
|
$apiclient_key .= wordwrap($this->config['apiclient_key'], 64, "\n", true);
|
||||||
if(!file_exists($apiclient_key_file))
|
$apiclient_key .= "\n-----END PRIVATE KEY-----";
|
||||||
{
|
file_put_contents($apiclient_key_file, $apiclient_key);
|
||||||
$apiclient_key = "-----BEGIN PRIVATE KEY-----\n";
|
|
||||||
$apiclient_key .= wordwrap($this->config['apiclient_key'], 64, "\n", true);
|
|
||||||
$apiclient_key .= "\n-----END PRIVATE KEY-----";
|
|
||||||
file_put_contents($apiclient_key_file, $apiclient_key);
|
|
||||||
}
|
|
||||||
return ['cert' => $apiclient_cert_file, 'key' => $apiclient_key_file];
|
return ['cert' => $apiclient_cert_file, 'key' => $apiclient_key_file];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -694,21 +694,16 @@ class Weixin
|
||||||
$apiclient_cert_file = ROOT.'runtime'.DS.'temp'.DS.'payment_weixin_pay_apiclient_cert.pem';
|
$apiclient_cert_file = ROOT.'runtime'.DS.'temp'.DS.'payment_weixin_pay_apiclient_cert.pem';
|
||||||
$apiclient_key_file = ROOT.'runtime'.DS.'temp'.DS.'payment_weixin_pay_apiclient_key.pem';
|
$apiclient_key_file = ROOT.'runtime'.DS.'temp'.DS.'payment_weixin_pay_apiclient_key.pem';
|
||||||
|
|
||||||
// 文件是否存在
|
$apiclient_cert = "-----BEGIN CERTIFICATE-----\n";
|
||||||
if(!file_exists($apiclient_cert_file))
|
$apiclient_cert .= wordwrap($this->config['apiclient_cert'], 64, "\n", true);
|
||||||
{
|
$apiclient_cert .= "\n-----END CERTIFICATE-----";
|
||||||
$apiclient_cert = "-----BEGIN CERTIFICATE-----\n";
|
file_put_contents($apiclient_cert_file, $apiclient_cert);
|
||||||
$apiclient_cert .= wordwrap($this->config['apiclient_cert'], 64, "\n", true);
|
|
||||||
$apiclient_cert .= "\n-----END CERTIFICATE-----";
|
$apiclient_key = "-----BEGIN PRIVATE KEY-----\n";
|
||||||
file_put_contents($apiclient_cert_file, $apiclient_cert);
|
$apiclient_key .= wordwrap($this->config['apiclient_key'], 64, "\n", true);
|
||||||
}
|
$apiclient_key .= "\n-----END PRIVATE KEY-----";
|
||||||
if(!file_exists($apiclient_key_file))
|
file_put_contents($apiclient_key_file, $apiclient_key);
|
||||||
{
|
|
||||||
$apiclient_key = "-----BEGIN PRIVATE KEY-----\n";
|
|
||||||
$apiclient_key .= wordwrap($this->config['apiclient_key'], 64, "\n", true);
|
|
||||||
$apiclient_key .= "\n-----END PRIVATE KEY-----";
|
|
||||||
file_put_contents($apiclient_key_file, $apiclient_key);
|
|
||||||
}
|
|
||||||
return ['cert' => $apiclient_cert_file, 'key' => $apiclient_key_file];
|
return ['cert' => $apiclient_cert_file, 'key' => $apiclient_key_file];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue