Skip to content
xorpay 小程序支付 demo
Branch: master
Clone or download
Latest commit 22ada78 Apr 30, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pages/index change jump appid Apr 30, 2019
utils use utf8 md5 lib Apr 14, 2019
README.md Update README.md Mar 2, 2019
app.js init project Mar 2, 2019
app.json change jump appid Apr 30, 2019
app.wxss init project Mar 2, 2019
project.config.json change jump appid Apr 30, 2019

README.md

xorpay_miniapp_demo

  • xorpay 小程序支付 demo
  • 先联系管理员开通你账号的跳转权限
  • 直接用 微信开发者工具 导入项目运行即可,记得修改自己的 aid 和 app secret

跳转 XorPay 收银台小程序 appid: wx6eeed4ca124a1abf

在 app.json 中添加:

    "navigateToMiniProgramAppIdList": [
        "wx6eeed4ca124a1abf"
    ]

小程序跳转代码:

    wx.navigateToMiniProgram({
        appId: 'wx6eeed4ca124a1abf',
        path: 'pages/index/index',
        extraData: {
            'aid': '1',  #aid
            'name': 'XorPay充值',
            'pay_type': 'jsapi',
            'price': '0.02',
            'order_id': 'm-5',
            'notify_url': 'https://abc.com/notify',
            'sign': md5.hexMD5('XorPay充值' + 'jsapi' + '0.02' + 'm-5' + 'https://abc.com/notify' + 'app secret'),
        },
        envVersion: 'develop',
        fail(res) {
            wx.showToast({
                title: res.errMsg,
                icon: 'none',
            });
        },
        success(res) {
            wx.showToast({
                title: 'ok',
                icon: 'none',
            });
        },
    });

支付成功或者取消,会跳回你的小程序,并携带参数:

支付成功

extraData: {
    status: 'success'
}

支付取消

extraData: {
    status: 'cancel'
}
You can’t perform that action at this time.