开发者可以调用该API,判断某一华为钱包客户端支持哪些功能,如门禁卡、交通卡等。开发者服务器调用此接口前应先通过手机客户端获取机型、rom版本号、华为钱包版本号等信息。此接口会返回一个功能列表及这些功能是否被支持的flag。
承载协议 | HTTPS GET |
|---|---|
接口方向 | 开发者服务器->华为钱包服务器 |
接口URL | {gatewayUrl}/hmspass/v1/{terminal}/{romVersion}/{clientVersion} {gatewayUrl}变量需要开发者根据服务器所属区域自行选择,请参见钱包网关服务器地址。 |
数据格式 | 请求消息:Content-Type: application/json 响应消息:Content-Type: application/json |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
terminal | 是 | String(64) | 手机机型 |
romVersion | 是 | String(128) | 手机rom版本号 |
clientVersion | 是 | String(64) | 钱包app的版本号,可通过钱包包名获取,包名为"com.huawei.wallet"。 |
Request Header:
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
Authorization | 是 | String | 鉴权码。获取方式详见基于OAuth 2.0开放鉴权,请使用“客户端模式”。“client_id”和“client_secret”即为开发者在华为AGC网站上创建应用后获取的“App ID”和“App key”。将获取到的“access_token”的值拼接在字符串“Bearer”之后,以空格符相隔,组成“Authorization”参数的值。 |
Content-Type | 是 | String | 固定值:“application/json;charset=utf-8”。 |
Accept | 是 | String | 固定值:“application/json;charset=utf-8”。 |
GET /hmspass/v1/LYA-TL00/LYA-TL00L 10.1.0.165(C01E164R2P8)/900103020 Content-Type: application/json;charset=utf-8 Authorization: Bearer *** Accept: application/json;charset=utf-8 Host: wallet-gateway-drcn.cloud.huawei.com.cn
错误码为200时:
参数 | 参数类型 | 描述 |
|---|---|---|
issuerAndFlag | String | 钱包在相应机型中支持的功能列表。每个功能采用“issuer#flag”模式展示,每个功能之间使用“|”符号分割。“issuer”即表示一个钱包功能,请联系华为技术支持获取各个“issuer”对应的具体含义。“flag”取值的具体含义如下: “flag”为0,表示支持该功能; “flag”为1,表示由于rom版本过低,不支持该功能; “flag”为2,表示由于client版本过低,不支持该功能; “flag”为3,表示由于rom版本和client版本都过低,不支持该功能。 |
queryAddress | String | 用于展示功能列表的页面,该页面暂未开放。 |
若某些华为钱包功能没有在响应参数中显示,则表明这些功能可被所有华为钱包客户端支持。
HTTP/1.1 200 OK
Content-Type: application/json
{
"issuerAndFlag": "key_car_entrance#0|swipe_optimization#1|1040034#2|ihg_hotel_control#3|key_car#0",
"queryAddress": "https://nfcws.wallet.hicloud.com/h5/queryruleissuer"
} public String queryIssuerAndFlag(String url, String terminal, String romVersion, String clientVerison) {
// Construct the http header.
HttpHeaders header = constructHttpHeaders();
// Construct the http URL.
String baseUrl = ConfigHelper.instants().getValue("walletGateWayBaseUrl");
String walletServerUrl = baseUrl + url + terminal + url + terminal;
// Send the http request and get response.
ResponseEntity<String> response =
REST_TEMPLATE.exchange(walletServerUrl, HttpMethod.GET, new HttpEntity(header), String);
// Return the issuer and flag by wallet server.
return response.getBody();
}