메소드 |
설명 |
|
arrayToXml ( $arr ) |
|
|
calc ( string $a, string $b, string $operator, integer $scale = 2 ) : string | integer |
精度计算
默认使用bcmath扩展
如果没有启用bcmath扩展: 比较大小时转为整数比较、计算时使用number_format格式化返回值 |
|
createJsBizPackage ( string $openid, float $totalFee, string $outTradeNo, string $orderName, string $notifyUrl, $timestamp ) : string |
https://pay.weixin.qq.com/wiki/doc/api/wap.php?chapter=9_1 |
|
createNonceStr ( $length = 16 ) |
|
|
curlGet ( string $url = '', array $options = [] ) : mixed |
curl get |
|
curlPost ( $url = '', $postData = '', $options = [] ) |
|
|
getConfig ( ) |
|
|
getSign ( $params, $key ) |
例如:
appid: wxd930ea5d5a258f4f
mch_id: 10000100
device_info: 1000
Body: test
nonce_str: ibuaiVcKdpRxkhJA
第一步:对参数按照 key=value 的格式,并按照参数名 ASCII 字典序排序如下:
stringA="appid=wxd930ea5d5a258f4f&body=test&device_info=1000&mch_id=10000100&nonce_str=ibuaiVcKdpRxkhJA";
第二步:拼接支付密钥:
stringSignTemp="stringA&key=192006250b4c09247ec02edce69f6a2d"
sign=MD5(stringSignTemp).toUpperCase()="9A0A8659F005D6984697E2CA0A9CF3B7" |
|
notify ( ) : array |
获取微信支付异步通知。(支付金额单位已转为元)
成功返回通知信息数组,失败返回null |
|