Showing
1 changed file
with
58 additions
and
0 deletions
1 | +package com.cjs.site.biz; | ||
2 | + | ||
3 | +import com.cjs.site.model.union.CreateQrCode; | ||
4 | +import com.cjs.site.model.union.QueryBill; | ||
5 | +import com.cjs.site.model.union.UnionResponse; | ||
6 | +import com.cjs.site.util.lang.DateEnum; | ||
7 | +import com.cjs.site.util.lang.DateUtil; | ||
8 | +import com.cjs.site.util.lang.JsonUtil; | ||
9 | +import com.cjs.site.util.union.UnionConstants; | ||
10 | +import com.cjs.site.util.union.UnionPayUtil; | ||
11 | + | ||
12 | +import java.math.BigDecimal; | ||
13 | +import java.util.HashMap; | ||
14 | +import java.util.Map; | ||
15 | + | ||
16 | +/** | ||
17 | + * Created by bruce on 2019-05-27 17:08 | ||
18 | + */ | ||
19 | +public class UnionTest { | ||
20 | + | ||
21 | + @SuppressWarnings("unchecked") | ||
22 | + public static void main(String[] args) { | ||
23 | +// CreateQrCode createQrCode = new CreateQrCode(); | ||
24 | +// createQrCode.setQrCodeId(UnionPayUtil.getQrCodeId()); | ||
25 | +// createQrCode.setBillNo(createQrCode.getQrCodeId()); | ||
26 | +// createQrCode.setTotalAmount("1"); | ||
27 | +// createQrCode.setRequestTimestamp(DateUtil.getNow()); | ||
28 | +// createQrCode.setBillDate(DateUtil.getNow(DateEnum.DATE)); | ||
29 | +// createQrCode.setSrcReserve("1565464564"); | ||
30 | +// Map<String, String> mapTypes = JsonUtil.fromJson(JsonUtil.toJson(createQrCode), Map.class); | ||
31 | +// String json = UnionPayUtil.sendPost(UnionConstants.CREATE_ORDER, mapTypes); | ||
32 | +// UnionResponse response = JsonUtil.fromJson(json, UnionResponse.class); | ||
33 | +// System.out.println(JsonUtil.toJson(response)); | ||
34 | + | ||
35 | + Map<String, String> params = new HashMap<String, String>(); | ||
36 | + params.put("mid", UnionConstants.MID); | ||
37 | + params.put("tid", UnionConstants.TID); | ||
38 | + params.put("msgType", "bills.refund"); | ||
39 | + params.put("msgSrc", "WWW.SHYTYSP.COM"); | ||
40 | + params.put("instMid", "QRPAYDEFAULT"); | ||
41 | + params.put("billNo", "5455201905301109207737023159"); | ||
42 | + params.put("billDate", "2019-05-30"); | ||
43 | + params.put("refundAmount", "690"); | ||
44 | + params.put("requestTimestamp", DateUtil.getNow()); | ||
45 | + String result = UnionPayUtil.sendPost("https://qr.chinaums.com/netpay-route-server/api/", params); | ||
46 | + System.out.println(JsonUtil.toJson(result)); | ||
47 | + | ||
48 | +// QueryBill queryBill = new QueryBill(); | ||
49 | +// queryBill.setBillDate("2019-05-30"); | ||
50 | +// queryBill.setRequestTimestamp(DateUtil.getNow()); | ||
51 | +// queryBill.setBillNo("5455201905291012314879388627"); | ||
52 | +// @SuppressWarnings("unchecked") | ||
53 | +// Map<String, String> params = JsonUtil.fromJson(JsonUtil.toJson(queryBill), Map.class); | ||
54 | +// String result = UnionPayUtil.sendPost(UnionConstants.CREATE_ORDER, params); | ||
55 | +// System.out.println(JsonUtil.toJson(result)); | ||
56 | + } | ||
57 | + | ||
58 | +} |
-
Please register or login to post a comment