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

washeng-pppay

v1.0.4

Published

``` npm i washeng-pppay ```

Downloads

0

Readme

Install

npm i washeng-pppay

Usage

引入:

import WashengPingPongPay from "washeng-pppay"

获取支付实例:

const washengppy = WashengPingPongPay.getInstance();

初始化:

onMounted(() => {
  washengppy.init({
    /**语言,不传默认英语 - de德语 en英语 es西班牙语 fr法语 it意大利语 ru俄语 zh中文 jp日语 */
    lang: "en",

    /**
     * 沙箱环境还是生产环境,默认生产
     */
    mode: "sandbox" | "production"

    /**
     * PingPong收银台在哪个元素上渲染,需创建一个对应的div用于挂载
     */
    root: "#payment-wrap",
  });
})

唤起收银台:

const handlePay = async (param: any) => {
  /**
   * 需传入token
   */
  const { getToken } = useUserInfo();

  /**
   * createPayment接收{ api, requestHeaders, requestParams }
   */
  washengppy.createPayment({
    /**
     * api: "/us/api/team/getOrder"通过这种形式传入,相当于是在本仓库中处理了api的代理,处理了跨域问题。
     * 
     * 由于跨域的问题,因此不建议ap直接传https:xxx.com/api/getxx的形式
     */
    api: "/us/api/team/getOrder",

    requestHeaders: {
      "x-authorization": getToken(),
    },

    /**
     * 订单信息,及对应的订单id或该订单的其他唯一标识字段
     * 
     * 失败、正在交易中 需重新唤起收银台:只需传merchantTransactionId
     */
    requestParams: { ...ruleForm, ...param },
  });
};

获取订单状态:

const { status, message } = await WashengPingPongPay.checkPay(merchantTransactionId: string, api: string);

获取订单详情:

const { data, err } = await WashengPingPongPay.getOrderDetail(merchantTransactionId: string, api: string);

注意

  1. 支付完成后的重定向地址,需前端提供给后端;(pingpongPay不支持本地或者本地ip调试)
  2. washengppy.init需要先加载,如果是和washengppy.createPayment写在一起的话那么需要加上 await washengppy.init
  3. 该插件打包出来的是esmodule。nuxt等node环境的不太兼容esmodule的,需要配置。nuxt配置如下:
export default defineNuxtConfig({
  build: {
    transpile: ['sample-library']
  }
})