Skip to content

获取平台证书列表

获取商户当前可用的平台证书列表。微信支付提供该接口,帮助商户后台系统实现平台证书的平滑更换。

请求参数类型描述
queryarray声明请求的查询参数(可选)
algorithm_typestring平台证书算法类型
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));
返回字典类型描述
dataarray[]平台证书列表
serial_nostring证书序列号
effective_timestring证书启用时间
expire_timestring证书弃用时间
encrypt_certificatearray证书信息
algorithmstring加密证书的算法
noncestring加密证书的随机串
associated_datastring加密证书的附加数据
固定为certificate
ciphertextstring加密后的证书内容

参阅 官方开发文档 官方文档

Published on the GitHub by TheNorthMemory