Trade
extends BasicAliPay
in
支付宝标准接口 Class Trade
Table of Contents
$config | 支持配置 | DataArray |
---|---|---|
$options | 当前请求数据 | DataArray |
$params | DzContent数据 | DataArray |
$cache | 静态缓存 | static |
$gateway | 正常请求网关 | string |
setMethod() | 设置交易接口地址 | $this |
getMethod() | 获取交易接口地址 | string |
setOption() | 设置接口公共参数 | Trade |
getOption() | 获取接口公共参数 | array|string|null |
apply() | 执行通过接口 | array|bool|mixed |
__construct() | AliPay constructor. | mixed |
instance() | 静态创建对象 | static |
query() | 查询支付宝订单状态 | array|bool |
refund() | 支付宝订单退款操作 | array|bool |
close() | 关闭支付宝进行中的订单 | array|bool |
notify() | 获取通知数据 | bool|array |
verify() | 验证接口返回的数据签名 | array|bool |
getSign() | 获取数据签名 | string |
trimCert() | 去除证书前后内容及空白 | string |
getSignContent() | 数据签名处理 | bool|string |
applyData() | 数据包生成及数据签名 | mixed |
getResult() | 请求接口并验证访问数据 | array|bool |
buildPayHtml() | 生成支付HTML代码 | string |
getCertSN() | 新版 从证书中提取序列号 | string |
getRootCertSN() | 新版 提取根证书序列号 | string|null |
_arr2str() | 新版 数组转字符串 | string |
_hex2dec() | 新版 0x转高精度数字 | int|string |
apply() | 应用数据操作 | mixed |
Properties
$config
支持配置
protected
DataArray
$config
$options
当前请求数据
protected
DataArray
$options
$params
DzContent数据
protected
DataArray
$params
$cache
静态缓存
protected
static static
$cache
$gateway
正常请求网关
protected
string
$gateway
= 'https://openapi.alipay.com/gateway.do?charset=utf-8'
Methods
setMethod()
设置交易接口地址
public
setMethod(
$method :
string
)
: $this
Parameters
- $method : string
Return values
$thisgetMethod()
获取交易接口地址
public
getMethod(
)
: string
Return values
stringsetOption()
设置接口公共参数
public
setOption(
[ $option :
array
= [] ]
)
: Trade
Parameters
- $option : array = []
Return values
TradegetOption()
获取接口公共参数
public
getOption(
)
: array|string|null
Return values
array|string|nullapply()
执行通过接口
public
apply(
$options :
array
)
: array|bool|mixed
Parameters
- $options : array
Tags
Return values
array|bool|mixed__construct()
AliPay constructor.
public
__construct(
$options :
array
)
: mixed
Parameters
- $options : array
Return values
mixedinstance()
静态创建对象
public
static instance(
$config :
array
)
: static
Parameters
- $config : array
Return values
staticquery()
查询支付宝订单状态
public
query(
[ $out_trade_no :
string
= '' ]
)
: array|bool
Parameters
- $out_trade_no : string = ''
Tags
Return values
array|boolrefund()
支付宝订单退款操作
public
refund(
$options :
array|string
[, $refund_amount :
null
= null ]
)
: array|bool
Parameters
- $options : array|string
退款参数或退款商户订单号
- $refund_amount : null = null
退款金额
Tags
Return values
array|boolclose()
关闭支付宝进行中的订单
public
close(
$options :
array|string
)
: array|bool
Parameters
- $options : array|string
Tags
Return values
array|boolnotify()
获取通知数据
public
notify(
[ $needSignType :
bool
= false ]
)
: bool|array
Parameters
- $needSignType : bool = false
是否需要sign_type字段
Tags
Return values
bool|arrayverify()
验证接口返回的数据签名
protected
verify(
$data :
array
, $sign :
null|string
)
: array|bool
Parameters
- $data : array
通知数据
- $sign : null|string
数据签名
Tags
Return values
array|boolgetSign()
获取数据签名
protected
getSign(
)
: string
Return values
stringtrimCert()
去除证书前后内容及空白
protected
trimCert(
$sign :
string
)
: string
Parameters
- $sign : string
Return values
stringgetSignContent()
数据签名处理
private
getSignContent(
$data :
array
[, $needSignType :
bool
= false ]
)
: bool|string
Parameters
- $data : array
需要进行签名数据
- $needSignType : bool = false
是否需要sign_type字段
Return values
bool|stringapplyData()
数据包生成及数据签名
protected
applyData(
$options :
array
)
: mixed
Parameters
- $options : array
Return values
mixedgetResult()
请求接口并验证访问数据
protected
getResult(
$options :
array
)
: array|bool
Parameters
- $options : array
Tags
Return values
array|boolbuildPayHtml()
生成支付HTML代码
protected
buildPayHtml(
)
: string
Return values
stringgetCertSN()
新版 从证书中提取序列号
public
getCertSN(
$sign :
string
)
: string
Parameters
- $sign : string
Return values
stringgetRootCertSN()
新版 提取根证书序列号
public
getRootCertSN(
$sign :
string
)
: string|null
Parameters
- $sign : string
Return values
string|null_arr2str()
新版 数组转字符串
private
_arr2str(
$array :
array
)
: string
Parameters
- $array : array
Return values
string_hex2dec()
新版 0x转高精度数字
private
_hex2dec(
$hex :
string
)
: int|string
Parameters
- $hex : string
Return values
int|stringapply()
应用数据操作
public
abstract apply(
$options :
array
)
: mixed
Parameters
- $options : array