Skip to content

绑定音箱设备码牌

通过该接口登记以下信息:服务商商户号、设备sn、码牌上的url链接、收款商户号

请求参数类型描述
device_snstring设备sn
jsonobject声明请求的JSON数据结构
sub_mchidstring子商户
code_urlstring收款链接url
php
$instance->v3->payDevices->openScenarioSpeaker->_device_sn_->bind->postAsync([
  'device_sn' => 'ABCDEF',
  'json' => [
    'sub_mchid' => '1900000001',
    'code_url'  => 'URl:weixin://wxpay/s/An4baqw',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/pay-devices/open-scenario-speaker/{device_sn}/bind')->postAsync([
  'device_sn' => 'ABCDEF',
  'json' => [
    'sub_mchid' => '1900000001',
    'code_url'  => 'URl:weixin://wxpay/s/An4baqw',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/pay-devices/open-scenario-speaker/{device_sn}/bind']->postAsync([
  'device_sn' => 'ABCDEF',
  'json' => [
    'sub_mchid' => '1900000001',
    'code_url'  => 'URl:weixin://wxpay/s/An4baqw',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payDevices->openScenarioSpeaker->_device_sn_->bind->post([
  'device_sn' => 'ABCDEF',
  'json' => [
    'sub_mchid' => '1900000001',
    'code_url'  => 'URl:weixin://wxpay/s/An4baqw',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/pay-devices/open-scenario-speaker/{device_sn}/bind')->post([
  'device_sn' => 'ABCDEF',
  'json' => [
    'sub_mchid' => '1900000001',
    'code_url'  => 'URl:weixin://wxpay/s/An4baqw',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/pay-devices/open-scenario-speaker/{device_sn}/bind']->post([
  'device_sn' => 'ABCDEF',
  'json' => [
    'sub_mchid' => '1900000001',
    'code_url'  => 'URl:weixin://wxpay/s/An4baqw',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
sub_mchidstring子商户
device_snstring设备sn
bind_statestring绑定状态
OPEN_SCENARIO_SPEAKER_BIND_STATE_UNBOND | OPEN_SCENARIO_SPEAKER_BIND_STATE_BINDED 枚举值之一
code_urlstring收款链接url

参阅 官方文档

Published on the GitHub by TheNorthMemory