Skip to content

查询用户状态接口

用于查询用户是否有欠费或黑名单用户情况,确定能否符合微信侧开通乘车卡免密支付要求。如已经开通乘车卡,则需传签约号,可确定是否符合继续使用乘车卡的要求。

请求参数类型描述
xmlobject声明请求的XML数据结构
appidstring公众账号id
mch_idstring商户号
contract_idstring委托代扣协议id
sign_typestring签名类型
HMAC-SHA256 枚举值
php
$instance->v2->transit->pay->querystate->postAsync([
  'xml' => [
    'appid'       => 'wxcbda96de0b165486',
    'mch_id'      => '10000098',
    'contract_id' => 'wx15463511252015071056489715',
    '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/transit/pay/querystate')->postAsync([
  'xml' => [
    'appid'       => 'wxcbda96de0b165486',
    'mch_id'      => '10000098',
    'contract_id' => 'wx15463511252015071056489715',
    'sign_type'   => 'HMAC-SHA256',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/transit/pay/querystate']->postAsync([
  'xml' => [
    'appid'       => 'wxcbda96de0b165486',
    'mch_id'      => '10000098',
    'contract_id' => 'wx15463511252015071056489715',
    '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->transit->pay->querystate->post([
  'xml' => [
    'appid'       => 'wxcbda96de0b165486',
    'mch_id'      => '10000098',
    'contract_id' => 'wx15463511252015071056489715',
    'sign_type'   => 'HMAC-SHA256',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/transit/pay/querystate')->post([
  'xml' => [
    'appid'       => 'wxcbda96de0b165486',
    'mch_id'      => '10000098',
    'contract_id' => 'wx15463511252015071056489715',
    'sign_type'   => 'HMAC-SHA256',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/transit/pay/querystate']->post([
  'xml' => [
    'appid'       => 'wxcbda96de0b165486',
    'mch_id'      => '10000098',
    'contract_id' => 'wx15463511252015071056489715',
    'sign_type'   => 'HMAC-SHA256',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
return_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
appidstring请求appid
mch_idstring商户号
nonce_strstring随机字符串
signstring签名
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
err_codestring错误代码
err_code_desstring错误代码描述
user_statestring用户状态
NORMAL | BLOCKED | OVERDUE 枚举值之一
contract_idstring委托代扣协议id
plan_idstring签约模板id
contract_codestring签约协议号
contract_statestring协议状态
0 | 1 枚举值之一

参阅 官方文档

Published on the GitHub by TheNorthMemory