提交 3b3deea5 authored 作者: lihuihui's avatar lihuihui

修改支付

上级 f26410e8
...@@ -47,7 +47,6 @@ export default { ...@@ -47,7 +47,6 @@ export default {
type: 7, type: 7,
notify_url: process.env.NODE_ENV !== 'development' ? `https://alumni-frontend.ezijing.com/${this.oId}` : `http://docker-alumni-api.ezijing.com/${this.oId}` notify_url: process.env.NODE_ENV !== 'development' ? `https://alumni-frontend.ezijing.com/${this.oId}` : `http://docker-alumni-api.ezijing.com/${this.oId}`
} }
console.log(params)
api.genOrder(params, this.productId).then(response => { api.genOrder(params, this.productId).then(response => {
this.order = response this.order = response
clearInterval(this.clearTime) clearInterval(this.clearTime)
...@@ -73,29 +72,30 @@ export default { ...@@ -73,29 +72,30 @@ export default {
// 微信支付 // 微信支付
wxPay() { wxPay() {
const options = this.order.options const options = this.order.options
window.WeixinJSBridge.invoke( const url = `https://web-pay.ezijing.com/wxpay/h5?app_id=${options.appId}&prepay_id=${this.productId}&redirect_uri=${window.location.href}`
'getBrandWCPayRequest', // window.WeixinJSBridge.invoke(
{ // 'getBrandWCPayRequest',
appId: options.appId, // 公众号名称,由商户传入 // {
timeStamp: options.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 // appId: options.appId, // 公众号名称,由商户传入
nonceStr: options.nonceStr, // 支付签名随机串,不长于 32 位 // timeStamp: options.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
package: `prepay_id=${this.order.prepay_id}`, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*) // nonceStr: options.nonceStr, // 支付签名随机串,不长于 32 位
signType: options.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5' // package: `prepay_id=${this.order.prepay_id}`, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
paySign: options.paySign // 支付签名 // signType: options.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
}, // paySign: options.paySign // 支付签名
function (res) { // },
if (res.err_msg === 'get_brand_wcpay_request:ok') { // function (res) {
// 使用以上方式判断前端返回,微信团队郑重提示: // if (res.err_msg === 'get_brand_wcpay_request:ok') {
// res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 // // 使用以上方式判断前端返回,微信团队郑重提示:
this.$toast('支付成功') // // res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
// 支付成功后的回调函数 // this.$toast('支付成功')
this.$emit('success', res) // // 支付成功后的回调函数
} else { // this.$emit('success', res)
this.$toast('支付失败') // } else {
this.$emti('fail', res) // this.$toast('支付失败')
} // this.$emti('fail', res)
} // }
) // }
// )
// wx.chooseWXPay({ // wx.chooseWXPay({
// timestamp: options.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 // timestamp: options.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
// nonceStr: options.nonceStr, // 支付签名随机串,不长于 32 位 // nonceStr: options.nonceStr, // 支付签名随机串,不长于 32 位
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论