Skip to content

创建速住订单

创建订单后如果超过一小时用户没有进行确认订单操作

请求参数类型描述
xmlobject声明请求的XML数据结构
versionstring接口版本号
appidstring公众账号ID
mch_idstring商户号
sign_typestring签名类型
out_order_nostring商户服务订单号
service_idstring服务ID
roomstring房间
start_timestring入住时间
end_timestring预定离店时间
service_locationstring酒店
deposit_amountinteger押金金额
room_rateinteger房费
room_rate_descstring房费说明
attachstring回调数据包
cancel_rulestring取消规则标签
cancel_rule_descstring取消规则描述
cert_serial_nostring平台证书序列号
openidstring用户标识
namestring用户姓名
phonestring用户手机号
useridstring用户身份证ID
addressstring用户收货地址
securityboolean声明加载商户API证书
固定值true
php
$instance->v2->wxv->createhotelbill->postAsync([
  'xml' => [
    'version' => '1.0',
    'appid' => 'wxd678efh567hg6787',
    'mch_id' => '1230000109',
    'sign_type' => 'HMAC-SHA256',
    'out_order_no' => '1234323JKHDFE1243252',
    'service_id' => '',
    'room' => '几木双床房2间',
    'start_time' => '20091225091010',
    'end_time' => '20091225091010',
    'service_location' => '北京亦庄亚朵酒店',
    'deposit_amount' => '80000',
    'room_rate' => '20000',
    'room_rate_desc' => '共住3晚,每晚100元',
    'attach' => '',
    'cancel_rule' => '',
    'cancel_rule_desc' => '',
    'cert_serial_no' => '45233302',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'name' => '',
    'phone' => '',
    'userid' => '',
    'address' => '',
  ],
  'security' => true,
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/wxv/createhotelbill')->postAsync([
  'xml' => [
    'version' => '1.0',
    'appid' => 'wxd678efh567hg6787',
    'mch_id' => '1230000109',
    'sign_type' => 'HMAC-SHA256',
    'out_order_no' => '1234323JKHDFE1243252',
    'service_id' => '',
    'room' => '几木双床房2间',
    'start_time' => '20091225091010',
    'end_time' => '20091225091010',
    'service_location' => '北京亦庄亚朵酒店',
    'deposit_amount' => '80000',
    'room_rate' => '20000',
    'room_rate_desc' => '共住3晚,每晚100元',
    'attach' => '',
    'cancel_rule' => '',
    'cancel_rule_desc' => '',
    'cert_serial_no' => '45233302',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'name' => '',
    'phone' => '',
    'userid' => '',
    'address' => '',
  ],
  'security' => true,
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/wxv/createhotelbill']->postAsync([
  'xml' => [
    'version' => '1.0',
    'appid' => 'wxd678efh567hg6787',
    'mch_id' => '1230000109',
    'sign_type' => 'HMAC-SHA256',
    'out_order_no' => '1234323JKHDFE1243252',
    'service_id' => '',
    'room' => '几木双床房2间',
    'start_time' => '20091225091010',
    'end_time' => '20091225091010',
    'service_location' => '北京亦庄亚朵酒店',
    'deposit_amount' => '80000',
    'room_rate' => '20000',
    'room_rate_desc' => '共住3晚,每晚100元',
    'attach' => '',
    'cancel_rule' => '',
    'cancel_rule_desc' => '',
    'cert_serial_no' => '45233302',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'name' => '',
    'phone' => '',
    'userid' => '',
    'address' => '',
  ],
  'security' => true,
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->wxv->createhotelbill->post([
  'xml' => [
    'version' => '1.0',
    'appid' => 'wxd678efh567hg6787',
    'mch_id' => '1230000109',
    'sign_type' => 'HMAC-SHA256',
    'out_order_no' => '1234323JKHDFE1243252',
    'service_id' => '',
    'room' => '几木双床房2间',
    'start_time' => '20091225091010',
    'end_time' => '20091225091010',
    'service_location' => '北京亦庄亚朵酒店',
    'deposit_amount' => '80000',
    'room_rate' => '20000',
    'room_rate_desc' => '共住3晚,每晚100元',
    'attach' => '',
    'cancel_rule' => '',
    'cancel_rule_desc' => '',
    'cert_serial_no' => '45233302',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'name' => '',
    'phone' => '',
    'userid' => '',
    'address' => '',
  ],
  'security' => true,
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/wxv/createhotelbill')->post([
  'xml' => [
    'version' => '1.0',
    'appid' => 'wxd678efh567hg6787',
    'mch_id' => '1230000109',
    'sign_type' => 'HMAC-SHA256',
    'out_order_no' => '1234323JKHDFE1243252',
    'service_id' => '',
    'room' => '几木双床房2间',
    'start_time' => '20091225091010',
    'end_time' => '20091225091010',
    'service_location' => '北京亦庄亚朵酒店',
    'deposit_amount' => '80000',
    'room_rate' => '20000',
    'room_rate_desc' => '共住3晚,每晚100元',
    'attach' => '',
    'cancel_rule' => '',
    'cancel_rule_desc' => '',
    'cert_serial_no' => '45233302',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'name' => '',
    'phone' => '',
    'userid' => '',
    'address' => '',
  ],
  'security' => true,
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/wxv/createhotelbill']->post([
  'xml' => [
    'version' => '1.0',
    'appid' => 'wxd678efh567hg6787',
    'mch_id' => '1230000109',
    'sign_type' => 'HMAC-SHA256',
    'out_order_no' => '1234323JKHDFE1243252',
    'service_id' => '',
    'room' => '几木双床房2间',
    'start_time' => '20091225091010',
    'end_time' => '20091225091010',
    'service_location' => '北京亦庄亚朵酒店',
    'deposit_amount' => '80000',
    'room_rate' => '20000',
    'room_rate_desc' => '共住3晚,每晚100元',
    'attach' => '',
    'cancel_rule' => '',
    'cancel_rule_desc' => '',
    'cert_serial_no' => '45233302',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'name' => '',
    'phone' => '',
    'userid' => '',
    'address' => '',
  ],
  'security' => true,
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
return_codestring返回状态码
return_msgstring返回结果
signstring签名
nonce_strstring随机字符串
result_codestring业务结果
err_codestring错误代码
err_code_desstring错误描述
appidstring公众账号ID
mch_idstring商户号
out_order_nostring商户服务订单号
service_idstring服务ID
order_idstring微信支付服务订单号
miniprogram_appidstring小程序跳转appid
miniprogram_pathstring小程序跳转路径
miniprogram_usernamestring小程序跳转username
packagestring跳转微信侧小程序订单数据

参阅 官方文档

Published on the GitHub by TheNorthMemory