PonponPay
中级8 分钟阅读

PonponPay SDK Integration Skill

给 Codex、Cursor 等 AI 编程工具使用的 PonponPay 对接 Skill。用户只需要提供项目代码和必要的 API Key / Public Key,AI 就能按项目结构自动接入官方 SDK。

这个 Skill 做什么

  • 自动识别项目是 PHP、Laravel、WordPress、Next.js、React 还是普通前端项目。
  • 服务端支付使用 PHP SDK 和 API Key Mode。
  • 浏览器支付使用 JavaScript SDK 和 Public Key Mode,避免泄露 API Key。
  • 生成订单创建、支付跳转、Webhook 验签和环境变量示例。
  • 按宿主项目现有代码风格做最小改动,并运行可用的检查命令。

发布文件

安装到 Codex

把下面目录保存到 Codex skills 目录,或把静态文件下载后放入你的团队 Skill 仓库。

mkdir -p ~/.codex/skills/ponponpay-sdk-integration
curl -o ~/.codex/skills/ponponpay-sdk-integration/SKILL.md \
  https://ponponpay.com/skills/ponponpay-sdk-integration/SKILL.md
mkdir -p ~/.codex/skills/ponponpay-sdk-integration/references
curl -o ~/.codex/skills/ponponpay-sdk-integration/references/integration-modes.md \
  https://ponponpay.com/skills/ponponpay-sdk-integration/references/integration-modes.md
curl -o ~/.codex/skills/ponponpay-sdk-integration/references/php-sdk.md \
  https://ponponpay.com/skills/ponponpay-sdk-integration/references/php-sdk.md
curl -o ~/.codex/skills/ponponpay-sdk-integration/references/js-sdk.md \
  https://ponponpay.com/skills/ponponpay-sdk-integration/references/js-sdk.md
curl -o ~/.codex/skills/ponponpay-sdk-integration/references/webhook.md \
  https://ponponpay.com/skills/ponponpay-sdk-integration/references/webhook.md

SKILL.md

---
name: ponponpay-sdk-integration
description: Use when a user wants to integrate PonponPay payments into an existing application with the official SDKs. Covers PHP API Key Mode for server-side order creation and webhooks, JavaScript Public Key Mode for browser checkout, framework detection, environment setup, safe secret handling, and validation.
---

# PonponPay SDK Integration

Use this skill when the user asks to add PonponPay payments, checkout, crypto payment acceptance, USDT/USDC payments, webhook handling, or SDK setup to an existing codebase.

## Core Rules

- Never put an API Key in browser code, committed source files, screenshots, logs, or examples.
- Use Public Key Mode for browser/frontend order creation with the JavaScript SDK.
- Use API Key Mode for server-side order creation, order queries, payment methods, merchant details, and webhook verification.
- Prefer official SDKs over hand-written API calls.
- Add .env.example entries, but never write real secrets into .env unless the user explicitly provides local-only values.
- Use the merchant backend webhook as the source of truth for marking business orders paid.

推荐接入流程

  1. 用户在目标项目里启用 Skill。
  2. 用户提供 PonponPay API Key 或 Public Key,并说明要接入的页面/订单流程。
  3. AI 根据项目类型安装 `ponponpay/php-sdk` 或 `@ponponpay/sdk`。
  4. AI 添加 `.env.example`、订单创建代码、支付跳转和 Webhook 处理。
  5. AI 运行 typecheck/build/test,并输出人工测试路径。

示例提示词

在我的 Laravel 项目里接入 PonponPay,用 PHP SDK 创建订单并添加 webhook 验签。

在这个 Next.js 项目里接入 PonponPay 前端支付,使用 Public Key Mode 和 @ponponpay/sdk。

给这个 WordPress 插件增加 PonponPay 支付入口,API Key 从后台配置读取,不要写死。

安全边界

  • API Key 只能用于服务端,不能写入浏览器代码。
  • Public Key 可以用于前端,但必须配置域名白名单。
  • 支付成功以 Webhook 验签结果为准,不以前端跳转页为准。
  • Skill 会写 `.env.example`,不会主动提交真实密钥。

Public Key · API Key · PHP SDK