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

@kevisual/payonner

v1.0.4

Published

Payoneer API 集成库,用于 Node.js。

Readme

Payonner

Payoneer API 集成库,用于 Node.js。

安装

pnpm install @kevisual/payonner

环境配置

.env 文件中配置以下环境变量:

PAYONNER_PROGRAM_ID=your_program_id
PAYONNER_CLIENT_KEY=your_client_key
PAYONNER_CLIENT_SECRET=your_client_secret
PAYONNER_ENVIRONMENT=sandbox  # 或 production

payonner 参考API文档

https://developer.payoneer.com/docs/mass-payouts-v4.html#/9cb9f3a03440b-create-registration-link

PayoneerClient

Payoneer API 客户端,用于获取 Access Token 和创建 Registration Link。

获取 Access Token

import { PayoneerClient } from '@kevisual/payonner';

const client = new PayoneerClient({
  programId: 'your_program_id',
  clientKey: 'your_client_key',
  clientSecret: 'your_client_secret',
  environment: 'sandbox', // 或 'production'
});

const result = await client.getAccessToken();
// 返回: { status: 200, data: { access_token: 'xxx', expires_in: 2592000, ... } }

创建 Registration Link

// 设置 Access Token
client.setAccessToken(result.data.access_token);

// 创建 Registration Link
const result = await client.createRegistrationLink('payee_id', {
  redirect_url: 'https://your-callback-url.com',
  state: 'optional-state',
});
// 返回: { status: 200, data: { registration_link: 'https://...' } }

完整示例

import { PayoneerClient } from '@kevisual/payonner';

async function main() {
  const client = new PayoneerClient({
    programId: process.env.PAYONNER_PROGRAM_ID!,
    clientKey: process.env.PAYONNER_CLIENT_KEY!,
    clientSecret: process.env.PAYONNER_CLIENT_SECRET!,
    environment: 'sandbox',
  });

  // 1. 获取 Access Token
  const tokenResult = await client.getAccessToken();
  console.log('Access Token:', tokenResult.data.access_token);

  // 2. 设置 Token
  client.setAccessToken(tokenResult.data.access_token);

  // 3. 创建 Registration Link
  const linkResult = await client.createRegistrationLink('RutenTaiwan', {
    redirect_url: 'https://example.com/callback',
  });
  console.log('Registration Link:', linkResult.data.registration_link);
}

main();

API 参考

PayoneerClient

new PayoneerClient(config: PayoneerConfig)

PayoneerConfig

| 字段 | 类型 | 必填 | 说明 | |------|------|------|------| | programId | string | 是 | Payoneer Program ID | | clientKey | string | 是 | Client Key | | clientSecret | string | 是 | Client Secret | | accessToken | string | 否 | Access Token(后续调用 API 需要) | | environment | 'sandbox' \| 'production' | 否 | 环境,默认 sandbox |

方法

getAccessToken(scope?: string): Promise<ApiResponse<TokenResponse>>

获取 OAuth Access Token。

setAccessToken(token: string): void

设置 Access Token。

createRegistrationLink(payeeId: string, params?: CreateRegistrationLinkParams): Promise<ApiResponse<RegistrationLinkResponse>>

创建 Registration Link。

getLoginUrl(): string

获取 Login URL。

getApiBaseUrl(): string

获取 API Base URL。

License

ISC