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

payingpay-payment-kit

v1.0.4

Published

A ready-to-use React payment component kit wrapping CoinflowApplePayButton, CoinflowGooglePayButton, CoinflowCardForm, and a Confirm button.

Readme

payingpay-payment-kit

对 Coinflow 支付组件的二次封装,开箱即用。提供:

| 组件 | 说明 | |---|---| | <ApplePayButton /> | 封装 CoinflowApplePayButton,自动处理全屏蒙层 | | <GooglePayButton /> | 封装 CoinflowGooglePayButton | | <CardForm ref={...} /> | 封装 CoinflowCardForm,通过 ref 暴露 tokenize() | | <ChallengeIframe /> | 封装 3ds|


安装

npm install payingpay-payment-kit

快速开始

import { useRef, useState } from "react";
import {
  ApplePayButton,
  GooglePayButton,
  CardForm,
  ChallengeIframe
} from "payingpay-payment-kit";
import type { CardFormHandle } from "payingpay-payment-kit";

export default function CheckoutPage() {
  const cardRef = useRef<CardFormHandle>(null);
  const [loading, setLoading] = useState(false);

  const handlePay = async () => {
    setLoading(true);
    // 1. 获取卡 token
    const result = await cardRef.current?.tokenize();
    if (!result) return setLoading(false);

    const { token, expMonth, expYear } = result;

    setLoading(false);
  };

  return (
    <div>
      {/* Apple Pay */}
      <ApplePayButton
        env={"prod"|| "dev"}
        queryString="YOUR_QUERY_STRING"
        onSuccess={() => alert("paid!")}
        onError={console.error}
      />

      {/* Google Pay */}
      <GooglePayButton
        env={"prod"|| "dev"}
        queryString="YOUR_QUERY_STRING"
        onSuccess={() => alert("paid!")}
        onError={console.error}
      />

      {/* Card Form */}
      <CardForm
        ref={cardRef}
        env={"prod"|| "dev"}
        queryString="YOUR_QUERY_STRING"
        theme={{ textColor: "#fff", background: "#090a0c" }}
        onLoad={() => console.log("ready")}
      />

      {/* ChallengeIframe */}
      <ChallengeIframe
          url={url}
          creq={creq}
          onSuccess={() =>  console.log("3DS passed");}
          onFailure={(event) =>  console.error("3DS failed:", event.data);}
        />

    </div>
  );
}

API

<ApplePayButton />

| Prop | 类型 | 必填 | 说明 | |---|---|---|---| | env | "prod" \| "dev" | ✅ | 环境 | | queryString | string | ✅ | 查询字符串 | | onSuccess | () => void | — | 支付成功回调 | | onError | (error) => void | — | 支付失败回调 | | style | CSSProperties | — | 外层容器样式 |

<GooglePayButton />

ApplePayButton,无 onHeightChange

<CardForm ref={...} />

| Prop | 类型 | 必填 | 说明 | |---|---|---|---| | env | "prod" \| "dev" | ✅ | 环境 | | queryString | string | ✅ | 查询字符串 | | theme | object | — | 表单主题(颜色/字体等) | | onLoad | () => void | — | 表单加载完成回调 |

<ChallengeIframe/>

| Prop | 类型 | 必填 | 说明 | |---|---|---|---| | url | string | ✅ | 地址 | | creq | string | — | creq | | onSuccess | () => void | — | 成功回调 | | onFailure | () => void | — | 失败回调 | | style | CSSProperties | — | 可选,覆盖默认全屏样式 |