微信点金计划,开通商家小票

 

对于微信支付成功之后,跳转到指定页面,微信目前已经关闭了该通道,具体通知请参看:https://pay.weixin.qq.com/index.php/public/cms/content_detail?platformType=1&lang=zh&id=121505

根据通知提示,要显示支付成功页面,必须开通其点击计划,并开通商家小票功能。

 

官方文档

1. 点金计划管理文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/goldplan/chapter3_1.shtml

2. 商家小票管理文档:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/goldplan/chapter3_2.shtml

 

第一步,配置商家小票页面链接

在服务商商户平台里面,找到点金计划,然后配置商家小票页面

小票页面对接文档:https://wx.gtimg.com/pay/download/goldplan/goldplan_product_description_v2.pdf

商家小票链接会返回三个参数,sub_mch_id,out_trade_no,check_code,

我们可以根据参数处理我们这边的页面,显示订单信息等等。

 

第二步,开发小票页面

这里附上小票代码

<%@ page language="java" pageEncoding="UTF-8" %>
<%@ page import="com.deliyun.wx.util.Const"%>
<%@ include file="include/config.jsp" %>
<!DOCTYPE html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>支付成功</title>
<jsp:include page="include/public_css.jsp"></jsp:include>
<%-- 共用的js文件top --%>
<jsp:include page="include/public_js_top.jsp"></jsp:include>
<link rel="stylesheet" type="text/css" href="<%=MAT_HOST %>/wx/pay/css/public.css"/>
<script type="text/javascript" charset="UTF-8" src="https://wx.gtimg.com/pay_h5/goldplan/js/jgoldplan-1.0.0.js"></script>
<%-- <script type="text/javascript" src="<%=MAT_HOST %>/wx/gold/vconsole.min.js"></script> --%>

<style type="text/css">
.dlpynone { padding: 35px 0; text-align: center; }
.invsuccess button { width: 120px; border-radius: 22px; }
.invsuccess button.b1 { background: #fff; color: #5485FF; border: 1px solid #5485FF; }
.invbtnd .invsuccess .invcon { font-size: 14px; }
.invbgd { padding-top: 20px; }
.invbgd .titd { font-size: 20px; }
.invbgd .inavm i { font-style: normal; }
</style>
</head>

<body>
<!--wrap-->
<div class="wrap"> 

  <!--invbgd-->
  <div class="invbgd flexcenter"> <img src="<%=MAT_HOST %>/wx/pay/images/p_pay_success.png" id="paymentBg">
    <p class="titd">支付成功</p>
    <p class="inavm"><span id="payMoney"><i style="font-size:14px">¥</i>0</span></p>
  </div>
  <!--./invbgd--> 
  <!--invbtnd-->
  <div class="invbtnd mainpad">
    <div class="invsuccess dlpynone">
      <button type="button" class="btn-primary" onclick="einvoice();">点击开票</button>
    </div>
  </div>
  <!--./invbtnd--> 
</div>
<!--./wrap-->
<input type="hidden" id="punitId" name="punitId"/>
<script type="text/javascript">

// 获取返回页面参数
// var vConsole = new VConsole(); //移动端调试工具 Vconsole方便定位问题

initData();
function initData () {
	var hp = $.TU_hrefSearch();
	hp = decodeURIComponent(decodeURIComponent(hp));
	var sub_mch_id = $.TU_getQueryParam(hp,"sub_mch_id");
	var out_trade_no = $.TU_getQueryParam(hp,"out_trade_no");
	
// 	console.log("out_trade_no=" + out_trade_no);
	
	$.tenetAjax({
		url: PATH + "/punitWS/findPayOrderById",
		data: {'payOrderId':out_trade_no},
		async: false,
		success: function(data){
			var punitId = data.punitMap.punitId;
			var realPayMoney = data.punitMap.realPayMoney;
			
			$("#payMoney").html('<i style="font-size:14px">¥</i>'+realPayMoney);
			$("#punitId").val(punitId);
		}
	})
}

function einvoice () {
  var punitId=$("#punitId").val();
  let mchData = { action: 'jumpOut', jumpOutUrl: 'https://wx.deliyun.cn/ei/wxinvoice?punitId='+punitId}
  let postData = JSON.stringify(mchData)
  parent.postMessage(postData, 'https://payapp.weixin.qq.com')
}

window.onload=function (){
    let mchData ={action:'onIframeReady',displayStyle:'SHOW_CUSTOM_PAGE'};
    let postData = JSON.stringify(mchData);
    window.parent.postMessage(postData,'https://payapp.weixin.qq.com')
}
</script>
</html>

 

特约注意:

为了保证支付后生态环境的健康发展,平台会对嵌入点金计划页面的商家小票链接(含跳转链接)进 行记录,同时会对商家小票页面内容进行安全监测。 因此,所有嵌入点金计划页面的商家小票链接(包括页面内可点击跳转的链接),均需在 HTML 的 header 中引入: 若未引用,平台会根据《点金计划须知和承诺函》中的相关规定对服务商进行功能处罚。

 

 

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

木小百99

听说打赏的人都发财了

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值