mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2025-04-06 03:58:03 +08:00
修改微信v3支付
This commit is contained in:
parent
a4c94eed34
commit
974f18ebf7
@ -14,9 +14,11 @@
|
|||||||
|
|
||||||
namespace WePayV3\Contracts;
|
namespace WePayV3\Contracts;
|
||||||
|
|
||||||
|
use WeChat\Contracts\Tools;
|
||||||
use WeChat\Exceptions\InvalidArgumentException;
|
use WeChat\Exceptions\InvalidArgumentException;
|
||||||
use WeChat\Exceptions\InvalidDecryptException;
|
use WeChat\Exceptions\InvalidDecryptException;
|
||||||
use WeChat\Exceptions\InvalidResponseException;
|
use WeChat\Exceptions\InvalidResponseException;
|
||||||
|
use WeChat\Exceptions\LocalCacheException;
|
||||||
use WePayV3\Cert;
|
use WePayV3\Cert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,6 +102,7 @@ abstract class BasicWePay
|
|||||||
* @param bool $verify 是否验证
|
* @param bool $verify 是否验证
|
||||||
* @return array
|
* @return array
|
||||||
* @throws InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
|
* @throws LocalCacheException
|
||||||
*/
|
*/
|
||||||
public function doRequest($method, $pathinfo, $jsondata = '', $verify = false)
|
public function doRequest($method, $pathinfo, $jsondata = '', $verify = false)
|
||||||
{
|
{
|
||||||
@ -178,6 +181,7 @@ abstract class BasicWePay
|
|||||||
* @param string $serial 证书序号
|
* @param string $serial 证书序号
|
||||||
* @return int
|
* @return int
|
||||||
* @throws InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
|
* @throws LocalCacheException
|
||||||
*/
|
*/
|
||||||
protected function signVerify($data, $sign, $serial = '')
|
protected function signVerify($data, $sign, $serial = '')
|
||||||
{
|
{
|
||||||
@ -190,15 +194,15 @@ abstract class BasicWePay
|
|||||||
* 写入或读取临时文件
|
* 写入或读取临时文件
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param null|string $content
|
* @param null|string $content
|
||||||
* @return false|int|string
|
* @return string
|
||||||
|
* @throws LocalCacheException
|
||||||
*/
|
*/
|
||||||
protected function tmpFile($name, $content = null)
|
protected function tmpFile($name, $content = null)
|
||||||
{
|
{
|
||||||
$tmpname = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'wxpay-' . md5($name);
|
|
||||||
if (is_null($content)) {
|
if (is_null($content)) {
|
||||||
return file_exists($tmpname) ? base64_decode(file_get_contents($tmpname)) : '';
|
return Tools::getCache($name) ?: '';
|
||||||
} else {
|
} else {
|
||||||
return file_put_contents($tmpname, base64_encode($content));
|
return Tools::setCache($name, $content, 7200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ namespace WePayV3;
|
|||||||
|
|
||||||
use WeChat\Exceptions\InvalidArgumentException;
|
use WeChat\Exceptions\InvalidArgumentException;
|
||||||
use WeChat\Exceptions\InvalidResponseException;
|
use WeChat\Exceptions\InvalidResponseException;
|
||||||
|
use WeChat\Exceptions\LocalCacheException;
|
||||||
use WePayV3\Contracts\BasicWePay;
|
use WePayV3\Contracts\BasicWePay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,6 +37,7 @@ class Order extends BasicWePay
|
|||||||
* @param string $options
|
* @param string $options
|
||||||
* @return array
|
* @return array
|
||||||
* @throws InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
|
* @throws LocalCacheException
|
||||||
*/
|
*/
|
||||||
public function create($type, $options)
|
public function create($type, $options)
|
||||||
{
|
{
|
||||||
@ -57,6 +59,7 @@ class Order extends BasicWePay
|
|||||||
* @param string $orderNo
|
* @param string $orderNo
|
||||||
* @return array
|
* @return array
|
||||||
* @throws InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
|
* @throws LocalCacheException
|
||||||
*/
|
*/
|
||||||
public function query($orderNo)
|
public function query($orderNo)
|
||||||
{
|
{
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
namespace WePayV3;
|
namespace WePayV3;
|
||||||
|
|
||||||
|
use WeChat\Exceptions\InvalidResponseException;
|
||||||
|
use WeChat\Exceptions\LocalCacheException;
|
||||||
use WePayV3\Contracts\BasicWePay;
|
use WePayV3\Contracts\BasicWePay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,7 +29,8 @@ class Refund extends BasicWePay
|
|||||||
* 创建支付订单
|
* 创建支付订单
|
||||||
* @param string $data
|
* @param string $data
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
|
* @throws LocalCacheException
|
||||||
*/
|
*/
|
||||||
public function create($data)
|
public function create($data)
|
||||||
{
|
{
|
||||||
@ -38,7 +41,8 @@ class Refund extends BasicWePay
|
|||||||
* 退款信息查询
|
* 退款信息查询
|
||||||
* @param string $refundNo
|
* @param string $refundNo
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws InvalidResponseException
|
||||||
|
* @throws LocalCacheException
|
||||||
*/
|
*/
|
||||||
public function query($refundNo)
|
public function query($refundNo)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user