BasicWePay
in
微信支付基础类 Class BasicPay
Table of Contents
$config | 商户配置 | DataArray |
---|---|---|
$params | 当前请求数据 | DataArray |
$cache | 静态缓存 | static |
__construct() | WeChat constructor. | mixed |
instance() | 静态创建对象 | static |
getNotify() | 获取微信支付通知 | array |
getNotifySuccessReply() | 获取微信支付通知回复内容 | string |
getPaySign() | 生成支付签名 | string |
shortUrl() | 转换短链接 | array |
toXml() | 数组直接转xml数据输出 | string |
callPostApi() | 以Post请求接口 | array |
Properties
$config
商户配置
protected
DataArray
$config
$params
当前请求数据
protected
DataArray
$params
$cache
静态缓存
protected
static static
$cache
Methods
__construct()
WeChat constructor.
public
__construct(
$options :
array
)
: mixed
Parameters
- $options : array
Return values
mixedinstance()
静态创建对象
public
static instance(
$config :
array
)
: static
Parameters
- $config : array
Return values
staticgetNotify()
获取微信支付通知
public
getNotify(
)
: array
Tags
Return values
arraygetNotifySuccessReply()
获取微信支付通知回复内容
public
getNotifySuccessReply(
)
: string
Return values
stringgetPaySign()
生成支付签名
public
getPaySign(
$data :
array
[, $signType :
string
= 'MD5' ]
[, $buff :
string
= '' ]
)
: string
Parameters
- $data : array
参与签名的数据
- $signType : string = 'MD5'
参与签名的类型
- $buff : string = ''
参与签名字符串前缀
Return values
stringshortUrl()
转换短链接
public
shortUrl(
$longUrl :
string
)
: array
Parameters
- $longUrl : string
需要转换的URL,签名用原串,传输需URLencode
Tags
Return values
arraytoXml()
数组直接转xml数据输出
public
toXml(
$data :
array
[, $isReturn :
bool
= false ]
)
: string
Parameters
- $data : array
- $isReturn : bool = false
Return values
stringcallPostApi()
以Post请求接口
protected
callPostApi(
$url :
string
, $data :
array
[, $isCert :
bool
= false ]
[, $signType :
string
= 'HMAC-SHA256' ]
[, $needSignType :
bool
= true ]
)
: array
Parameters
- $url : string
请求
- $data : array
接口参数
- $isCert : bool = false
是否需要使用双向证书
- $signType : string = 'HMAC-SHA256'
数据签名类型 MD5|SHA256
- $needSignType : bool = true
是否需要传签名类型参数