Skip to content

申请解约

商户与用户的签约关系有误或者商户主动要求与用户解除之前的签约协议时可调用此接口完成解约。

请求参数类型描述
noncelesstrue声明请求的XML无随机字符串参数
xmlobject声明请求的XML数据结构
appidstring请求appid
mch_idstring商户号
plan_idstring模板id
contract_codestring签约协议号
contract_idstring委托代扣协议id
contract_termination_remarkstring解约备注
versionstring版本号
1.0 枚举值
sub_appidstring子商户公众账号ID
sub_mch_idstring子商户号
php
$instance->v2->papay->deletecontract->postAsync([
  'nonceless' => true,
  'xml' => [
    'appid'                       => 'wxcbda96de0b165486',
    'mch_id'                      => '10000098',
    'plan_id'                     => '12251',
    'contract_code'               => '1234',
    'contract_id'                 => 'Wx15463511252015071056489715',
    'contract_termination_remark' => '解约原因',
    'version'                     => '1.0',
    'sub_appid'                   => '',
    'sub_mch_id'                  => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/papay/deletecontract')->postAsync([
  'nonceless' => true,
  'xml' => [
    'appid'                       => 'wxcbda96de0b165486',
    'mch_id'                      => '10000098',
    'plan_id'                     => '12251',
    'contract_code'               => '1234',
    'contract_id'                 => 'Wx15463511252015071056489715',
    'contract_termination_remark' => '解约原因',
    'version'                     => '1.0',
    'sub_appid'                   => '',
    'sub_mch_id'                  => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/papay/deletecontract']->postAsync([
  'nonceless' => true,
  'xml' => [
    'appid'                       => 'wxcbda96de0b165486',
    'mch_id'                      => '10000098',
    'plan_id'                     => '12251',
    'contract_code'               => '1234',
    'contract_id'                 => 'Wx15463511252015071056489715',
    'contract_termination_remark' => '解约原因',
    'version'                     => '1.0',
    'sub_appid'                   => '',
    'sub_mch_id'                  => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->papay->deletecontract->post([
  'nonceless' => true,
  'xml' => [
    'appid'                       => 'wxcbda96de0b165486',
    'mch_id'                      => '10000098',
    'plan_id'                     => '12251',
    'contract_code'               => '1234',
    'contract_id'                 => 'Wx15463511252015071056489715',
    'contract_termination_remark' => '解约原因',
    'version'                     => '1.0',
    'sub_appid'                   => '',
    'sub_mch_id'                  => '',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/papay/deletecontract')->post([
  'nonceless' => true,
  'xml' => [
    'appid'                       => 'wxcbda96de0b165486',
    'mch_id'                      => '10000098',
    'plan_id'                     => '12251',
    'contract_code'               => '1234',
    'contract_id'                 => 'Wx15463511252015071056489715',
    'contract_termination_remark' => '解约原因',
    'version'                     => '1.0',
    'sub_appid'                   => '',
    'sub_mch_id'                  => '',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/papay/deletecontract']->post([
  'nonceless' => true,
  'xml' => [
    'appid'                       => 'wxcbda96de0b165486',
    'mch_id'                      => '10000098',
    'plan_id'                     => '12251',
    'contract_code'               => '1234',
    'contract_id'                 => 'Wx15463511252015071056489715',
    'contract_termination_remark' => '解约原因',
    'version'                     => '1.0',
    'sub_appid'                   => '',
    'sub_mch_id'                  => '',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
return_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
appidstring公众账号id
mch_idstring商户号
contract_idstring委托代扣协议id
plan_idstring模板id
contract_codestring签约协议号
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
err_codestring错误代码
err_code_desstring错误代码描述
signstring签名
sub_appidstring子商户公众账号ID
sub_mch_idstring子商户号

参阅 官方文档

Published on the GitHub by TheNorthMemory