全网最简单对接银盛的银账通接口phpdemo,
总共三个文件即可运行,
配置文件config.php
公共函数function .php
然后就是三个运行文件分别为token.php,upload.php,create.php
不需要繁琐的sdk 找关联引用方法搞得焦头烂额, 简单快捷
第一步获取token https://yzt.ysepay.com:8443/api/getYsToken
$config = include('./config.php');
$param = [
'src' => '02',
'msgCode' => 'getYsToken',
'version' => '1.0',
'timeStamp' => date('Y-m-d H:i:s'),
'check' => checkRsaPubEncrypt($config['aes_key'],$config['public']),
'norce' => randomKey(),
'certId' => $config['certId'],
'msg' => aes_encode(json_encode([
'appSecret' => $config['appSecret'],
'userCode' => $config['userCode'],
]),$config['aes_key']),
];
$param['sign'] = sign($param,$config['private_key']);
$url = 'https://yzt.ysepay.com:8443/api/getYsToken';
$result = curl($url,$param);
if(substr($result,0,1)!='{'){
$result = base64_decode($result);
}
$result = json_decode($result,true);
if($result['code']!='200'){
exit($result['msg']);
}
$result = aes_decode($result['data'],$config['aes_key']);
$result = json_decode($result,true);
echo '<pre>';
print_r($result);
得到的token
第二步上传图片 https://yzt.ysepay.com:8443/api/uploadPicture
<?php
$config = include('./config.php');
$param = [
'appSecret' => $config['appSecret'],
'certId' => $config['certId'],
'check' => checkRsaPubEncrypt($config['aes_key'],$config['public']),
'msgCode' => 'uploadPicture',