• 大小: 786KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-11
  • 语言: Java
  • 标签: 支付源码  

资源简介

1、 登陆页面填入信息 选择银行。 2、 网上找的新的ID,和密码加入到配置文件中使用 3、 点击提交后连接到易宝的支付页面。 4、 通过建行支付的连接(显示建行已经扣了0.01元) http://180.173.25.52:8080/payment/servlet/PaymentResult?p1_MerId=10001126856&r0_Cmd=Buy&r1_Code=1&r2_TrxId=517282271643704I&r3_Amt=0.01&r4_Cur=RMB&r5_Pid=&r6_Order=1212&r7_Uid=&r8_MP=&r9_BType=1&ru_Trxtime=20160902150816&ro_BankOrderId=5012366441160902&rb_BankId=CCB-NET&rp_PayDate=20160902150805&rq_CardNo=&rq_SourceFee=0.0&rq_TargetFee=0.0&hmac=999270792a82572dfb1dc636e7f430b7 5通过上面网址信息发现支付成功。 、

资源截图

代码片段和文件信息

package com.lizp.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lizp.util.ConfigInfo;
import com.lizp.util.PanymentUtil;

public class PaymentProcessing 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(“orderNumber“);//订单号
String amount = request.getParameter(“money“);//支付金额
String pd_FrpId = request.getParameter(“pd_FrpId“);//选择的支付银行
String p1_MerId = ConfigInfo.getValue(“p1_MerId“);//?
String keyValue = ConfigInfo.getValue(“keyValue“);//?
String merchantCallbackURL = ConfigInfo.getValue(“merchantCallbackURL“);//?
System.out.println(“p1_MerId++++++++“+p1_MerId+“-----keyValue------“+keyValue+“-------merchantCallbackURL------“+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);
request.setAttribute(“merchantCallbackURL“ merchantCallbackURL);
request.setAttribute(“addressFlag“ addressFlag);
request.setAttribute(“sMctProperties“ sMctProperties);
request.setAttribute(“frpId“ pd_FrpId);
request.setAttribute(“pr_NeedResponse“ pr_NeedResponse);
request.setAttribute(“hmac“ md5hmac);
System.out.println(“messageType++++++++“+messageType+“-----p1_MerId------“+p1_MerId+“-------orderid------“+orderid);
System.out.println(“amount++++++++“+amount+“-----currency------“+currency+“-------productId------“+productId);
System.out.println(“productCat++++++++“+productCat+“-----productDesc------“+productDesc+“-------merchantCallbackURL------“+merchantCallbackURL);
System.out.println(“addressFlag++++++++“+addressFlag+“-----sMctProperties------“+s

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-09-02 15:23  payment\
     文件         645  2013-06-04 10:52  payment\.classpath
     目录           0  2016-09-02 15:23  payment\.myeclipse\
     文件         294  2016-09-01 13:21  payment\.mymetadata
     文件        1750  2013-06-04 10:52  payment\.project
     目录           0  2016-09-01 13:21  payment\.settings\
     文件         500  2013-06-04 10:52  payment\.settings\.jsdtscope
     文件         629  2013-02-19 22:05  payment\.settings\org.eclipse.jdt.core.prefs
     文件         162  2013-02-19 22:05  payment\.settings\org.eclipse.jdt.ui.prefs
     文件         459  2013-06-04 10:52  payment\.settings\org.eclipse.wst.common.component
     文件         252  2013-06-04 10:52  payment\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2013-06-04 10:52  payment\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2013-06-04 10:52  payment\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2016-09-01 13:21  payment\.svn\
     文件           3  2013-02-19 23:24  payment\.svn\entries
     文件           3  2013-02-19 23:24  payment\.svn\format
     目录           0  2016-09-01 13:21  payment\.svn\pristine\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\0a\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\17\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\28\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\30\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\33\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\45\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\53\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\5a\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\6f\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\85\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\9e\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\a1\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\aa\
     目录           0  2016-09-02 15:23  payment\.svn\pristine\b2\
............此处省略52个文件信息

评论

共有 条评论