public class OpenApiSdkTest {
public static void main(String[] args) throws Exception{
String url = "https://api-mop.chinaums.com/";
//开发者ID
String appId = "平台分配";
//开发者秘钥
String appKey = "平台分配";
//实例化客户端
ConfigBean configBean = new ConfigBean();
OpenApiContext context = new OpenApiContext();
String request = "";
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/";
$data = json_encode(array());
$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/"
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()
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
- 生产环境: `` https://api-mop.chinaums.com/
- 测试环境: `` https://test-api-open.chinaums.com/
描述:确认订单通知
ContentType:
请求参数
名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
---|---|---|---|---|---|
id | string | 是 | 1-36 | 通知ID 通知的唯一ID。 示例值:EV-2018022511223320873 | |
createTime | string | 是 | 1-32 | 通知创建时间 通知创建的时间,格式为yyyyMMddHHmmss(标准iso8601时间格式) 遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss.表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示北京时间2015年05月20日13点29分35秒。 示例值:2015-05-20T13:29:35+08:00 | |
eventType | string | 是 | 1-32 | 通知类型 用户确认成功通知的类型为PAYSCORE.USER_CONFIRM | |
summary | string | 是 | 1-64 | 回调摘要 回调摘要 示例值:授权成功 | |
resource | object | 是 | 通知数据 通知资源数据 json格式 | ||
serviceId | string | 是 | 32 | 服务ID 调用创单接口时提交的服务ID | |
appId | string | 是 | 32 | 应用id 调用创单接口时提交的应用ID | |
mchId | string | 是 | 32 | 商户号 调用创单接口时提交的商户号 | |
subAppId | string | 否 | 32 | 子商户公众号ID 调用创单接口时传入的子商户应用ID | |
subMchId | string | 是 | 32 | 子商户商户号 调用创单接口时传入的子商户商户号 | |
channelId | string | 否 | 32 | 渠道商商户号 调用创单接口时传入的渠道商商户号 | |
fenOrderId | string | 是 | 32 | 支付分订单号 | |
openId | string | 否 | 128 | 微信用户在商户对应AppID下的唯一标识 微信用户在商户对应AppID下的唯一标识。(传了sub_appid的情况下则只返回sub_openid) | |
subOpenId | string | 否 | 32 | 微信用户在商户对应sub_appid下的唯一标识 微信用户在商户对应sub_appid下的唯一标识。(传了sub_appid的情况下则只返回sub_openid) | |
state | string | 是 | 32 | 单据状态 表示当前单据状态。 1、DONE:服务订单完成 | |
stateDescription | string | 否 | 32 | 状态附加说明 对服务订单"进行中"状态的附加说明。 USER_CONFIRM:用户确认 | |
serviceIntroduction | string | 是 | 20 | 服务信息 用于介绍本订单所提供的服务 | |
totalAmount | string | 否 | - | 总金额 | |
postPayments | string | 否 | - | 后付费项目 后付费项目列表,最多包含100条付费项目, | |
postDiscounts | string | 否 | - | 商户优惠 商户优惠列表,最多包含5条商户优惠 | |
riskFund | string | 是 | - | 订单风险金 订单单风险金信息 | |
timeRange | string | 是 | - | 服务时间段 服务时间范围 | |
location | string | 否 | - | 服务位置 服务位置信息 | |
attach | string | 否 | 256 | 附加数据 附加数据,可作为自定义参数使用,需要先urlencode后传入,总长度不大于256字符,超出报错处理 | |
orderId | string | 否 | 64 | 微信支付服务订单号 微信支付服务订单号,每个微信支付服务订单号与商户号下对应的商户服务订单号一一对应 | |
needCollection | string | 否 | - | 是否需要收款 是否需要收款,非0元完结后返回 true:微信支付分代收款 false:无需微信支付分代收款 |
响应示例
{
}