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

@team-oozoo/oozoo-pay

v0.0.1

Published

OozooPay JavaScript SDK for browser-based crypto payments

Downloads

113

Readme

@team-oozoo/oozoo-pay

OOZOO PAY JavaScript SDK for browser-based crypto payments.

Installation

npm install @team-oozoo/oozoo-pay
# or
pnpm add @team-oozoo/oozoo-pay
# or
yarn add @team-oozoo/oozoo-pay

Quick Start

npm / ES Module

import { loadOozooPay } from '@team-oozoo/oozoo-pay';

const client = await loadOozooPay('pk_your_client_key');

await client.pay({
  price: 100,
  unit: 'usd',
  onCreateInvoice: async ({ price, chainId, tokenAddress, sender }) => {
    const res = await fetch('/api/create-invoice', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ price, chainId, tokenAddress, sender }),
    });
    const data = await res.json();
    return data.invoiceId;
  },
  successUrl: '/payment/success',
  failUrl: '/payment/fail',
});

Script Tag (Standalone)

<script src="https://unpkg.com/@team-oozoo/oozoo-pay/dist/standalone.global.js"></script>
<script>
  async function handlePay() {
    const client = await OozooPay.load('pk_your_client_key');
    await client.pay({
      price: 100,
      unit: 'usd',
      onCreateInvoice: async (params) => {
        const res = await fetch('/api/create-invoice', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify(params),
        });
        const data = await res.json();
        return data.invoiceId;
      },
      successUrl: '/payment/success',
      failUrl: '/payment/fail',
    });
  }
</script>

API

loadOozooPay(clientKey)

SDK 초기화 함수. OozooPayClient 인스턴스를 반환합니다.

| Parameter | Type | Required | Description | | ----------- | -------- | -------- | ------------------------- | | clientKey | string | Yes | API Client Key (pk_xxx) |

client.pay(options)

결제 창을 열고 사용자에게 결제를 받습니다.

await client.pay({
  price: 100,
  unit: 'usd',
  onCreateInvoice: async (params) => {
    // 가맹점 서버에서 인보이스 생성 후 invoiceId 반환
    return invoiceId;
  },
  successUrl: '/payment/success',
  failUrl: '/payment/fail',
});

| Option | Type | Required | Description | | ----------------- | ----------------------------- | -------- | ---------------------------------------------------- | | price | number | Yes | 결제 금액 | | unit | 'usd' | No | 통화 단위 (기본: 'usd') | | onCreateInvoice | (params) => Promise<string> | Yes | 인보이스 생성 콜백 | | successUrl | string | Yes | 결제 성공 시 리다이렉트 URL (?invoiceId={id} 추가) | | failUrl | string | Yes | 결제 실패/취소 시 리다이렉트 URL |

onCreateInvoice Parameters

| Field | Type | Description | | -------------- | -------- | -------------------- | | price | number | 결제 금액 | | unit | string | 통화 단위 | | chainId | string | 블록체인 네트워크 ID | | tokenAddress | string | 토큰 컨트랙트 주소 | | sender | string | 결제자 지갑 주소 |

failUrl Query Parameters

| 상황 | Query Parameters | 예시 | | ----------- | ------------------------------------- | --------------------------------------- | | 사용자 취소 | ?code=CANCELLED | /fail?code=CANCELLED | | 결제 에러 | ?code={ERROR_CODE}&message={메시지} | /fail?code=PAYMENT_FAILED&message=... |

client.transfer(options)

출금 창을 열고 사용자에게 출금합니다. pay()와 동일한 인터페이스이며, onCreateInvoice 파라미터에 sender 대신 receiver가 전달됩니다.

await client.transfer({
  price: 50,
  unit: 'usd',
  onCreateInvoice: async ({ price, chainId, tokenAddress, receiver }) => {
    const res = await fetch('/api/create-transfer', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ price, chainId, tokenAddress, receiver }),
    });
    const data = await res.json();
    return data.invoiceId;
  },
  successUrl: '/transfer/success',
  failUrl: '/transfer/fail',
});