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 🙏

© 2026 – Pkg Stats / Ryan Hefner

colawallexpay

v0.0.8

Published

集成ColawallexPay支付库

Readme

ColawallexPay

ColawallexPay 支付 SDK 前端插件,帮助商户快速集成信用卡支付。

支持两种支付模式:

  • 直接跳转 — 提供 casher_link,在新窗口打开支付页面
  • 弹窗表单 — 弹出对话框,用户填写卡号/有效期/CVV,校验后自动提交

安装

CDN

<script src="https://wallexpay.oss-cn-hangzhou.aliyuncs.com/public/colawallexpay.min.js"></script>

npm

npm install colawallexpay

使用

浏览器(CDN)

const pay = new ColawallexPay({
  casher_link: '',         // 可选:支付跳转链接
  gateway: 'https://...',  // 必填:支付网关 URL
  data: '...',             // 必填:加密支付数据(后端返回)
  payment_id: '...',       // 必填:系统订单号
  onErr: function(code, msg) {
    console.log(code, msg)
  }
})

pay.createFormPayment_v1()

Node.js / Webpack

import ColawallexPay from 'colawallexpay'

const pay = new ColawallexPay({ /* ... */ })
pay.createFormPayment_v1()

API

new ColawallexPay(options)

| 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | casher_link | string | 否 | 支付跳转 URL。提供则 window.open;不提供则弹出表单 | | gateway | string | 是* | 支付网关地址(表单提交目标) | | data | string | 是* | 加密支付数据,作为隐藏字段提交 | | payment_id | string | 是* | 系统订单号 | | onErr | function(code, msg) | 否 | 错误回调函数 |

* 当未提供 casher_link 时,gatewaydatapayment_id 为必填。

colawallexPay.createFormPayment_v1()

启动支付流程:

  • casher_link → 直接打开链接
  • casher_link → 弹出信用卡填写表单

colawallexPay.on(event, fn)

注册事件监听器,支持链式调用。

pay.on('error', function(code, msg) {
  // 处理错误
})

colawallexPay.emit(event, ...args)

手动触发事件。


错误码

| 错误码 | 含义 | |--------|------| | LACK_PARAM | 缺少必要参数 |


注意事项

  • 确保使用的是最新版本,可通过 npm view colawallexpay version 检查
  • CDN 引入时,ColawallexPay 是全局变量;npm 引入时请使用 importrequire()
  • 同一页面多次 new ColawallexPay() 不会重复注入 CSS

License

MIT