Skip to content

服务商子商户开发配置新增支付目录/新增对应APPID关联

服务商给特约子商户配置支付目录;每个商户最多配置5个支付目录。

请求参数类型描述
securitytrue声明加载商户API证书
noncelesstrue声明请求的XML无随机字符串参数
xmlobject声明请求的XML数据结构
appidstring公众账号ID
mch_idstring商户号
sub_mch_idstring子商户号
sub_appidstring关联APPID
jsapi_pathstring授权目录
php
$instance->v2->secapi->mch->addsubdevconfig->postAsync([
  'security' => true,
  'nonceless' => true,
  'xml' => [
    'appid'      => 'wx8888888888888888',
    'mch_id'     => '1900000109',
    'sub_mch_id' => '1900000100',
    'sub_appid'  => 'wx931386123456789e',
    'jsapi_path' => 'http://www.qq.com/wechat/',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/secapi/mch/addsubdevconfig')->postAsync([
  'security' => true,
  'nonceless' => true,
  'xml' => [
    'appid'      => 'wx8888888888888888',
    'mch_id'     => '1900000109',
    'sub_mch_id' => '1900000100',
    'sub_appid'  => 'wx931386123456789e',
    'jsapi_path' => 'http://www.qq.com/wechat/',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/secapi/mch/addsubdevconfig']->postAsync([
  'security' => true,
  'nonceless' => true,
  'xml' => [
    'appid'      => 'wx8888888888888888',
    'mch_id'     => '1900000109',
    'sub_mch_id' => '1900000100',
    'sub_appid'  => 'wx931386123456789e',
    'jsapi_path' => 'http://www.qq.com/wechat/',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->secapi->mch->addsubdevconfig->post([
  'security' => true,
  'nonceless' => true,
  'xml' => [
    'appid'      => 'wx8888888888888888',
    'mch_id'     => '1900000109',
    'sub_mch_id' => '1900000100',
    'sub_appid'  => 'wx931386123456789e',
    'jsapi_path' => 'http://www.qq.com/wechat/',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/secapi/mch/addsubdevconfig')->post([
  'security' => true,
  'nonceless' => true,
  'xml' => [
    'appid'      => 'wx8888888888888888',
    'mch_id'     => '1900000109',
    'sub_mch_id' => '1900000100',
    'sub_appid'  => 'wx931386123456789e',
    'jsapi_path' => 'http://www.qq.com/wechat/',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/secapi/mch/addsubdevconfig']->post([
  'security' => true,
  'nonceless' => true,
  'xml' => [
    'appid'      => 'wx8888888888888888',
    'mch_id'     => '1900000109',
    'sub_mch_id' => '1900000100',
    'sub_appid'  => 'wx931386123456789e',
    'jsapi_path' => 'http://www.qq.com/wechat/',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
return_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
err_codestring错误代码
err_code_desstring错误代码描述
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
signstring签名

参阅 官方文档

Published on the GitHub by TheNorthMemory