平台账户退款
服务 ID | zjrcuoip.platform.account.refund |
---|
VERSION | 1.0.0 |
服务详细描述
对已支付的订单进行退款操作。
示例代码
PlatRefundDemoOp.java
@Service
public class PlatRefundDemoOp {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void execute() {
INetTools netTools = NetToolsHttpFactory.getHttpInstance();
OipReqBean oipReqBean = new OipReqBean();
oipReqBean.setAppId("应用id");
oipReqBean.setDlpId("开发者id");
oipReqBean.setProdId("产品id");
oipReqBean.setMethod("zjrcuoip.platform.account.refund");
oipReqBean.setVersion("1.0.0");
SimpleDateFormat sfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
oipReqBean.setTimestamp(sfs.format(new Date()));
NetReqConfBean netReqConfBean = new NetReqConfBean();
netReqConfBean.setAppPrivateKey("应用私钥");
netReqConfBean.setNetUrl("请求地址");
netReqConfBean.setPublicKey("开发者公钥");
Date d=new Date();
SimpleDateFormat sf=new SimpleDateFormat("yyyyMMddHHmmss");
Map map =new HashMap();
map.put("appTp", "03");
map.put("txTp", "15");
map.put("purpPrtry", "A1207013");
map.put("merchId", "123456");
map.put("bizId", "123456");
map.put("refundBizid", "123456");
map.put("orderId", "123456");
map.put("bizTime", "20220919153912");
map.put("totalAmount", "1.00");
map.put("userIp", "127.0.0.1");
String bizContent = JSON.toJSONString(map);
oipReqBean.setBizContent(bizContent);
OipRspBean oipRspBean = netTools.execute(oipReqBean, netReqConfBean);
if (oipRspBean.isSuccess()) {
String bizJson = oipRspBean.getBizContent();
if (StringUtils.isNotBlank(bizJson)) {
Map bizData = JSON.parseObject(bizJson, Map.class);
System.out.println(bizData);
}
}
}
}
公共报文
[点击查看公共报文]
业务输入项
序号 | key | 数据项名称 | 类型 | 长度 | 是否必输 | 数据项说明 |
---|
1 | appTp | 应用类型 | String | 2 | 是 | 01-电脑端 WEB 接入,02-POS 接入,03-移动应用接入,04-移动端 H5 接入,默认 03 |
2 | txTp | 交易类型 | String | 2 | 是 | 15-退款 |
3 | purpPrtry | 业务种类 | String | 8 | 是 | A1207001-医疗退款,A1207002-社保缴费退款,A1207003-台州一卡通退款,A1207008-公交云退款,A1207010-协议支付退款,A1207012-主扫信用账户支付退款,A1207013-平台账户退款,默认 A1207013 |
4 | merchId | 商户号 | String | 32 | 是 | 支付系统分配,且各环境有可能不一样 |
5 | bizId | 业务流水号 | String | 64 | 是 | 支持数字、英文字母、下划线,且不能重复 |
6 | refundBizid | 原业务流水号 | String | 64 | 是 | 原消费交易的请求参数 bizId. refundBizid 和 orderId 二选一,如果都传了,以 refundBizid 为准。 |
7 | orderId | 原订单号 | String | 32 | 是 | 原消费交易,由支付系统生成的订单号 orderId。 refundBizid 和 orderId 二选一,如果都传了,以 refundBizid 为准。 |
8 | bizTime | 交易时间 | String | 14 | 是 | 当前退款交易发起时间,格式 yyyyMMddHHmmss |
9 | productId | 原商品编号 | String | 64 | 否 | |
10 | totalAmount | 退款总金额 | String | 12 | 是 | 单位元,保留两位小数。退款总金额=优惠金额+退款金额。 |
11 | promAmount | 优惠金额 | String | 12 | 否 | 营销部分退款金额,单位元,保留两位小数。 |
12 | bizAmount | 退款金额 | String | 12 | 否 | 退客户金额,单位元,保留两位小数。 |
13 | bizRemark | 备注信息 | String | 255 | 否 | 备注信息 |
14 | userIp | 用户外网 IP | String | 15 | 是 | 交易发起当前所使用机器的 IP |
15 | attach | 附加信息 | String | 127 | 否 | 在退款结果异步通知和交易结果查询接口中原样返回,具体内容可自定义,但请勿包含如"、\、/、\b、\f、\n、\r、\t 等特殊字符 |
16 | information | 医保附加信息 | String | 4096 | 否 | 医保组合交易相关字段 |
业务输出项
序号 | key | 数据项名称 | 类型 | 长度 | 是否非空 | 数据项说明 |
---|
1 | bizId | 业务流水号 | String | 64 | 是 | 请求的 bizid 原样返回。 |
2 | orderId | 订单号 | String | 32 | 是 | 支付系统针对这笔退款生成的订单号。 |
响应码