나는 말도 안되는 말을하지 않을 것입니다. 나는 당신에게 Java 코드를 게시 할 것입니다.
특정 코드는 다음과 같습니다.
/*결제 프로세스*// **** 컨트롤러 .java 코드는 다음과 같습니다.*/ @requestMapping (value = "/paysubmit.htm", method = requestmethod.post) public modelandview paysubmit (httpservletrequest request, httpservletresponse 응답, @requestparam map) {model> maps) ModelAndView ( "***/usm");/*** Code Block*/return model;}/*uppl.jsp 코드는 다음과 같습니다. public "-// w3c // dtml 4.01 Transitional // en"> <html> <head> <title> pay </title> <meta http-equiv = "no-cache"> <meta http-equiv = "cache-control"content = "no-cache"> <meta httpiv = "no-cache". content = "0"> </head> <body> <%request.setchAracterEncoding ( "utf-8"); 문자열 유형 = (문자열) request ( "type"); String ShtmlText = ""; if ( "1".Equals (type))) {shtmltext = payUtil.buildform ((string)) request.getAttribute ( "amt"), type);} else {shtmltext = payutil.allinpayBuildform ((string) request ( "orderno"), (string) request.getAttribute ( "amt"), type, request);} out.println (shtmltext);%> </html>/the PayUtil.java 코드는 다음과 같습니다.* // *** 페이지 데이터 생성* @param url 타사 지불에 대한 URL* @param spara* @param strmethod* @return*/public static string chuildRequest (String URL, Map <String, spara, String Strmethod) {arraylist keys = new arraylist (spara.keyset (spara.keyset) sbhtml = new StringBuffer (); sbhtml.append ( "<form id =/"paysubform/"name =/"paysubform/"action =/" + url + "/"method =/"" + strmethod + ">"); for (int i = 0; i <keys.size (); ++ i) {String name = (string) keys.get (i); String value = (string) spara.get (name); sbhtml.append ( "<input type =/"hidden/"name =/" " + name +"/"value =/" + value + "/"/>">);} sbhtml.append 세로/"value +"/"b1/"value + " +"value + "/"b1/"value +" + value + "/"b1/" value =/"suctive/"style =/"display : none;/"> </form> "); sbhtml.append ("<clupt> document.forms [/'paysubform/']. submit (); </script> "); sbhtml.tostring ();}/*** Livelihood를 예제로 복용하십시오* @param amt* @param amt* @param amt* @param amt* @param amt* @param amt. @return*/public static string buildform (문자열 orderno, string amt, string type) {// Merchant Number String MerchantId = propertiesRead.use_classLoador (). getProperty ( "cmbc.pay.id")); type string subject = propertiesread.use_classloador (). getProperty ( "cmbc.pay.type"); // "빈"; // 통화 01은 cnystring currencyType = "01"; // 픽업 페이지의 자동 전송 페이지 0 → 점프; 1 → Jump String autojump = "1"; // 점프 대기 시간 문자열 웨이티 타임 = "0"; // 메리 픽업 URL 문자열 merurl = propertiesread.use_classloador (). getProperty ( "cmbc.pay.return.page.url"); // 가맹점에 알리는 지 여부 : 0 → 통지하지 않음; 1 → 문자열에 알리지 않음 informmer = "1"; // Merchant Notification URLSTRING INFORMURL = propertiesRead.use_classLoador (). getProperty ( "cmbc.pay.return.notify.url");/*** Merchant Return 확인 : 0 → 반환 없음; 1 → return*/string quicy = "1"; // 지불 은행 문자열 merbank = "빈"; // 유형 0 → 즉시 도착; 1 → 보안 트랜잭션 문자열 트레이드 타입 = "0"; // 가맹점에서 은행을 선택할 것인지 : 0 → 기타; 1 → 판매자 측면 문자열 bankInput = "0"; // 인터페이스 버전 문자열 strinterface = "5.00"; // 비고 (선택 사항) 결제 비고 정보, 최대 길이 50String 비고 = "재충전"; // 은행 카드 유형 00 → 직불 및 대출 믹스; 01 → 순수한 직불 문자열 bankcardtype = "00"; // 제품 설명 문자열 pdtdnm = "가상 제품"; // 제품 설명 주소 주소 문자열 pdtdetailUrl = propertiesRead.use_classLoador (). getProperty ( "cmbc.pay.return.detail.url"; 유지 보수를위한 가맹점 관리 시스템 및이를 사용하여 판매자 지불을 보내고 지불 결과를 암호화하여 지불 결과를 업로드하여 MD5key = propertiesRead.use_classloador (). getProperty ( "cmbc.pay.pwd"); // 분할 암호화 소스 문자열 문자열 문자열 문자열 문자열. mac_src = "merchantid ="+merchantid+"& merorderid ="+merorderid+"& Amountsum ="+Amountsum+"& avourduce ="+gourde+"¤cyType ="+CurnencyType+"& autojump ="+autojump+"& waittime ="+waittime+"& merurl ="& merurl+"& merurl+"+merurl. + informUrl + "& 컨퍼런스 =" + 확인 + "& merbank =" + merbank + "& tradetype =" + tradetype + "& bankInput =" + bankInput + "& interface =" + strinterface + "& bankcardtype =" + bankcardtype + "& pdtdetailurl =" + pdtdetailurl + "& pdtdetailurl +" crypto.getMessageDigest (mac_src); // 요청 매개 변수를 mapmap <string, string> sparatemp = new Hashmap <string, String> (); sparatemp.put ( "merchantid", merchantid); sparatemp.put ( "merorderid", merchantid); sparatem "("Ambersum "; 주제); sparatemp.put ( "CurrencyType", CurrencyType); sparatemp.put ( "autojump", autojump); sparatemp.put ( "waittime", waittime); sparatemp.put ( "merurl", merurl); sparatemp.put ( "informer", "sparatemp.put ("informurl ","sparatem "; 확인); sparatemp.put ( "merbank", merbank); sparatemp.put ( "tradetype", tradetype); sparatemp.put ( "bankinput", bankinput); sparatemp.put ( "interface", strinterface); sparatemp.put ( "warick", sparatemp.put ( "bankcardtype", BankCardType); sparatemp.put ( "pdtdnm", pdtdnm); sparatemp.put ( "pdtdetailurl", pdtdetailurl); sparatemp.put ( "mac", mac); // 요청 문자열 shtmltext = buildRequest (propertiesRead.use_classloador (). getProperty ( "cmbc.pay.url"), sparatemp, "post"); logger.info ( "mcpay request : {}", shtmltext); return shtmltext;}/"crypto.java 코드는"/import java.messaged iss " java.security.nosuchalgorithmexception;/*** <p> 제목 : MD5 암호화 알고리즘 </p>*<p> 설명 : 가맹점은 수정할 필요가 없습니다 </p>*<p> ********* Technology Development Company 2009. </p>*/public crypto {/*** 기능 : md5 crypts*@param prs. 소스 문자열* @return 암호화 문자열 길이 32 비트*/public static string getMessageDigest (문자열 strsrc) {messageDigest md = null; String strdes = null; 최종 문자열 algo_md5 = "md5"; bt [] bt = strsrc.getBytes (); MessageDigest.getInstance (algo_md5); md.update (bt); strdes = bytes2hex (md.digest ());} catch (nosuchalgorithmexception e) {새로운 불법 스테이트 렉스크 (Md5 Algorithm은 시스템에 의해 지원되지 않습니다! ");} return strdes;}/*** 바이트 배열을 육각 문자열 (Hex String)* @param bts byte 배열로 변환* @Return* @Return 변환 된 육각 문자열 bytes2Hex (byte [] bts) {String des =" "; String tmp = null; for (int i = 0; i <bts.length; i ++) {i ++) {i ++) (integer.toHexString (bts [i] & 0xff)); if (tmp.length () == 1) {des += "0";} des += tmp;} return des;}}/*** 지불 전화 url (페이지로 돌아 가기)* @param 세션* @param request*/ @requestmapping (values = /allpayreturn*. requestMethod.post) public model and allinpayreturncall (httpservletrequest request, httpservletresponse response, @requestparam map <string, object> 맵) {modelandview model = new ModelAndView ( "***/payreturn");/*** 코드 블록*/return model;}위의 것은 귀하에게 소개 된 Java 코드를 기반으로 지불 및 재충전을 구현하는 일반적인 과정에 대한 관련 지식입니다. 나는 그것이 당신에게 도움이되기를 바랍니다. 궁금한 점이 있으면 메시지를 남겨 주시면 편집자가 제 시간에 답장을 드리겠습니다. Wulin.com 웹 사이트를 지원해 주셔서 대단히 감사합니다!