Skip to content

APP场景预签约

商户可调用本接口预先指定签约,生成预签约会话及对应的预签约ID,再携带预签约ID(pre_entrustweb_id)参数,通过微信SDK拉起微信支付客户端的签约页面。

请求参数类型描述
jsonobject声明请求的JSON数据结构
appidstring签约和付款的AppID
out_contract_codestring业务申请单号
php
$instance->v3->ecommerce->individualContracts->preEntrustSign->app->postAsync([
  'json' => [
    'appid'             => 'wxd678efh567h23787',
    'out_contract_code' => 'APPLYMENT_00000000001',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/ecommerce/individual-contracts/pre-entrust-sign/app')->postAsync([
  'json' => [
    'appid'             => 'wxd678efh567h23787',
    'out_contract_code' => 'APPLYMENT_00000000001',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/ecommerce/individual-contracts/pre-entrust-sign/app']->postAsync([
  'json' => [
    'appid'             => 'wxd678efh567h23787',
    'out_contract_code' => 'APPLYMENT_00000000001',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->ecommerce->individualContracts->preEntrustSign->app->post([
  'json' => [
    'appid'             => 'wxd678efh567h23787',
    'out_contract_code' => 'APPLYMENT_00000000001',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/ecommerce/individual-contracts/pre-entrust-sign/app')->post([
  'json' => [
    'appid'             => 'wxd678efh567h23787',
    'out_contract_code' => 'APPLYMENT_00000000001',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/ecommerce/individual-contracts/pre-entrust-sign/app']->post([
  'json' => [
    'appid'             => 'wxd678efh567h23787',
    'out_contract_code' => 'APPLYMENT_00000000001',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
pre_entrustweb_idstring预签约id

参阅 官方文档

Published on the GitHub by TheNorthMemory