npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@femessage/payment

v2.0.0

Published

说明:

Downloads

11

Readme

Introduce

说明:

  1. 基于 vant Toast 以及 Actionsheet 组件,请确保已经引入 Toast 以及 Actionsheet;如果指定了某种支付方式,则不需要 Actionsheet。
   Vue.use(Toast)
   Vue.use(Actionsheet)
  1. 组件内部需要根据渠道请求对应的支付参数(相对路径),所以需要传入 this.$axios 进行请求以及 baseUrl。
  2. 当前已支付支付渠道有微信 JSAPI 支付以及银联 GATEWAY 支付。

Install

// Step1 安装
yarn add @femessage/payment

// Step2 使用
<template>
    <button @click="pay">支付</button>
</template>

<script>
import paymentRequest from '@femessage/payment'

export default {
  methods: {
    pay() {
      paymentRequest({
        specifyPayWay: '指定支付方式的code',
        tenantId: '租户id',
        tranNo: '交易流水号',
        orderId: '订单id',
        payChannel: {
          JSAPI: {
            openid: 'openid',
            signature: '签名'
          },
          GATEWAY: {
            terminalType: '类型',
            signature: '签名'
          }
        },
        paySysAccessAuthCode: '系统编码',
        paySysBizTypeCode: '业务编码',
        payApplicationCode: '支付应用编码',
        request: this.$axios,
        applyDeductionAmount: '支付金额',
        callback: {
          success(res) {
            alert('success回调')
          },
          cancel(e) {
            alert('cancel回调')
          },
          fail(e) {
            alert('fail回调')
          }
        }
      })
    }
  }
}
</script>

Props

| 参数 | 说明 | 类型 | | -------------------- | ----------------------------- | ------------- | | specifyPayWay | 指定支付方式的 code | String | | tenantId | 租户 ID | String,Number | | tranNo | 交易流水号 | String,Number | | orderId | 订单 ID | String,Number | | paySysAccessAuthCode | 系统编码 | String,Number | | paySysBizTypeCode | 业务编码 | String,Number | | payApplicationCode | 支付应用编码 | String,Number | | request | ajax 请求库,传入 this.$axios | | | baseUrl | 请求的 baseUrl | | | applyDeductionAmount | 支付金额 | String,Number | | payChannel | 支付渠道以及渠道所需参数 | Object | | callback | 回调参数 | Object |

回调函数:

callback: {
    success(res) {
        alert("success回调")
    },
    cancel(e) {
        alert("cancel回调")
    },
    fail(e) {
        alert("fail回调")
    }
}

支付渠道

payChannel: {
    //微信jspai支付
    JSAPI: {
        openid: 'openid',
        signature: '签名'
    },
    //银联网关支付
    GATEWAY: {
        terminalType: 'PC', //pc端传入'PC',移动端传入'APP'
        signature:'签名'
    }
}

指定支付方式

specifyPayWay:来源于支付渠道的 key 值,当前可选JSAPI或者GATEWAY,若传入值则不会弹出支付列表,而是直接请求支付