PolyPay
Средний8 мин чтения

PolyPay SDK Integration Skill

A PolyPay integration Skill for Codex, Cursor, and other AI coding tools. Users provide the project and required API Key or Public Key, and the AI integrates the official SDK safely.

What This Skill Does

  • Detects whether the project is PHP, Laravel, WordPress, Next.js, React, or a plain frontend app.
  • Uses PHP SDK and API Key Mode for server-side payment flows.
  • Uses JavaScript SDK and Public Key Mode for browser checkout to avoid API Key exposure.
  • Generates order creation, checkout redirect, webhook verification, and env examples.
  • Keeps changes minimal and runs available validation commands.

Quick Install

This is the official PolyPay AI integration Skill. Different AI coding tools use different extension mechanisms: Codex and Claude Code can install it as a Skill, while Cursor, Windsurf, Cline, Copilot, and Gemini CLI can use the same instructions as project rules or custom instructions.

Codex

git clone https://github.com/usepolypay/polypay-sdk-integration-skill \
  ~/.codex/skills/polypay-sdk-integration

Claude Code

git clone https://github.com/usepolypay/polypay-sdk-integration-skill \
  ~/.claude/skills/polypay-sdk-integration

Cursor

git clone https://github.com/usepolypay/polypay-sdk-integration-skill \
  .cursor/polypay-sdk-integration-skill
mkdir -p .cursor/rules
cp .cursor/polypay-sdk-integration-skill/SKILL.md \
  .cursor/rules/polypay-sdk-integration.mdc

Windsurf

git clone https://github.com/usepolypay/polypay-sdk-integration-skill \
  .windsurf/polypay-sdk-integration-skill
mkdir -p .windsurf/rules
cp .windsurf/polypay-sdk-integration-skill/SKILL.md \
  .windsurf/rules/polypay-sdk-integration.md

Cline

git clone https://github.com/usepolypay/polypay-sdk-integration-skill \
  .cline/polypay-sdk-integration-skill
mkdir -p .clinerules
cp .cline/polypay-sdk-integration-skill/SKILL.md \
  .clinerules/polypay-sdk-integration.md

GitHub Copilot

git clone https://github.com/usepolypay/polypay-sdk-integration-skill \
  .github/polypay-sdk-integration-skill
mkdir -p .github/instructions
cp .github/polypay-sdk-integration-skill/SKILL.md \
  .github/instructions/polypay-sdk-integration.instructions.md

Gemini CLI

git clone https://github.com/usepolypay/polypay-sdk-integration-skill \
  .gemini/polypay-sdk-integration-skill
cat .gemini/polypay-sdk-integration-skill/SKILL.md >> GEMINI.md

View GitHub repository

Recommended Flow

  1. Enable the Skill inside the target project.
  2. Provide the PolyPay API Key or Public Key and the desired checkout/order flow.
  3. The AI installs `polypay/php-sdk` or `@polypay/sdk` based on the project.
  4. The AI adds `.env.example`, order creation, checkout redirect, and webhook handling.
  5. The AI runs typecheck/build/test and reports the manual test path.

Example Prompts

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

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

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

Security Boundaries

  • API Keys are server-side only and must never enter browser code.
  • Public Keys can be used in frontend code, but require a domain whitelist.
  • Webhook verification is the source of truth for paid status.
  • The Skill writes `.env.example` and does not commit real secrets.

JavaScript SDK · API Key · PHP SDK