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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ethan-utils/pay-gateway

v1.4.1

Published

蓝兔支付,7Pay 等多种第三方支付的网关工具包

Downloads

266

Readme

@ethan-utils/pay-gateway

本包为多支付网关工具包,支持 7Pay、蓝兔支付(ltzf)等第三方支付平台的统一接入,适用于 Node.js 环境。

功能清单

7Pay 支付

⚠️ 警告:7Pay 支付功能封装未经过充分测试,请勿在生产环境中轻易使用。建议在正式使用前进行充分的测试验证。

  • setSevenPayApiConfig(config):初始化 7Pay 配置
  • jumpPay(params):生成跳转支付 URL
  • apiPay(params):API 接口支付(POST)
  • balanceQuery():余额查询
  • orderQuery(params):订单查询
  • refund(params):退款
  • notify.verifyPayParams(params):支付结果通知验签

蓝兔支付(ltzf)

  • setLtzfApiConfig(config):初始化 ltzf 配置
  • signParams(params):参数签名
  • notify.verifyPayParams(params):支付通知验签
  • notify.verifyRefundParams(params):退款通知验签
  • scanPay(params):扫码支付
  • h5Pay(params):H5 支付
  • h5JumpPay(params):H5 跳转支付
  • jsapiPay(params):公众号 JSAPI 支付
  • jsapiConvenientPay(params):公众号便捷版支付
  • appPay(params):APP 支付
  • miniProgramPay(params):小程序支付
  • refundOrder(params):订单退款
  • getWechatOpenid(params):获取微信 Openid
  • getPayOrder(params):查询订单
  • getRefundOrder(params):查询退款

依赖

安装

pnpm add @ethan-utils/pay-gateway

快速开始

导入方式

// 导入 ltzf 支付模块
import { ltzf } from "@ethan-utils/pay-gateway";

// 导入 7Pay 支付模块
import { sevenPay } from "@ethan-utils/pay-gateway";

// 同时导入两个模块
import { ltzf, sevenPay } from "@ethan-utils/pay-gateway";

基本用法

// 初始化 ltzf 配置
ltzf.setLtzfApiConfig({
  baseURL: "https://api.ltzf.com",
  key: "你的商户密钥",
  mch_id: "你的商户号",
  notifyUrl: "https://你的域名/notify",
  returnUrl: "https://你的域名/return",
});

// 发起扫码支付
const result = await ltzf.scanPay({
  out_trade_no: "订单号",
  total_fee: 100,
  body: "商品描述",
});

请参考 USAGE.md 获取详细用法和参数说明。


如有问题欢迎提 issue。