| | |
| | | return ERROR; |
| | | } |
| | | } |
| | | public static void main(String[] args) { |
| | | // 调用支付宝接口 通过银行卡号获取银行信息 |
| | | String url = "https://ccdcapi.alipay.com/validateAndCacheCardInfo.json?_input_charset=utf-8&" + |
| | | "cardNo=6217003800041315031&cardBinCheck=true"; |
| | | HashMap<String, String> hashMap = new HashMap<>(); |
| | | String result = HttpRequestUtil.postRequest(url,hashMap); |
| | | System.err.println(result); |
| | | JSONObject json = JSONObject.parseObject(result); |
| | | String bank = json.getString("bank"); |
| | | String cardType = json.getString("cardType"); |
| | | System.err.println(bank); |
| | | System.err.println(cardType); |
| | | |
| | | } |
| | | // public static void main(String[] args) { |
| | | // // 调用支付宝接口 通过银行卡号获取银行信息 |
| | | // String url = "https://ccdcapi.alipay.com/validateAndCacheCardInfo.json?_input_charset=utf-8&" + |
| | | // "cardNo=6217003800041315031&cardBinCheck=true"; |
| | | // HashMap<String, String> hashMap = new HashMap<>(); |
| | | // String result = HttpRequestUtil.postRequest(url,hashMap); |
| | | // System.err.println(result); |
| | | // JSONObject json = JSONObject.parseObject(result); |
| | | // String bank = json.getString("bank"); |
| | | // String cardType = json.getString("cardType"); |
| | | // System.err.println(bank); |
| | | // System.err.println(cardType); |
| | | // |
| | | // } |
| | | |
| | | |
| | | /** |