目录

NFC卡券托管数据删除

功能介绍

开发者删除托管在华为钱包服务器的NFC卡券数据。

场景描述

开发者使用NFC卡券数据托管接口将NFC数据推送到华为钱包服务器后,可使用此接口删除NFC数据。

使用约束

实现了商户服务器实现NFC刷卡能力接口中所描述的接口的开发者不需要使用此接口,使用此接口需联系华为技术支持进行开发联调。

接口原型

承载协议

HTTPS DELETE

接口方向

开发者服务器 ->华为钱包服务器

接口URL

{url}/hmspass/v1/nfccard/personalizeddata/{serviceType}/{transId}

{url}变量需要开发者根据服务器所属区域自行选择,请参见钱包服务器地址。

数据格式

请求消息:Content-Type: application/json

响应消息:Content-Type: application/json

路径参数

参数

是否必选

参数类型

描述

serviceType

是

String(32)

业务名称

transId

是

String(32)

业务序列号

请求参数

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”。

请求示例

DELETE /hmspass/v1/nfccard/personalizeddata/amber_house/amberHouse10001 HTTP/1.1
Content-Type: application/json;charset=utf-8
Authorization: Bearer ***
Accept: application/json;charset=utf-8
Host: wallet-passentrust-drcn.cloud.huawei.com.cn

响应参数

错误码为200时:

参数

参数类型

描述

returnCode

String

响应码,“0”表示成功。

returnDesc

String

响应描述,成为是为“success”。

响应示例

HTTP/1.1 200 OK
Content-Type: application/json
{
  "returnCode": "0",
  "returnDesc": "success"
}

错误码

详见接口公共定义中的公共响应码。

调用示例

public String deleteFromWalletServer(String urlSegment) {
    // Construct the http header.    
    HttpHeaders header = constructHttpHeaders();    
    // Construct the http URL.    
    String baseUrl = ConfigUtil.instants().getValue("walletServerBaseUrl");    
    String walletServerUrl = baseUrl + urlSegment;    
    HttpEntity<JSONObject> entity = new HttpEntity<>(null, header);    
    // Send the http request and get response.    
    ResponseEntity<String> exchange =REST_TEMPLATE.exchange(walletServerUrl, HttpMethod.DELETE, entity, String.class);    
    return exchange.getBody();
}