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

rs-websdk

v1.0.6

Published

wechatpay alipay

Downloads

6

Readme

Install

$ npm install --save rs-websdk

##import

es5:
<script type="text/javascript" src="./node_modules/rs-websdk/rs-websdk.js"></script>
es6:
import RSWALLET from 'rs-websdk'

Usage

 支付demo:
        RSWALLET.pay({
            company_code: '23456saf',
            qr_code: '2332323',
            open_id: '123456783456734',
            order_no: '21345678231456',
            channel: 20001,
            amount: 0.01 * 100,
            goods_title: '每日优鲜',
            goods_desc: '描述一' + ' ' + '描述二',
            success: function (data) {
                console.log('成功回调函数')
            },
            error: function (data) {
                console.log('错误回调函数')
            }
        })
支付查询:
        RSWALLET.payInfo({
            company_code: '23456saf',
            order_no: '2332323',
            success: function (data) {
                console.log('成功回调函数')
            },
            error: function (data) {
                console.log('错误回调函数')
            }
        })

Document

支付接口

方法名

RSWALLET.pay()

请求参数

| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 | | :------ | ------------ | ---- | ------------ | ---------------------------------------- | ---------------------------------------- | | 企业编码 | company_code | 是 | String(32) | wxd678efh567hg6787 | - | | 二维码编码 | qr_code | 是 | String(32) | 1230000109 | - | | 用户标识 | open_id | 是 | String(128) | oUpF8uMuAJO_M2pxb1Q9zNjWeS6o | 支付用户的唯一的标识(微信=open_id 支付宝=user_id) | | 订单号 | order_no | 是 | String(32) | 20150806125346 | uuid生成 | | 支付类型 | channel | 是 | string(32) | 20001 | 支付类型简称: 微信扫码:20001 支付宝扫码:30001 | | 支付宝扫码: | amount | 是 | Int | 100 | 订单总金额, 单位:分 | | 商品标题 | goods_title | 是 | String( 128) | 每日优鲜 | - | | 商品描述 | goods_desc | 否 | String( 128) | 腾讯充值中心-QQ会员充值 | - | | 用户自定义参数 | optional | 否 | object | {name:'1212'} | 附加数据用户自定义的参数,将会在通知中原样返回,该字段的主要用于商户携带订单的自定义数据(false) | | 成功回调函数 | success | 是 | function | success:function(data){console.log('demo')} | 执行成功操作,data为返回值,详细见表(支付成功返回结果) | | 失败回调函数 | error | 是 | function | error:function(data){console.log('demo')} | 执行失败操作,data为返回值,详细见表(支付失败返回结果) |

支付查询结果接口

方法名

RSWALLET.payInfo()

请求参数

| 字段名 | 变量名 | 类型 | 必填 | 示例值 | 描述 | | ------ | ------------ | ---------- | ---- | ---------------------------------------- | ------------------------------ | | 企业编码 | company_code | String(32) | 是 | wxd678efh567hg6787 | - | | 订单号 | order_no | String(32) | 是 | 20150806125346 | - | | 成功回调函数 | success | function | 是 | success:function(data){console.log('demo')} | 执行成功操作,data为返回值,详细见表(支付成功返回结果) | | 失败回调函数 | error | function | 是 | error:function(data){console.log('demo')} | 执行失败操作,data为返回值,详细见表(支付失败返回结果) |

支付&支付结果查询回调

支付成功返回结果

| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 | | ----- | ----------- | ---- | ------------ | ------------------- | ------------- | | 订单号 | serial_no | 是 | String(32) | 20150806125346 | - | | 订单时间 | trade_time | 是 | String(32) | 2017-12-12 12:12 00 | - | | 收款方 | goods_title | 是 | String( 128) | 每日优鲜 | - | | 返回状态码 | res_code | 是 | String(16) | 100 | 100:成功 | | 返回信息 | res_msg | 是 | String(128) | 签名失败 | 返回信息,如非空,为成信息 |

支付失败返回结果

| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 | | ----- | -------- | ---- | ----------- | ---- | ------------------------ | | 返回状态码 | res_code | 是 | String(16) | 100 | 默认100:系统支付失败 200:用户中断操作 | | 返回信息 | res_msg | 是 | String(128) | 签名失败 | 返回信息,如非空,为错误原因 |

License

MIT © Sindre Sorhus