查询签约关系
查询签约关系接口提供单笔签约关系查询。注意:查询签约关系可通过下面两种方式查询:方式一:使用微信返回的委托代扣协议contract_id进行查询。方式二:plan_id+contract_code模式:传入模板id和签约协议号进行查询。两种查询方式返回结果相同。
请求参数 | 类型 | 描述 |
---|---|---|
nonceless | true | 声明请求的XML 无随机字符串参数 |
xml | object | 声明请求的XML 数据结构 |
appid | string | 请求appid |
mch_id | integer | 商户号 |
contract_id | string | 委托代扣协议id |
plan_id | integer | 模板id |
contract_code | string | 签约协议号 |
version | string | 版本号1.0 枚举值 |
php
$instance->v2->papay->querycontract->postAsync([
'nonceless' => true,
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'contract_id' => '100005698',
'plan_id' => '123',
'contract_code' => '1023658866',
'version' => '1.0',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/papay/querycontract')->postAsync([
'nonceless' => true,
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'contract_id' => '100005698',
'plan_id' => '123',
'contract_code' => '1023658866',
'version' => '1.0',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/papay/querycontract']->postAsync([
'nonceless' => true,
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'contract_id' => '100005698',
'plan_id' => '123',
'contract_code' => '1023658866',
'version' => '1.0',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->papay->querycontract->post([
'nonceless' => true,
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'contract_id' => '100005698',
'plan_id' => '123',
'contract_code' => '1023658866',
'version' => '1.0',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/papay/querycontract')->post([
'nonceless' => true,
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'contract_id' => '100005698',
'plan_id' => '123',
'contract_code' => '1023658866',
'version' => '1.0',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/papay/querycontract']->post([
'nonceless' => true,
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'contract_id' => '100005698',
'plan_id' => '123',
'contract_code' => '1023658866',
'version' => '1.0',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典 | 类型 | 描述 |
---|---|---|
return_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 |
return_msg | string | 返回信息 |
result_code | string | 业务结果SUCCESS | FAIL 枚举值之一 |
mch_id | integer | 商户号 |
appid | string | 公众账号id |
contract_id | string | 委托代扣协议id |
plan_id | integer | 模板id |
contract_code | string | 签约协议号 |
contract_display_account | string | 用户账户展示名称 |
contract_state | integer | 协议状态 |
contract_signed_time | string | 协议签署时间 |
contract_expired_time | string | 协议到期时间 |
contract_terminated_time | string | 协议解约时间 |
contract_termination_mode | integer | 协议解约方式 |
sign | string | 签名 |
contract_termination_remark | string | 解约备注 |
openid | string | 用户标识 |
err_code | string | 错误代码 |
err_code_des | string | 错误代码描述 |
参阅 官方文档