网上支付源代码

上传者: xu1164048200 | 上传时间: 2012-06-14 00:00:00 | 文件大小: 374KB | 文件类型: rar
package cn.itcast.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import cn.itcast.utils.ConfigInfo; import cn.itcast.utils.PanymentUtil; /** * 发起支付请求 * @author 传智播客 * */ public class PaymentRequest extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doPost(request, response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("GBK"); String orderid = request.getParameter("orderid");//订单号 String amount = request.getParameter("amount");//支付金额 String pd_FrpId = request.getParameter("pd_FrpId");//选择的支付银行 String p1_MerId = ConfigInfo.getValue("p1_MerId"); String keyValue = ConfigInfo.getValue("keyValue"); String merchantCallbackURL = ConfigInfo.getValue("merchantCallbackURL"); String messageType = "Buy"; // 请求命令,在线支付固定为Buy String currency = "CNY"; // 货币单位 String productDesc = ""; // 商品描述 String productCat = ""; // 商品种类 String productId = ""; // 商品ID String addressFlag = "0"; // 需要填写送货信息 0:不需要 1:需要 String sMctProperties = ""; // 商家扩展信息 String pr_NeedResponse = "0"; // 应答机制 String md5hmac = PanymentUtil.buildHmac(messageType, p1_MerId, orderid, amount, currency, productId, productCat, productDesc, merchantCallbackURL, addressFlag, sMctProperties, pd_FrpId, pr_NeedResponse, keyValue); request.setAttribute("messageType", messageType); request.setAttribute("merchantID", p1_MerId); request.setAttribute("orderId", orderid); request.setAttribute("amount", amount); request.setAttribute("currency", currency); request.setAttribute("productId", productId); request.setAttribute("productCat", productCat); request.setAttribute("productDesc", productDesc); reques

文件下载

资源详情

[{"title":"( 23 个子文件 374KB ) 网上支付源代码","children":[{"title":"payment","children":[{"title":".project <span style='color:#111;'> 1.20KB </span>","children":null,"spread":false},{"title":".mymetadata <span style='color:#111;'> 294B </span>","children":null,"spread":false},{"title":"src","children":[{"title":"merchantInfo.properties <span style='color:#111;'> 168B </span>","children":null,"spread":false},{"title":"cn","children":[{"title":"itcast","children":[{"title":"utils","children":[{"title":"PanymentUtil.java <span style='color:#111;'> 2.88KB </span>","children":null,"spread":false},{"title":"ConfigInfo.java <span style='color:#111;'> 496B </span>","children":null,"spread":false},{"title":"DigestUtil.java <span style='color:#111;'> 2.67KB </span>","children":null,"spread":false}],"spread":true},{"title":"servlet","children":[{"title":"PaymentResutlResponse.java <span style='color:#111;'> 2.81KB </span>","children":null,"spread":false},{"title":"PaymentRequest.java <span style='color:#111;'> 2.49KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"WebRoot","children":[{"title":"WEB-INF","children":[{"title":"classes","children":[{"title":"merchantInfo.properties <span style='color:#111;'> 168B </span>","children":null,"spread":false},{"title":"cn","children":[{"title":"itcast","children":[{"title":"utils","children":[{"title":"DigestUtil.class <span style='color:#111;'> 2.63KB </span>","children":null,"spread":false},{"title":"PanymentUtil.class <span style='color:#111;'> 2.19KB </span>","children":null,"spread":false},{"title":"ConfigInfo.class <span style='color:#111;'> 995B </span>","children":null,"spread":false}],"spread":true},{"title":"servlet","children":[{"title":"PaymentRequest.class <span style='color:#111;'> 2.51KB </span>","children":null,"spread":false},{"title":"PaymentResutlResponse.class <span style='color:#111;'> 3.22KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"lib","children":[{"title":"jstl.jar <span style='color:#111;'> 20.20KB </span>","children":null,"spread":false},{"title":"standard.jar <span style='color:#111;'> 384.04KB </span>","children":null,"spread":false}],"spread":true},{"title":"page","children":[{"title":"paymentResult.jsp <span style='color:#111;'> 431B </span>","children":null,"spread":false},{"title":"connection.jsp <span style='color:#111;'> 1.76KB </span>","children":null,"spread":false}],"spread":true},{"title":"web.xml <span style='color:#111;'> 1.19KB </span>","children":null,"spread":false}],"spread":true},{"title":"index.jsp <span style='color:#111;'> 3.24KB </span>","children":null,"spread":false},{"title":"META-INF","children":[{"title":"MANIFEST.MF <span style='color:#111;'> 39B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".myeclipse","children":null,"spread":false},{"title":".settings","children":[{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 330B </span>","children":null,"spread":false}],"spread":true},{"title":".classpath <span style='color:#111;'> 478B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • baird :
    正好需要研究一下,谢谢分享
    2019-07-13
  • system32 :
    不错,对初学者还是很有帮助的
    2015-03-13
  • 天云 :
    感谢,正在学习了。分享真好
    2014-06-29
  • louise666 :
    对于新手,可以使用。
    2013-09-27
  • just_for_java :
    5分不值,他的官网就有得下了
    2013-07-02

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明