1
zyy
2 days ago 01b3fecb2d1b03861a72d53a7afea6ca557a209c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
package com.nq.pay;
 
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import org.apache.commons.codec.binary.Hex;
 
 
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;
 
public class PayUtil {
 
    public static String url = "https://order.8ae.one/";
 
 
    /**
     * 交易下单接口 通道 1
     * */
    public static String PAY_DOWN_ORDER_TOP1 = "https://payment.qeaepay.com/pay/web";
    public static String PAY_TRANSFER_ORDER_TOP1 = "https://payment.qeaepay.com/pay/transfer";
    public static String DOWN_TOKEN_TPO1 = "91a54921d9a843848c4e1bb39d90bf67";
    public static String DF_TOKEN_TOP1 = "DJIIQPJ0VISENUCGJIXIY7EXAJIW8UIO";
 
    public  static String MCH_ID_TOP1 = "400019556";
 
 
    /**
     * 交易下单接口 通道 2  wow
     * */
    public static String PAY_DOWN_ORDER_TOP4= "https://apis.xdpay168.com/client/collect/create";
    public static String PAY_TRANSFER_ORDER_TOP4 = "https://payment.qeaepay.com/pay/transfer";
    public static String DOWN_TOKEN_TPO4 = "caaf82c2beb044a8a599767d8933cdac";
    public static String DF_TOKEN_TOP4 = "2KPHYUQIA9IQTPUTQDSG7ONPCXYUBEQK";
    public  static String MCH_ID_TOP4= "400019556";
 
 
    /**
     * 交易下单接口 通道 3  dz
     * */
    public static String PAY_DOWN_ORDER_TOP3= "https://payment.dzxum.com/pay/web";
    public static String PAY_TRANSFER_ORDER_TOP3 = "https://payment.dzxum.com/pay/transfer";
    public static String DOWN_TOKEN_TPO3 = "741852f693ae4f40919fbc9090972a18";
//    public static String DOWN_TOKEN_TPO3 = "imzdixz6zub3jc2whtcw47wxhsluuy5y";
 
    public static String DF_TOKEN_TOP3 = "WLJXJB3HFE3D95P3TFV8CJXQTIGBV5P0";
 
//    public static String DF_TOKEN_TOP3 = "4AZQ1RE1ZPNJTHO0ZG3T8M6MKV16II0U";
 
    public  static String MCH_ID_TOP3= "100098228";
 
//    public  static String MCH_ID_TOP3= "100999002";
 
    /**
     * 交易下单接口 通道 2
     * */
    public static String PAY_DOWN_ORDER_TOP2= "https://pay6de1c7.wowpayglb.com/pay/web";
    public static String PAY_TRANSFER_ORDER_TOP2 = "https://pay6de1c7.wowpayglb.com/pay/transfer";
    public static String DOWN_TOKEN_TPO2= "7e33aae9032a4bc5bdfaf2f8fb790c32";
//    public static String DOWN_TOKEN_TPO2= "TZLMQ1QWJCUSFLH02LAYRZBJ1WK7IHSG";
 
    public static String DF_TOKEN_TOP2 = "2KPHYUQIA9IQTPUTQDSG7ONPCXYUBEQK";
 
//    public static String DF_TOKEN_TOP2 = "MZBG89MDIBEDWJOJQYEZVSNP8EEVMSPM";
    public  static String MCH_ID_TOP2= "777777388";
 
//    public  static String MCH_ID_TOP2= "222887002";
    public static String appid = "658563675da8a";
 
//    public static String DOWN_TOKEN = "91a54921d9a843848c4e1bb39d90bf67";
 
 
 
    public static String ascii(Map<String, Object> param, String token, String separator, Boolean empty,String tokenType) {
        StringBuffer sb = new StringBuffer();
        List<String> keys = keyAscii(param);
        for (String key : keys) {
            if (empty) {
                sb.append(key).append("=").append(param.get(key)).append(separator);
            } else {
                if (!ObjectUtils.isEmpty(param.get(key))) {
                    sb.append(key).append("=").append(param.get(key)).append(separator);
                }
            }
        }
        if (!ObjectUtils.isEmpty(tokenType)) {
            sb.append(tokenType).append("=").append(token);
        } else {
            sb = sb.deleteCharAt(sb.length() - 1);
            sb.append(token);
        }
        return sb.toString();
    }
 
 
    public static List<String> keyAscii(Map<String, Object> parm) {
        Collection<String> keySet = parm.keySet();
        List<String> list = new ArrayList<>(keySet);
        Collections.sort(list);
        return list;
    }
 
 
    public static String sha256(String str) {
        MessageDigest messageDigest;
        String encdeStr = "";
        try {
            messageDigest = MessageDigest.getInstance("SHA-256");
            byte[] hash = messageDigest.digest(str.getBytes("UTF-8"));
            encdeStr = Hex.encodeHexString(hash);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return encdeStr;
    }
 
//    public static String getMd5Spring(String key) {
//        return md5DigestAsHex(key.getBytes());
//    }
//
//    private static String md5DigestAsHex(byte[] bytes) {
//        char[] hexDigest = digestAsHexChars("MD5", bytes);
//        return new String(hexDigest);
//    }
//
//    private static char[] digestAsHexChars(String algorithm, byte[] bytes) {
//        byte[] digest = digest(algorithm, bytes);
//        return encodeHex(digest);
//    }
//
//    private static char[] encodeHex(byte[] bytes) {
//        char[] chars = new char[32];
//        for (int i = 0; i < chars.length; i = i + 2) {
//            byte b = bytes[i / 2];
//            chars[i] = HEX_CHARS[(b >>> 0x4) & 0xf];
//            chars[i + 1] = HEX_CHARS[b & 0xf];
//        }
//        return chars;
//    }
 
    private static byte[] digest(String algorithm, byte[] bytes) {
        return getDigest(algorithm).digest(bytes);
    }
 
    private static MessageDigest getDigest(String algorithm) {
        try {
            return MessageDigest.getInstance(algorithm);
        } catch (NoSuchAlgorithmException ex) {
            throw new IllegalStateException("Could not find MessageDigest with algorithm \"" + algorithm + "\"", ex);
        }
 
 
    }
}