获取平台证书
调用获取平台证书V2接口之前,请前往微信支付商户平台升级API证书,升级后才可成功调用本接口。
请求参数 | 类型 | 描述 |
---|---|---|
xml | object | 声明请求的XML 数据结构 |
mch_id | string | 商户号 |
sign_type | string | 签名类型HMAC-SHA256 枚举值 |
php
$instance->v2->risk->getcertficates->postAsync([
'xml' => [
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/risk/getcertficates')->postAsync([
'xml' => [
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/risk/getcertficates']->postAsync([
'xml' => [
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->risk->getcertficates->post([
'xml' => [
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/risk/getcertficates')->post([
'xml' => [
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/risk/getcertficates']->post([
'xml' => [
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典 | 类型 | 描述 |
---|---|---|
return_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 |
return_msg | string | 错误码描述 |
nonce_str | string | 随机字符串 |
sign | string | 签名 |
error_code | string | 错误码 |
error_code_des | string | 错误代码描述 |
result_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 |
mch_id | string | 商户号 |
certificates | string | 平台证书信息 |
参阅 官方文档