×

注意!页面内容来自https://ask.dcloud.net.cn/question/165561,本站不储存任何内容,为了更好的阅读体验进行在线解析,若有广告出现,请及时反馈。若您觉得侵犯了您的利益,请通知我们进行删除,然后访问 原网页

<> .markdown-body img { display: none; } .center_image { max-width: 800px !important; text-align: center; } .show_span { margin-left: 10px; } .label_show_span { margin-left: 8px; } .new_bug_show { margin-top: 20px; } .label_show_span.markitup-box .label_show_span { font-size: 16px; margin-left: 0; } .markdown-body { margin: 20px 0; } .aw-comment-detail img { max-width: 100%; } <> .markdown-body h2 { border-bottom: none; } .markitup-box a { color: #428bca; } .ai-tag { font-size: 12px; color: #ccc; } .aw-replay-box-control .btn { line-height: normal; } .robot-quick-answer { margin-left: 10px; } .aw-thanks { color: #22ac38; } .aw-thanks .fa.fa-heart { color: #22ac38; } .aw-suspend-panel { position: fixed; top: 200px; margin-left: -70px; } .aw-suspend-panel .aw-panel-btn { padding: 10px; background: #eee; border-radius: 50%; margin-top: 10px; } .aw-suspend-panel .aw-panel-btn a:visited.aw-suspend-panel .aw-panel-btn a:focus.aw-suspend-panel .aw-panel-btn a:hover { text-decoration: none; color: #999; } .content-box { padding: 16px; overflow: auto; font-size: 14px; line-height: 1.45; border-radius: 5px; border: 1px solid #ccc; margin-bottom: 30px; overflow: hidden; } .content-inner-p { width: 50%; line-height: 2; float: left; } .content-inner-p > span:first-child { display: inline-block; width: 200px; color: #333; font-size: 14px; font-weight: bold; } .title-line { position: relative; color: #333; font-size: 14px; padding-left: 40px; margin: 20px 0; /* border-bottom: 1px #dfe6df solid; */ } .title-line::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; margin: auto 0; height: 1px; width: 100%; background-color: #dfe6df; z-index: -1; } .title-line span { padding: 0 15px; background-color: #fff; z-index: 2; } .aw-mod-body{ word-wrap: break-word; } .paid-tip { color: red; position: relative; font-size: 9px; } .paid-tip .paid-level { width: 10px !important; height: 10px !important; position: relative !important; border-radius: 50% !important; left: 0 !important; top: 0 !important; background-color: red; margin-right: 4px; padding: 2px; } .paid-tip .paid-level.paid-level-3{ background: url("//img-cdn-tc.dcloud.net.cn/static/common/sponsor-3.png") no-repeat; background-size: 100% 100%; /*background-color: #fb6f18;*/ } .paid-tip .paid-level.paid-level-2 { background-color: #ffb400; } .paid-tip .paid-level.paid-level-1{ background-color: #bbc0f0; } .paid-tip .paid-text-1{ color: #bbc0f0; } .paid-tip .paid-text-2{ color: #ffb400; } .paid-tip .paid-text-3{ color: #fb6f18; } .vote-mode a.active .fa-thumbs-down{ color: #c7254e; }
z***@sina.com
z***@sina.com
  • 发布:2023-03-18 08:30
  • 更新:2023-03-21 17:07
  • 阅读:710

使用uni-pay支付成功但不触发recharge回调函数

分类:uniCloud

初次使用微信支付。使用的是uni-pay,各种参数都设置正常。微信也能正常收费,但收费成功后不触发云端的:notify/recharge.回调函数,不能记账。

前端程序:
let payinf = {
provider: provider// 支付供应商
total_fee: money / 10//试验 //*100// 支付金额,单位分 100 = 1元
order_no: getOrderNo()// 业务系统订单号(即你自己业务系统的订单表的订单号),内部用
out_trade_no: getOutTradeNo()// 插件支付单号。微信记录的商户单号
description: "按量付费方式:" + pay.discount// 支付描述
type: "recharge"// 支付回调类型。直接用type: "recharge"代表充值方式,调用充值的回调函数,无需再添加类型
custom: {
type: "计量",
details: {
product: pay.product,
originalPrice: this.price,
discount: discount//折扣率
money: money//充值金额。
price: price//售价,折扣后的售价
tokens: tokens
}
} // 自定义数据
}

            // 发起支付  
            this.$refs.uniPay.createOrder(payinf);
2023-03-18 08:30 负责人:无 分享
已邀请:
DCloud_uniCloud_VK

DCloud_uniCloud_VK

测试支付回调需要连接云端云函数,同时需要把所有公共模块和uni-pay-co云对象上传部署

日志需要去云端查看 web控制台

z***@sina.com

z***@sina.com (作者)

谢谢。已经解决了,回调地址少了uni-pay-co

该问题目前已经被锁定无法添加新回复

<> .bdqctloud_div { padding-top: 20px; margin-bottom: 20px; border: 1px dashed #cccccc; position: relative; border-left: none; border-right: none; padding-bottom: 20px; padding-left: 20px; } .bdqctloud_left { position: relative; margin-left: 3vw; width: 500px; } .bdqctloud_articel{ position: relative; margin-left: 2vw; width: 500px; } .dcloud_news { color: #f9f9f9 !important; cursor: default; } .aw-footer .divider { margin-left: 10px; margin-right: 10px; } /*.ad_dev_right{*/ /* position: relative;*/ /* left: 580px;*/ /* top: 25px;*/ /*}*/