获取平台证书列表
获取商户当前可用的平台证书列表。微信支付提供该接口,帮助商户后台系统实现平台证书的平滑更换。
| 请求参数 | 类型 | 描述 |
|---|---|---|
| query | object | 声明请求的查询参数(可选) |
| algorithm_type | string | 平台证书算法类型SM2|RSA|ALL枚举值之一默认为 RSA |
php
$instance->v3->certificates->getAsync([
'query' => [
'algorithm_type' => 'RSA',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string)$response->getBody(), true));
})
->wait();php
$instance->chain('v3/certificates')->getAsync([
'query' => [
'algorithm_type' => 'RSA',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string)$response->getBody(), true));
})
->wait();php
$instance['v3/certificates']->getAsync([
'query' => [
'algorithm_type' => 'RSA',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string)$response->getBody(), true));
})
->wait();php
$response = $instance->v3->certificates->get([
'query' => [
'algorithm_type' => 'RSA',
],
]);
print_r(json_decode((string)$response->getBody(), true));php
$response = $instance->chain('v3/certificates')->get([
'query' => [
'algorithm_type' => 'RSA',
],
]);
print_r(json_decode((string)$response->getBody(), true));php
$response = $instance['v3/certificates']->get([
'query' => [
'algorithm_type' => 'RSA',
],
]);
print_r(json_decode((string)$response->getBody(), true));| 返回字典 | 类型 | 描述 |
|---|---|---|
| data | object[] | 平台证书列表 |
| serial_no | string | 证书序列号 |
| effective_time | string | 证书启用时间 |
| expire_time | string | 证书弃用时间 |
| encrypt_certificate | object | 证书信息 |
| algorithm | string | 加密证书的算法 |
| nonce | string | 加密证书的随机串 |
| associated_data | string | 加密证书的附加数据 固定为 certificate |
| ciphertext | string | 加密后的证书内容 |