普通商户创建及查询微信先享后付订单信息
创建先享后付订单
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
appid | string | 公众账号ID |
out_order_no | string | 商户服务订单号 |
service_id | string | 服务ID |
service_start_time | string | 用户下单时确认的服务开始时间 |
service_end_time | string | 用户下单时确定的预计服务结束时间 |
service_start_location | string | 开始使用服务的地点 |
service_end_location | string | 预计服务结束的地点 |
service_introduction | string | 服务信息,用于介绍本订单所提供的服务 |
fees | object[] | 后付费,描述付费项目列表 |
fee_name | string | 付费项目名称 |
fee_count | integer | 付费项目数量 |
fee_amount | integer | 付费项目总金额 |
fee_desc | string | 描述计费规则 |
discounts | object[] | 商户优惠,最多包含5条商户优惠 |
discount_name | string | 优惠名称 |
discount_desc | string | 优惠说明 |
risk_amount | integer | 订单风险金额 |
attach | string | 商户自定义说明,可存放本订单所需信息 |
need_user_confirm | boolean | 使用需用户确认订单类型 |
openid | string | 微信用户在商户对应appid下的唯一标识 |
name | string | 用户姓名 |
phone | string | 用户手机号 |
userid | string | 用户身份证ID |
address | string | 用户收货地址 |
headers | object | 声明请求的头参数 |
Wechatpay-Serial | string | 平台公钥ID/平台公钥证书序列号 |
php
$instance->v3->payscore->payafterOrders->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_order_no' => '1234323JKHDFE1243252',
'service_id' => '500001',
'service_start_time' => '',
'service_end_time' => '',
'service_start_location' => '',
'service_end_location' => '',
'service_introduction' => '',
'fees' => [[
'fee_name' => '',
'fee_count' => 0,
'fee_amount' => 0,
'fee_desc' => '',
],],
'discounts' => [[
'discount_name' => '满20减1元',
'discount_desc' => '不与其他优惠叠加',
],],
'risk_amount' => 0,
'attach' => '',
'need_user_confirm' => true,
'openid' => '',
'name' => '',
'phone' => '',
'userid' => '',
'address' => '',
],
'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/payscore/payafter-orders')->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_order_no' => '1234323JKHDFE1243252',
'service_id' => '500001',
'service_start_time' => '',
'service_end_time' => '',
'service_start_location' => '',
'service_end_location' => '',
'service_introduction' => '',
'fees' => [[
'fee_name' => '',
'fee_count' => 0,
'fee_amount' => 0,
'fee_desc' => '',
],],
'discounts' => [[
'discount_name' => '满20减1元',
'discount_desc' => '不与其他优惠叠加',
],],
'risk_amount' => 0,
'attach' => '',
'need_user_confirm' => true,
'openid' => '',
'name' => '',
'phone' => '',
'userid' => '',
'address' => '',
],
'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/payscore/payafter-orders']->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_order_no' => '1234323JKHDFE1243252',
'service_id' => '500001',
'service_start_time' => '',
'service_end_time' => '',
'service_start_location' => '',
'service_end_location' => '',
'service_introduction' => '',
'fees' => [[
'fee_name' => '',
'fee_count' => 0,
'fee_amount' => 0,
'fee_desc' => '',
],],
'discounts' => [[
'discount_name' => '满20减1元',
'discount_desc' => '不与其他优惠叠加',
],],
'risk_amount' => 0,
'attach' => '',
'need_user_confirm' => true,
'openid' => '',
'name' => '',
'phone' => '',
'userid' => '',
'address' => '',
],
'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->payscore->payafterOrders->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_order_no' => '1234323JKHDFE1243252',
'service_id' => '500001',
'service_start_time' => '',
'service_end_time' => '',
'service_start_location' => '',
'service_end_location' => '',
'service_introduction' => '',
'fees' => [[
'fee_name' => '',
'fee_count' => 0,
'fee_amount' => 0,
'fee_desc' => '',
],],
'discounts' => [[
'discount_name' => '满20减1元',
'discount_desc' => '不与其他优惠叠加',
],],
'risk_amount' => 0,
'attach' => '',
'need_user_confirm' => true,
'openid' => '',
'name' => '',
'phone' => '',
'userid' => '',
'address' => '',
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/payafter-orders')->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_order_no' => '1234323JKHDFE1243252',
'service_id' => '500001',
'service_start_time' => '',
'service_end_time' => '',
'service_start_location' => '',
'service_end_location' => '',
'service_introduction' => '',
'fees' => [[
'fee_name' => '',
'fee_count' => 0,
'fee_amount' => 0,
'fee_desc' => '',
],],
'discounts' => [[
'discount_name' => '满20减1元',
'discount_desc' => '不与其他优惠叠加',
],],
'risk_amount' => 0,
'attach' => '',
'need_user_confirm' => true,
'openid' => '',
'name' => '',
'phone' => '',
'userid' => '',
'address' => '',
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/payafter-orders']->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_order_no' => '1234323JKHDFE1243252',
'service_id' => '500001',
'service_start_time' => '',
'service_end_time' => '',
'service_start_location' => '',
'service_end_location' => '',
'service_introduction' => '',
'fees' => [[
'fee_name' => '',
'fee_count' => 0,
'fee_amount' => 0,
'fee_desc' => '',
],],
'discounts' => [[
'discount_name' => '满20减1元',
'discount_desc' => '不与其他优惠叠加',
],],
'risk_amount' => 0,
'attach' => '',
'need_user_confirm' => true,
'openid' => '',
'name' => '',
'phone' => '',
'userid' => '',
'address' => '',
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
appid | string | 公众账号ID |
mchid | string | 商户号 |
out_order_no | string | 商户服务订单号 |
service_id | string | 服务ID |
order_id | string | 微信支付服务订单号 |
miniprogram_businesstype | string | 小程序跳转businessType |
miniprogram_appid | string | 小程序跳转appid,在商户小程序跳转到微信侧小程序流程需要用到 |
miniprogram_path | string | 小程序跳转路径 |
miniprogram_username | string | 小程序跳转username,在商户APP跳转微信侧小程序流程需要用到 |
package | string | 用于跳转到微信侧小程序订单数据,跳转到微信侧小程序传入 |
参阅 官方文档
查询先享后付订单
请求参数 | 类型 | 描述 |
---|---|---|
query | object | 声明请求的查询参数 |
service_id | string | 服务ID |
out_order_no | string | 商户服务订单号 |
query_id | string | 回跳查询ID |
appid | string | 公众账号ID |
php
$instance->v3->payscore->payafterOrders->getAsync([
'query' => [
'service_id' => '',
'out_order_no' => '',
'query_id' => '',
'appid' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/payafter-orders')->getAsync([
'query' => [
'service_id' => '',
'out_order_no' => '',
'query_id' => '',
'appid' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/payafter-orders']->getAsync([
'query' => [
'service_id' => '',
'out_order_no' => '',
'query_id' => '',
'appid' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->payafterOrders->get([
'query' => [
'service_id' => '',
'out_order_no' => '',
'query_id' => '',
'appid' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/payafter-orders')->get([
'query' => [
'service_id' => '',
'out_order_no' => '',
'query_id' => '',
'appid' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/payafter-orders']->get([
'query' => [
'service_id' => '',
'out_order_no' => '',
'query_id' => '',
'appid' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
appid | string | 公众账号ID |
mchid | string | 商户号 |
out_order_no | string | 商户服务订单号 |
service_id | string | 服务ID |
state | string | CREATED | USER_ACCEPTED | FINISHED | USER_PAID | REVOKED | EXPIRED 枚举值之一 |
finish_type | integer | 标识用户订单使用情况1 | 2 枚举值之一 |
service_start_time | string | 服务开始时间 |
service_end_time | string | 服务结束时间 |
real_service_start_time | string | 实际服务开始时间 |
real_service_end_time | string | 实际服务结束时间 |
pay_succ_time | string | 支付完成时间 |
service_start_location | string | 开始使用服务的地点 |
service_end_location | string | 预计服务结束的地点 |
real_service_start_location | string | 开始使用服务的地点 |
real_service_end_location | string | 预计服务结束的地点 |
service_introduction | string | 服务信息,用于介绍本订单所提供的服务 |
fees | object[] | 后付费,描述付费项目列表 |
fee_name | string | 付费项目名称 |
fee_count | integer | 付费项目数量 |
fee_amount | integer | 付费项目总金额 |
fee_desc | string | 描述计费规则 |
discounts | object[] | 商户优惠,最多包含5条商户优惠 |
discount_name | string | 优惠名称 |
discount_amount | integer | 商品优惠金额 |
discount_desc | string | 优惠说明 |
risk_amount | integer | 订单风险金额 |
total_amount | integer | 总金额(大于等于0的数字,单位为分) |
attach | string | 商户自定义说明,可存放本订单所需信息 |
finish_ticket | string | 用于完结订单时传入,确保订单完结时数据完整 |
finish_transaction_id | string | 结单交易单号 |
pay_type | string | 支付方式MchChannelPayType 枚举值 |
参阅 官方文档