查询用户状态接口
用于查询用户是否有欠费或黑名单用户情况,确定能否符合微信侧开通乘车卡免密支付要求。如已经开通乘车卡,则需传签约号,可确定是否符合继续使用乘车卡的要求。
请求参数 | 类型 | 描述 |
---|---|---|
xml | object | 声明请求的XML 数据结构 |
appid | string | 公众账号id |
sub_appid | string | 子商户公众账号id |
mch_id | string | 商户号 |
sub_mch_id | string | 子商户号 |
contract_id | string | 委托代扣协议id |
sign_type | string | 签名类型HMAC-SHA256 枚举值 |
openid | string | 微信open ID |
php
$instance->v2->transit->partnerpay->querystate->postAsync([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'sub_appid' => 'wxcbda96de0b165489',
'mch_id' => '10000098',
'sub_mch_id' => '1900000109',
'contract_id' => 'wx15463511252015071056489715',
'sign_type' => 'HMAC-SHA256',
'openid' => 'oyobu0dmn6tdodznfwkoekqorbi8',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/transit/partnerpay/querystate')->postAsync([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'sub_appid' => 'wxcbda96de0b165489',
'mch_id' => '10000098',
'sub_mch_id' => '1900000109',
'contract_id' => 'wx15463511252015071056489715',
'sign_type' => 'HMAC-SHA256',
'openid' => 'oyobu0dmn6tdodznfwkoekqorbi8',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/transit/partnerpay/querystate']->postAsync([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'sub_appid' => 'wxcbda96de0b165489',
'mch_id' => '10000098',
'sub_mch_id' => '1900000109',
'contract_id' => 'wx15463511252015071056489715',
'sign_type' => 'HMAC-SHA256',
'openid' => 'oyobu0dmn6tdodznfwkoekqorbi8',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->transit->partnerpay->querystate->post([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'sub_appid' => 'wxcbda96de0b165489',
'mch_id' => '10000098',
'sub_mch_id' => '1900000109',
'contract_id' => 'wx15463511252015071056489715',
'sign_type' => 'HMAC-SHA256',
'openid' => 'oyobu0dmn6tdodznfwkoekqorbi8',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/transit/partnerpay/querystate')->post([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'sub_appid' => 'wxcbda96de0b165489',
'mch_id' => '10000098',
'sub_mch_id' => '1900000109',
'contract_id' => 'wx15463511252015071056489715',
'sign_type' => 'HMAC-SHA256',
'openid' => 'oyobu0dmn6tdodznfwkoekqorbi8',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/transit/partnerpay/querystate']->post([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'sub_appid' => 'wxcbda96de0b165489',
'mch_id' => '10000098',
'sub_mch_id' => '1900000109',
'contract_id' => 'wx15463511252015071056489715',
'sign_type' => 'HMAC-SHA256',
'openid' => 'oyobu0dmn6tdodznfwkoekqorbi8',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典 | 类型 | 描述 |
---|---|---|
return_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 |
return_msg | string | 返回信息 |
appid | string | 请求appid |
sub_appid | string | 子商户公众账号id |
mch_id | string | 商户号 |
sub_mch_id | string | 子商户号 |
nonce_str | string | 随机字符串 |
sign | string | 签名 |
result_code | string | 业务结果SUCCESS | FAIL 枚举值之一 |
err_code | string | 错误代码 |
err_code_des | string | 错误代码描述 |
user_state | string | 用户状态NORMAL | BLOCKED | OVERDUE 枚举值之一 |
contract_id | string | 委托代扣协议id |
plan_id | string | 签约模板id |
contract_code | string | 签约协议号 |
contract_state | string | 协议状态0 | 1 枚举值之一 |
参阅 官方文档