public class OpenApiSdkTest {
public static void main(String[] args) throws Exception{
String url = "https://api-mop.chinaums.com/v1/inip/corporate-wallet/wechat-pay-point/order/query";
//开发者ID
String appId = "平台分配";
//开发者秘钥
String appKey = "平台分配";
//实例化客户端
ConfigBean configBean = new ConfigBean();
OpenApiContext context = new OpenApiContext();
String request = "{\"fenOrderId\":\"\",
\"mid\":\"\",
\"serviceId\":\"\"}";
context.setStartTime(System.currentTimeMillis());
context.setRequestId(UUID.randomUUID().toString().replace("-", ""));
context.setOpenServUrl(url.split("/v")[0].concat("/"));
context.setApiServiceUrl(url);
context.setVersion(url.split("/")[3]);
context.setAppId(appId);
context.setAppKey(appKey);
context.setConfigBean(configBean);
context.setServiceCode(url.split("/v")[1].substring(1));
OpenApiCache.getCurrentToken(context);
System.out.println(HttpTransport.getInstance().doPost(context, request));
}
}
<?php
require_once "../utils/Log.php";
require_once "../utils/Tools.php";
require_once "../DefaultOpenApiClient.php";
class DataRequest
{
public $url = "";
public $serviceCode = "";
public $apiVersion ="";
public $needToken = true;
public $needDataTag = false;
public $data;
function __construct($data, $url)
{
$this->data = $data;
$apiVersion = preg_split("/[/]+/s",$url)[2];
$this->apiVersion = $apiVersion;
$serviceCode = strstr($url,$apiVersion);
$this->url = strstr($url,"/".$apiVersion,true);
$this->serviceCode = preg_replace("/^" . preg_quote($apiVersion, "/") . "/", "", $serviceCode);
}
}
class DataDemo{
public function main(){
$appid = "平台分配";
$appkey = "平台分配";
$url = "https://api-mop.chinaums.com/v1/inip/corporate-wallet/wechat-pay-point/order/query";
$data = json_encode(array("fenOrderId"=>"",
"mid"=>"",
"serviceId"=>""));
$reqiest = new DataRequest($data,$url);
$client = new DefaultOpenApiClient();
$content = $client->execute($reqiest,$appid,$appkey);
$obj = json_decode($content);
print_r($obj->errCode);
print_r($obj->errInfo);
}
}
$p = new DataDemo();
$p->main();
?>
# -*- coding: utf-8 -*-
from webapi.DefaultOpenApiClient import DefaultOpenApiClient
url = "https://api-mop.chinaums.com/v1/inip/corporate-wallet/wechat-pay-point/order/query"
class DataRequest(object):
def __init__(self, data: dict) -> dict:
self.data = data
self.serviceCode = url[len(url.split("/v")[0])+len(url.split("/")[3])+1: len(url)]
self.apiVersion = url.split("/")[3]
self.needToken = True
self.needDataTag = True
appId="平台分配"
appKey="平台分配"
client = DefaultOpenApiClient(appId, appKey)
cls = DataRequest({\"fenOrderId\":\"\",
\"mid\":\"\",
\"serviceId\":\"\"})
response = client.execute(cls)
print(str(response.get("data")))
print(response.get("errCode"))
print(response.get("errInfo"))
print(response.get("resultCode"))
print(response.get("resultInfo"))
查询支付分订单
URL
- 生产环境:
POST
https://api-mop.chinaums.com/v1/inip/corporate-wallet/wechat-pay-point/order/query - 测试环境:
POST
https://test-api-open.chinaums.com/v1/inip/corporate-wallet/wechat-pay-point/order/query
描述:查询微信支付分订单信息
ContentType:application/json
请求头
名称 | 必填 | 描述 | 示例值 |
---|---|---|---|
Authorization | 是 | 认证内容 (认证参考天满开发者中心->接入指引->平台认证方式:开发者中心) | OPEN-BODY-SIG AppId="****",Timestamp="20170606135700",Nonce="99930a147f5353dd8a8f29a5329f37e9",Signature="IPmdGHYCcfN+mto0/02zkwoUF1NT3YqPKaUykMaec1T=" |
请求参数
名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
---|---|---|---|---|---|
fenOrderId | string | 是 | 32 | 支付分订单号 银商唯一 | |
mid | string | 否 | 32 | 商户号 银商商户号 | |
serviceId | string | 否 | 32 | 服务ID |
响应示例
{
"respCode":"",
"respDesc":"",
"fenOrderId":"",
"serviceId":"",
"serviceIntroduction":"",
"state":"",
"subAppId":"",
"mid":"",
"stateDescription":"",
"postPayments":
[
{
}
],
"postDiscounts":"",
"riskFund":
{
},
"totalAmount":0,
"notifyUrl":"",
"needCollection":false,
"collection":
{
"state":"",
"totalAmount":0,
"payingAmount":0,
"paidAmount":0,
"details":
[
{
"seq":0,
"amount":0,
"paidType":"",
"paidTime":"",
"transactionId":"",
"promotionDetails":
[
{
"couponId":"",
"amount":0,
"name":"",
"scope":"",
"type":"",
"stockId":"",
"wechatpayContribute":0,
"merchantContribute":0,
"otherContribute":0,
"currency":"",
"goodDetail":
[
{
"goodsId":"",
"quantity":"",
"unitPrice":"",
"discountAmount":"",
"goodsRemark":""
}
]
}
]
}
]
},
"timeRange":
{
},
"location":
{
},
"attach":"",
"openId":"",
"subOpenId":"",
"orderId":"",
"vactInfo":
{
}
}
响应参数
名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
---|---|---|---|---|---|
respCode | string | 是 | - | 错误码 | |
respDesc | string | 否 | - | 错误信息 | |
fenOrderId | string | 是 | 32 | 支付分订单号 | |
serviceId | string | 是 | 32 | 服务ID | |
serviceIntroduction | string | 是 | 20 | 服务信息 | |
state | string | 是 | 32 | 服务订单状态 | |
subAppId | string | 否 | 32 | 子商户公众号ID | |
mid | string | 否 | 32 | 商户号 银商商户号 | |
stateDescription | string | 否 | 32 | 订单状态说明 | |
postPayments | array | 否 | - | 后付费项目 | |
postDiscounts | stringObject | 否 | - | 后付费商户优惠 | |
riskFund | object | 否 | - | 订单风险金 | |
totalAmount | number | 否 | 64 | 商户收款总金额 | |
notifyUrl | string | 否 | 256 | 商户回调地址 | |
needCollection | boolean | 否 | - | 是否需要收款 | |
collection | object | 否 | 收款信息 | ||
state | string | 是 | 20 | 收款状态 USER_PAYING:待支付 USER_PAID:已支付 | |
totalAmount | number | 否 | 64 | 总收款金额 总金额,大于等于0的数字,单位为分,只能为整数, 此参数需满足:总金额=付费项目金额之和-商户优惠项目金额之和,且小于等于订单风险金额 。未使用服务、取消订单时,该字段必须为0 | |
payingAmount | number | 否 | 64 | 待收金额 等待用户付款金额,只能为整数 | |
paidAmount | number | 否 | 64 | 已收金额 用户已付款的金额,只能为整数 | |
details | array | 否 | 收款明细列表 | ||
seq | number | 否 | 20 | 收款序号 从1开始递增 | |
amount | number | 否 | 64 | 单笔收款金额 单笔收款动作的金额,只能为整数 | |
paidType | string | 否 | 32 | 收款成功渠道 NEWTON:微信支付分 MCH:商户渠道 | |
paidTime | string | 否 | 14 | 收款成功时间 支付成功时间,支持两种格式:yyyyMMddHHmmss和yyyyMMdd 1、传入20091225091010表示2009年12月25日9点10分10秒 2、传入20091225默认时间为2009年12月25日0点0分0秒 | |
transactionId | string | 否 | 200 | 微信支付交易单号 结单交易单号,等于普通支付接口中的transaction_id,可以使用该订单号在APP支付->API列表->查询订单、申请退款。只有单据状态为USER_PAID,且收款成功渠道为支付分渠道,收款金额大于0,才会返回结单交易单号。 | |
promotionDetails | array | 否 | 优惠功能 | ||
couponId | string | 是 | 32 | 券ID | |
amount | number | 是 | 64 | 优惠券面额 | |
name | string | 否 | 64 | 优惠名称 | |
scope | string | 否 | 12 | 优惠范围 GLOBAL:全场代金券; SINGLE:单品优惠 | |
type | string | 否 | 12 | 优惠类型 枚举值:CASH:充值; NOCASH:免充值。 | |
stockId | string | 否 | 32 | 活动ID | |
wechatpayContribute | number | 否 | 64 | 微信出资 | |
merchantContribute | number | 否 | 64 | 商户出资 | |
otherContribute | number | 否 | 64 | 其他出资 | |
currency | string | 否 | - | 优惠币种 CNY:人民币,境内商户号仅支持人民币 | |
goodDetail | array | 否 | 单品列表 | ||
goodsId | string | 是 | 64 | 商品编码 | |
quantity | string | 否 | 64 | 商品数量 | |
unitPrice | string | 否 | 64 | 商品价格 | |
discountAmount | string | 否 | 64 | 商品优惠金额 | |
goodsRemark | string | 否 | 64 | 商品备注 | |
timeRange | object | 否 | - | 服务时间段 | |
location | object | 否 | - | 服务位置 | |
attach | string | 否 | 256 | 附加数据 | |
openId | string | 否 | 128 | 服务商公众号下的用户标识 | |
subOpenId | string | 否 | 128 | 子商户公众号下的用户标识 | |
orderId | string | 否 | 64 | 微信支付服务订单号 | |
vactInfo | object | 否 | 255 | 账户信息 |