当前位置: 首页 > news >正文

云南网站建设费用/公司推广策划

云南网站建设费用,公司推广策划,西安网站建设工作室,微博推广效果怎么样网上支付一般有两种支付方式&#xff0c;一种是直接与银行对接的支付方式&#xff0c;另一种与第三方公司对接的方式i&#xff0c;比如易宝等等。第一种一般是现金流量较大的大公司使用。这里采用的是第二种。 第一步实现订单界面 <form action"servlet/PaymentSendSer…

 

网上支付一般有两种支付方式,一种是直接与银行对接的支付方式,另一种与第三方公司对接的方式i,比如易宝等等。第一种一般是现金流量较大的大公司使用。这里采用的是第二种。

第一步实现订单界面

<form action="servlet/PaymentSendServlet" method="POST">  <table align="center" width="600" border="6" cellspacing="0" cellpadding="2">  <tr>  <td align="center" colspan="4" >  <b>订单号:</b><input type="text" name="orderID">      <b>应付金额:¥</b><input type="text" name="amount" size="6"><b></b>  </td>  </tr>  <tr>  <td colspan="4"> </td>  </tr>  <tr>  <td colspan="4" >请选择在线支付银行</td>  </tr>  <tr>  <td height="25" width="24%"><input type="radio" name="pd_FrpId" value="ICBC-NET">工商银行</td>  <td height="25" width="24%"><input type="radio" name="pd_FrpId" value="CMBCHINA-NET">招商银行</td>  <td height="25" width="24%"><input type="radio" name="pd_FrpId" value="ABC-NET">农业银行</td>  <td height="25" width="28%"><input type="radio" name="pd_FrpId" value="CCB-NET">建设银行</td>  </tr>  <tr>  <td colspan="4"> </td>  </tr>  <tr>  <td colspan="4" align="center" ><input type="submit" value="  确认支付  "/></td>  </tr>  </table>  
</form>  

第二步将信息转化为易宝公司接口所要求的数据格式。

这里需要一个商家号和相对应的密钥。(这里的商户号是传智播客的一位老师的,支付时请注意)

主要代码:

request.setCharacterEncoding("GBK");  //商户编号  String accountID = "10001126856";  //密钥  String keyValue = "69cl522AV6q613Ii4W6u8K6XuW8vM1N6bFgyv769220IuYe9u37N4y7rI4Pl";  //商户接收支付成功后返回地址  String accountCallbackURL = "http://127.0.0.1:8080/zhifu/PaymentResultServlet";  String orderID = request.getParameter("orderID");        //获取订单号  String amount = request.getParameter("amount");          //获取支付金额  String accountBankID = request.getParameter("pd_FrpId"); //获取用户所选择的银行  String businessType = "Buy";  //业务类型。Buy为在线支付  String currency = "CNY";      //交易币种。CNY为人民币  String productDesc = "";      //商品描述  String productCategory = "";  //商品种类  String productID = "";        //商品ID  String addressFlag = "0";     //送货地址。0为不需要,1为需要  String accountMoreInfo = "";  //商户扩展信息  String pr_NeedResponse = "0"; //应答机制  
          String md5hmac = zhifuUtil.buildHmac(  businessType, accountID, orderID, amount, currency, productID, productCategory,  productDesc, accountCallbackURL, addressFlag, accountMoreInfo, accountBankID,  pr_NeedResponse, keyValue);  request.setAttribute("businessType", businessType);  request.setAttribute("accountID", accountID);  request.setAttribute("orderID", orderID);  request.setAttribute("amount", amount);  request.setAttribute("currency", currency);  request.setAttribute("productID", productID);  request.setAttribute("productCategory", productCategory);  request.setAttribute("productDesc", productDesc);  request.setAttribute("accountCallbackURL", accountCallbackURL);  request.setAttribute("addressFlag", addressFlag);  request.setAttribute("accountMoreInfo", accountMoreInfo);  request.setAttribute("accountBankID", accountBankID);  request.setAttribute("needResponse", pr_NeedResponse);  request.setAttribute("md5hmac", md5hmac);  

将数据处理后返回前段jsp中,并以数据隐藏的表单形式将信息提交到易宝接口(注:上述需要易宝的一个加密算法MD5+hmac)

<form action="https://www.yeepay.com/app-merchant-proxy/node" method="POST" name="yeepay">  <!-- 以下hidden中的name值为易宝支付规范的固定命名和顺序 -->  <input type='hidden' name='p0_Cmd' value="${businessType}">  <input type='hidden' name='p1_MerId' value="${accountID}">  <input type='hidden' name='p2_Order' value="${orderID}">  <input type='hidden' name='p3_Amt' value="${amount}">  <input type='hidden' name='p4_Cur' value="${currency}">  <input type='hidden' name='p5_Pid' value="${productID}">  <input type='hidden' name='p6_Pcat' value="${productCategory}">  <input type='hidden' name='p7_Pdesc' value="${productDesc}">  <input type='hidden' name='p8_Url' value="${accountCallbackURL}">  <input type='hidden' name='p9_SAF' value="${addressFlag}">  <input type='hidden' name='pa_MP' value="${accountMoreInfo}">  <input type='hidden' name='pd_FrpId' value="${accountBankID}">  <input type="hidden" name='pr_NeedResponse' value="${needResponse}">  <input type='hidden' name='hmac' value="${md5hmac}">  <input type="submit" value="确认支付"></form>  

 

点击确定按钮提交表单。进入易宝的支付接口界面:

最后完成支付后,易宝会返回一组数据,最重要的是扣款结果若返回为1:扣款成功,否则扣款失败。我们对得到的数据进行判断即可。

转载于:https://www.cnblogs.com/bingoing/p/5778970.html

http://www.lbrq.cn/news/1541701.html

相关文章:

  • 阿里云 域名 做网站/沈阳关键词seo
  • 大型网站建设公司制作网站/做一个简单的网站需要多少钱
  • vs2017js网站开发方法/新媒体营销成功案例
  • 如何做kindle电子书下载网站/最近一周新闻热点回顾
  • 海兴县网站建设公司/直通车怎么开效果最佳
  • 做网站买流量/seo搜索引擎优化工资
  • 中国日报网英文官方网站建设/北京发生大事了
  • 网站建设 广西/网站推广优化方法
  • 做网站需要的条件/江西seo推广方案
  • 靠谱做网站/电商网站定制开发
  • 投票小程序/seo关键词优化要多少钱
  • 外包建站的公司怎么做seo/公司在百度怎么推广
  • 做那种网站赚钱/产品推销
  • 如何做阿里巴巴网站/引擎优化seo怎么做
  • 网站为什么没有排名了/网站联盟营销
  • 灰色网站怎么做seo/b2b平台有哪些
  • 网站开发群/首页优化公司
  • 房产信息查询平台/seol英文啥意思
  • 医院为什么要做门户网站建设/外链推广论坛
  • 手机网站开发实例/最近热点新闻事件2023
  • 上海发布官方网/深圳谷歌seo推广
  • 手机wap网站开发教程/专业网站优化公司
  • 重庆美邦建网站/天津seo推广服务
  • 单产品网站建设/上海网站建设关键词排名
  • 河北保定网站建设/网站统计器
  • 杭州网站推广方式/网店代运营一年的费用是多少
  • 网站开发开源的手册/网络营销策划方案ppt
  • 高端网咖/福建网络seo关键词优化教程
  • 域名网站开发有意义吗/培训课程
  • 行业网站建设内容/做网站用什么编程软件
  • MySQL 8.x的性能优化文档整理
  • Vue2封装Axios
  • 23种设计模式——适配器模式(Adapter)​详解
  • 软考网工选择题节选-2
  • mysql-8.0.37-linux-glibc2.12-x86_64安装
  • 【C++】--指针与引用深入解析和对比