Properties

$appId

$appId

$rsaPrivateKeyFilePath

$rsaPrivateKeyFilePath

$rsaPrivateKey

$rsaPrivateKey

$gatewayUrl

$gatewayUrl

$format

$format

$apiVersion

$apiVersion

$postCharset

$postCharset

$alipayPublicKey

$alipayPublicKey

$alipayrsaPublicKey

$alipayrsaPublicKey

$debugInfo

$debugInfo

$signType

$signType

$encryptKey

$encryptKey

$encryptType

$encryptType

$alipaySdkVersion

$alipaySdkVersion

$fileCharset

$fileCharset

$RESPONSE_SUFFIX

$RESPONSE_SUFFIX

$ERROR_RESPONSE

$ERROR_RESPONSE

$SIGN_NODE_NAME

$SIGN_NODE_NAME

$ENCRYPT_XML_NODE_NAME

$ENCRYPT_XML_NODE_NAME

$needEncrypt

$needEncrypt

Methods

generateSign()

generateSign(mixed  $params, mixed  $signType = "RSA") : mixed

Parameters

mixed $params
mixed $signType

Returns

mixed —

rsaSign()

rsaSign(mixed  $params, mixed  $signType = "RSA") : mixed

Parameters

mixed $params
mixed $signType

Returns

mixed —

getSignContent()

getSignContent(mixed  $params) : mixed

Parameters

mixed $params

Returns

mixed —

getSignContentUrlencode()

getSignContentUrlencode(mixed  $params) : mixed

Parameters

mixed $params

Returns

mixed —

alonersaSign()

alonersaSign( $data,  $privatekey,  $signType = "RSA",  $keyfromfile = false) : string

RSA单独签名方法,未做字符串处理,字符串处理见getSignContent()

Parameters

$data

待签名字符串

$privatekey

商户私钥,根据keyfromfile来判断是读取字符串还是读取文件,false:填写私钥字符串去回车和空格 true:填写私钥文件路径

$signType

签名方式,RSA:SHA1 RSA2:SHA256

$keyfromfile

私钥获取方式,读取字符串还是读文件

Returns

string —

sdkExecute()

sdkExecute( $request) : string

生成用于调用收银台SDK的字符串

Parameters

$request

SDK接口的请求参数对象

Returns

string —

pageExecute()

pageExecute(mixed  $request, mixed  $httpmethod = "POST") : mixed

Parameters

mixed $request
mixed $httpmethod

Returns

mixed —

execute()

execute(mixed  $request, mixed  $authToken = null, mixed  $appInfoAuthtoken = null) : mixed

Parameters

mixed $request
mixed $authToken
mixed $appInfoAuthtoken

Returns

mixed —

characet()

characet( $data,  $targetCharset) : string

转换字符集编码

Parameters

$data
$targetCharset

Returns

string —

exec()

exec(mixed  $paramsArray) : mixed

Parameters

mixed $paramsArray

Returns

mixed —

rsaCheckV1()

rsaCheckV1(mixed  $params, mixed  $rsaPublicKeyFilePath, mixed  $signType = 'RSA') : mixed

rsaCheckV1 & rsaCheckV2 验证签名 在使用本方法前,必须初始化AopClient且传入公钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。

Parameters

mixed $params
mixed $rsaPublicKeyFilePath
mixed $signType

Returns

mixed —

rsaCheckV2()

rsaCheckV2(mixed  $params, mixed  $rsaPublicKeyFilePath, mixed  $signType = 'RSA') : mixed

Parameters

mixed $params
mixed $rsaPublicKeyFilePath
mixed $signType

Returns

mixed —

verify()

verify(mixed  $data, mixed  $sign, mixed  $rsaPublicKeyFilePath, mixed  $signType = 'RSA') : mixed

Parameters

mixed $data
mixed $sign
mixed $rsaPublicKeyFilePath
mixed $signType

Returns

mixed —

checkSignAndDecrypt()

checkSignAndDecrypt(mixed  $params, mixed  $rsaPublicKeyPem, mixed  $rsaPrivateKeyPem, mixed  $isCheckSign, mixed  $isDecrypt, mixed  $signType = 'RSA') : mixed

在使用本方法前,必须初始化AopClient且传入公私钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。

Parameters

mixed $params
mixed $rsaPublicKeyPem
mixed $rsaPrivateKeyPem
mixed $isCheckSign
mixed $isDecrypt
mixed $signType

Returns

mixed —

encryptAndSign()

encryptAndSign(mixed  $bizContent, mixed  $rsaPublicKeyPem, mixed  $rsaPrivateKeyPem, mixed  $charset, mixed  $isEncrypt, mixed  $isSign, mixed  $signType = 'RSA') : mixed

在使用本方法前,必须初始化AopClient且传入公私钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。

Parameters

mixed $bizContent
mixed $rsaPublicKeyPem
mixed $rsaPrivateKeyPem
mixed $charset
mixed $isEncrypt
mixed $isSign
mixed $signType

Returns

mixed —

rsaEncrypt()

rsaEncrypt(mixed  $data, mixed  $rsaPublicKeyPem, mixed  $charset) : mixed

在使用本方法前,必须初始化AopClient且传入公私钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。

Parameters

mixed $data
mixed $rsaPublicKeyPem
mixed $charset

Returns

mixed —

rsaDecrypt()

rsaDecrypt(mixed  $data, mixed  $rsaPrivateKeyPem, mixed  $charset) : mixed

在使用本方法前,必须初始化AopClient且传入公私钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。

Parameters

mixed $data
mixed $rsaPrivateKeyPem
mixed $charset

Returns

mixed —

splitCN()

splitCN(mixed  $cont, mixed  $n, mixed  $subnum, mixed  $charset) : mixed

Parameters

mixed $cont
mixed $n
mixed $subnum
mixed $charset

Returns

mixed —

subCNchar()

subCNchar(mixed  $str, mixed  $start, mixed  $length, mixed  $charset = "gbk") : mixed

Parameters

mixed $str
mixed $start
mixed $length
mixed $charset

Returns

mixed —

parserResponseSubCode()

parserResponseSubCode(mixed  $request, mixed  $responseContent, mixed  $respObject, mixed  $format) : mixed

Parameters

mixed $request
mixed $responseContent
mixed $respObject
mixed $format

Returns

mixed —

parserJSONSignData()

parserJSONSignData(mixed  $request, mixed  $responseContent, mixed  $responseJSON) : mixed

Parameters

mixed $request
mixed $responseContent
mixed $responseJSON

Returns

mixed —

parserJSONSignSource()

parserJSONSignSource(mixed  $request, mixed  $responseContent) : mixed

Parameters

mixed $request
mixed $responseContent

Returns

mixed —

parserJSONSource()

parserJSONSource(mixed  $responseContent, mixed  $nodeName, mixed  $nodeIndex) : mixed

Parameters

mixed $responseContent
mixed $nodeName
mixed $nodeIndex

Returns

mixed —

parserJSONSign()

parserJSONSign(mixed  $responseJSon) : mixed

Parameters

mixed $responseJSon

Returns

mixed —

parserXMLSignData()

parserXMLSignData(mixed  $request, mixed  $responseContent) : mixed

Parameters

mixed $request
mixed $responseContent

Returns

mixed —

parserXMLSignSource()

parserXMLSignSource(mixed  $request, mixed  $responseContent) : mixed

Parameters

mixed $request
mixed $responseContent

Returns

mixed —

parserXMLSource()

parserXMLSource(mixed  $responseContent, mixed  $nodeName, mixed  $nodeIndex) : mixed

Parameters

mixed $responseContent
mixed $nodeName
mixed $nodeIndex

Returns

mixed —

parserXMLSign()

parserXMLSign(mixed  $responseContent) : mixed

Parameters

mixed $responseContent

Returns

mixed —

checkResponseSign()

checkResponseSign( $request,  $signData,  $resp,  $respObject) : mixed

验签

Parameters

$request
$signData
$resp
$respObject

Throws

\Exception

Returns

mixed —

echoDebug()

echoDebug(mixed  $content) : mixed

Parameters

mixed $content

Returns

mixed —

sign()

sign(mixed  $data, mixed  $signType = "RSA") : mixed

Parameters

mixed $data
mixed $signType

Returns

mixed —

curl()

curl(mixed  $url, mixed  $postFields = null) : mixed

Parameters

mixed $url
mixed $postFields

Returns

mixed —

getMillisecond()

getMillisecond() : mixed

Returns

mixed —

logCommunicationError()

logCommunicationError(mixed  $apiName, mixed  $requestUrl, mixed  $errorCode, mixed  $responseTxt) : mixed

Parameters

mixed $apiName
mixed $requestUrl
mixed $errorCode
mixed $responseTxt

Returns

mixed —

buildRequestForm()

buildRequestForm( $para_temp) : \提交表单HTML文本

建立请求,以表单HTML形式构造(默认)

Parameters

$para_temp

请求参数数组

Returns

\提交表单HTML文本 —

checkEmpty()

checkEmpty(mixed  $value) : mixed

校验$value是否非空 if not set ,return true; if is null , return true;

Parameters

mixed $value

Returns

mixed —

setupCharsets()

setupCharsets(mixed  $request) : mixed

Parameters

mixed $request

Returns

mixed —

encryptJSONSignSource()

encryptJSONSignSource(mixed  $request, mixed  $responseContent) : mixed

Parameters

mixed $request
mixed $responseContent

Returns

mixed —

parserEncryptJSONSignSource()

parserEncryptJSONSignSource(mixed  $request, mixed  $responseContent) : mixed

Parameters

mixed $request
mixed $responseContent

Returns

mixed —

parserEncryptJSONItem()

parserEncryptJSONItem(mixed  $responseContent, mixed  $nodeName, mixed  $nodeIndex) : mixed

Parameters

mixed $responseContent
mixed $nodeName
mixed $nodeIndex

Returns

mixed —

encryptXMLSignSource()

encryptXMLSignSource(mixed  $request, mixed  $responseContent) : mixed

Parameters

mixed $request
mixed $responseContent

Returns

mixed —

parserEncryptXMLSignSource()

parserEncryptXMLSignSource(mixed  $request, mixed  $responseContent) : mixed

Parameters

mixed $request
mixed $responseContent

Returns

mixed —

parserEncryptXMLItem()

parserEncryptXMLItem(mixed  $responseContent, mixed  $nodeName, mixed  $nodeIndex) : mixed

Parameters

mixed $responseContent
mixed $nodeName
mixed $nodeIndex

Returns

mixed —