Skip to content

预签约

商户调用该接口可获取预签约码(presign_token),预签约码对应用户一次的签约信息,之后用户可以从商户小程序跳转到微信签约小程序时使用该预签约码进行签约。

请求参数类型描述
jsonobject声明请求的JSON数据结构
appidstring商户appid
openidstring商户appid下的用户标识
plan_idstring签约模板号
user_idstring用户账号
school_idstring学校编号
out_contract_codestring外部签约号
contract_modestring签约模式
downgrade_default_contractboolean允许降级为普通签约模式
identityobject实名信息
real_namestring姓名
credential_typestring证件类型
id_card_numberstring身份证号
bank_cardobject签约银行卡
bank_card_nostring签约银行卡号
valid_thrustring银行卡有效期
phonestring银行卡开卡预留手机号
bank_typestring银行类型
headersobject声明请求的头参数
Wechatpay-Serialstring平台公钥ID/平台公钥证书序列号
php
$instance->v3->eduschoolpay->contracts->presign->postAsync([
  'json' => [
    'appid' => 'wx8888888888888888',
    'openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'user_id' => '20200330tony',
    'school_id' => '18260256813396',
    'out_contract_code' => '20190806125346',
    'contract_mode' => 'LIMIT_BANK_CARD',
    'downgrade_default_contract' => true,
    'identity' => [
      'real_name' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'credential_type' => 'IDENTITY_CARD',
      'id_card_number' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
    ],
    'bank_card' => [
      'bank_card_no' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'valid_thru' => '08/21',
      'phone' => 'j6PlFRRJ4nvGSbtDZzXbXScACvDSnIny67zk3BgT5uIbK4VfGmcjPBEk2mt5ASZ6UUHB4Gy0IZpbuanF9',
      'bank_type' => 'CMC',
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/eduschoolpay/contracts/presign')->postAsync([
  'json' => [
    'appid' => 'wx8888888888888888',
    'openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'user_id' => '20200330tony',
    'school_id' => '18260256813396',
    'out_contract_code' => '20190806125346',
    'contract_mode' => 'LIMIT_BANK_CARD',
    'downgrade_default_contract' => true,
    'identity' => [
      'real_name' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'credential_type' => 'IDENTITY_CARD',
      'id_card_number' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
    ],
    'bank_card' => [
      'bank_card_no' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'valid_thru' => '08/21',
      'phone' => 'j6PlFRRJ4nvGSbtDZzXbXScACvDSnIny67zk3BgT5uIbK4VfGmcjPBEk2mt5ASZ6UUHB4Gy0IZpbuanF9',
      'bank_type' => 'CMC',
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/eduschoolpay/contracts/presign']->postAsync([
  'json' => [
    'appid' => 'wx8888888888888888',
    'openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'user_id' => '20200330tony',
    'school_id' => '18260256813396',
    'out_contract_code' => '20190806125346',
    'contract_mode' => 'LIMIT_BANK_CARD',
    'downgrade_default_contract' => true,
    'identity' => [
      'real_name' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'credential_type' => 'IDENTITY_CARD',
      'id_card_number' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
    ],
    'bank_card' => [
      'bank_card_no' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'valid_thru' => '08/21',
      'phone' => 'j6PlFRRJ4nvGSbtDZzXbXScACvDSnIny67zk3BgT5uIbK4VfGmcjPBEk2mt5ASZ6UUHB4Gy0IZpbuanF9',
      'bank_type' => 'CMC',
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->eduschoolpay->contracts->presign->post([
  'json' => [
    'appid' => 'wx8888888888888888',
    'openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'user_id' => '20200330tony',
    'school_id' => '18260256813396',
    'out_contract_code' => '20190806125346',
    'contract_mode' => 'LIMIT_BANK_CARD',
    'downgrade_default_contract' => true,
    'identity' => [
      'real_name' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'credential_type' => 'IDENTITY_CARD',
      'id_card_number' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
    ],
    'bank_card' => [
      'bank_card_no' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'valid_thru' => '08/21',
      'phone' => 'j6PlFRRJ4nvGSbtDZzXbXScACvDSnIny67zk3BgT5uIbK4VfGmcjPBEk2mt5ASZ6UUHB4Gy0IZpbuanF9',
      'bank_type' => 'CMC',
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/eduschoolpay/contracts/presign')->post([
  'json' => [
    'appid' => 'wx8888888888888888',
    'openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'user_id' => '20200330tony',
    'school_id' => '18260256813396',
    'out_contract_code' => '20190806125346',
    'contract_mode' => 'LIMIT_BANK_CARD',
    'downgrade_default_contract' => true,
    'identity' => [
      'real_name' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'credential_type' => 'IDENTITY_CARD',
      'id_card_number' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
    ],
    'bank_card' => [
      'bank_card_no' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'valid_thru' => '08/21',
      'phone' => 'j6PlFRRJ4nvGSbtDZzXbXScACvDSnIny67zk3BgT5uIbK4VfGmcjPBEk2mt5ASZ6UUHB4Gy0IZpbuanF9',
      'bank_type' => 'CMC',
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/eduschoolpay/contracts/presign']->post([
  'json' => [
    'appid' => 'wx8888888888888888',
    'openid' => 'oUpF8uMuAJOM2pxb1Q',
    'plan_id' => '101164396123311331',
    'user_id' => '20200330tony',
    'school_id' => '18260256813396',
    'out_contract_code' => '20190806125346',
    'contract_mode' => 'LIMIT_BANK_CARD',
    'downgrade_default_contract' => true,
    'identity' => [
      'real_name' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'credential_type' => 'IDENTITY_CARD',
      'id_card_number' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
    ],
    'bank_card' => [
      'bank_card_no' => '6TqLAZvNZ4AXLNHLMbjA1yKq2k5krHM09m3tCuR',
      'valid_thru' => '08/21',
      'phone' => 'j6PlFRRJ4nvGSbtDZzXbXScACvDSnIny67zk3BgT5uIbK4VfGmcjPBEk2mt5ASZ6UUHB4Gy0IZpbuanF9',
      'bank_type' => 'CMC',
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
presign_tokenstring预签约码

参阅 官方文档

Published on the GitHub by TheNorthMemory