Properties

$appId

$appId : 

Type

$rsaPrivateKeyFilePath

$rsaPrivateKeyFilePath : 

Type

$rsaPrivateKey

$rsaPrivateKey : 

Type

$gatewayUrl

$gatewayUrl : 

Type

$format

$format : 

Type

$apiVersion

$apiVersion : 

Type

$postCharset

$postCharset : 

Type

$alipayPublicKey

$alipayPublicKey : 

Type

$alipayrsaPublicKey

$alipayrsaPublicKey : 

Type

$debugInfo

$debugInfo : 

Type

$signType

$signType : 

Type

$encryptKey

$encryptKey : 

Type

$encryptType

$encryptType : 

Type

$alipaySdkVersion

$alipaySdkVersion : 

Type

$fileCharset

$fileCharset : 

Type

$RESPONSE_SUFFIX

$RESPONSE_SUFFIX : 

Type

$ERROR_RESPONSE

$ERROR_RESPONSE : 

Type

$SIGN_NODE_NAME

$SIGN_NODE_NAME : 

Type

$ENCRYPT_XML_NODE_NAME

$ENCRYPT_XML_NODE_NAME : 

Type

$needEncrypt

$needEncrypt : 

Type

Methods

generateSign()

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

Parameters

$params
$signType

rsaSign()

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

Parameters

$params
$signType

getSignContent()

getSignContent(  $params) 

Parameters

$params

getSignContentUrlencode()

getSignContentUrlencode(  $params) 

Parameters

$params

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(  $request,   $httpmethod = "POST") 

Parameters

$request
$httpmethod

execute()

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

Parameters

$request
$authToken
$appInfoAuthtoken

characet()

characet(  $data,   $targetCharset) : string

转换字符集编码

Parameters

$data
$targetCharset

Returns

string

exec()

exec(  $paramsArray) 

Parameters

$paramsArray

rsaCheckV1()

rsaCheckV1(  $params,   $rsaPublicKeyFilePath = null,   $signType = 'RSA2') 

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

Parameters

$params
$rsaPublicKeyFilePath
$signType

rsaCheckV2()

rsaCheckV2(  $params,   $rsaPublicKeyFilePath,   $signType = 'RSA2') 

Parameters

$params
$rsaPublicKeyFilePath
$signType

verify()

verify(  $data,   $sign,   $rsaPublicKeyFilePath,   $signType = 'RSA2') 

Parameters

$data
$sign
$rsaPublicKeyFilePath
$signType

checkSignAndDecrypt()

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

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

Parameters

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

encryptAndSign()

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

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

Parameters

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

rsaEncrypt()

rsaEncrypt(  $data,   $rsaPublicKeyPem,   $charset) 

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

Parameters

$data
$rsaPublicKeyPem
$charset

rsaDecrypt()

rsaDecrypt(  $data,   $rsaPrivateKeyPem,   $charset) 

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

Parameters

$data
$rsaPrivateKeyPem
$charset

splitCN()

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

Parameters

$cont
$n
$subnum
$charset

subCNchar()

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

Parameters

$str
$start
$length
$charset

parserResponseSubCode()

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

Parameters

$request
$responseContent
$respObject
$format

parserJSONSignData()

parserJSONSignData(  $request,   $responseContent,   $responseJSON) 

Parameters

$request
$responseContent
$responseJSON

parserJSONSignSource()

parserJSONSignSource(  $request,   $responseContent) 

Parameters

$request
$responseContent

parserJSONSource()

parserJSONSource(  $responseContent,   $nodeName,   $nodeIndex) 

Parameters

$responseContent
$nodeName
$nodeIndex

parserJSONSign()

parserJSONSign(  $responseJSon) 

Parameters

$responseJSon

parserXMLSignData()

parserXMLSignData(  $request,   $responseContent) 

Parameters

$request
$responseContent

parserXMLSignSource()

parserXMLSignSource(  $request,   $responseContent) 

Parameters

$request
$responseContent

parserXMLSource()

parserXMLSource(  $responseContent,   $nodeName,   $nodeIndex) 

Parameters

$responseContent
$nodeName
$nodeIndex

parserXMLSign()

parserXMLSign(  $responseContent) 

Parameters

$responseContent

checkResponseSign()

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

验签

Parameters

$request
$signData
$resp
$respObject

Throws

\Exception

echoDebug()

echoDebug(  $content) 

Parameters

$content

sign()

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

Parameters

$data
$signType

curl()

curl(  $url,   $postFields = null) 

Parameters

$url
$postFields

getMillisecond()

getMillisecond() 

logCommunicationError()

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

Parameters

$apiName
$requestUrl
$errorCode
$responseTxt

buildRequestForm()

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

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

Parameters

$para_temp

请求参数数组

Returns

\提交表单HTML文本

checkEmpty()

checkEmpty(  $value) 

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

Parameters

$value

setupCharsets()

setupCharsets(  $request) 

Parameters

$request

encryptJSONSignSource()

encryptJSONSignSource(  $request,   $responseContent) 

Parameters

$request
$responseContent

parserEncryptJSONSignSource()

parserEncryptJSONSignSource(  $request,   $responseContent) 

Parameters

$request
$responseContent

parserEncryptJSONItem()

parserEncryptJSONItem(  $responseContent,   $nodeName,   $nodeIndex) 

Parameters

$responseContent
$nodeName
$nodeIndex

encryptXMLSignSource()

encryptXMLSignSource(  $request,   $responseContent) 

Parameters

$request
$responseContent

parserEncryptXMLSignSource()

parserEncryptXMLSignSource(  $request,   $responseContent) 

Parameters

$request
$responseContent

parserEncryptXMLItem()

parserEncryptXMLItem(  $responseContent,   $nodeName,   $nodeIndex) 

Parameters

$responseContent
$nodeName
$nodeIndex