pinme-uniwebpay

Implements UniwebPay payment integration in PinMe Cloudflare Worker TypeScript projects.

3.7k|274|Updated Apr 13, 2025
One-click install
npx skills add https://github.com/glitternetwork/pinme --skill pinme-uniwebpay
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pinme-uniwebpay
Source: https://github.com/glitternetwork/pinme/tree/main/skills/pinme-uniwebpay
Command: npx skills add https://github.com/glitternetwork/pinme --skill pinme-uniwebpay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @uniwebpay/sdk.

What problem does it solve?

Adding payments to a PinMe Worker project requires correctly wiring UniwebPay SDK calls, environment bindings, webhook signature verification, and currency/method constraints — mistakes like blocked webhook routes or forged fulfillment leave orders stuck or insecure.

Core Features & Use Cases

  • Payment Flow Generation: Produces Worker code for payment links, products/prices, checkout sessions, subscriptions, refunds, and customers via the @uniwebpay/sdk.
  • Webhook Integration: Enforces correct callback URL construction from WORKER_URL, raw-body signature verification with verifyWebhook, idempotency via event.id, and auth-guard exemption for the webhook route.
  • Security & Validation Rules: Prevents secret leakage, enforces integer minor-unit amounts, restricts QR methods (wechat/alipay/paynow) to SGD, and blocks fulfillment based on browser redirects.
  • Use Case: A user asks an agent to add a paid checkout to their PinMe app; the Skill generates a Worker route that creates a checkout session, persists the order in D1, and fulfills it only after a verified payment.succeeded webhook.

Quick Start

Ask the agent to add a UniwebPay checkout endpoint with webhook-based order fulfillment to your PinMe Worker project.

Frequently Asked Questions about pinme-uniwebpay

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I accept payments in a PinMe Worker with UniwebPay?▼

Install @uniwebpay/sdk, instantiate it server-side with new Uniweb(env.UNIWEB_SECRET), then create payment links for fixed amounts or checkout sessions for dynamic orders. PinMe injects the UNIWEB_* bindings at deploy time after UniwebPay is enabled.

How do I verify UniwebPay webhooks in a Cloudflare Worker?▼

Read the raw body once with request.text(), then call await verifyWebhook(rawBody, request.headers.get("uniweb-Signature"), env.UNIWEB_WEBHOOK_SECRET). Return 400 on invalid signatures and 500 on processing failures so retries work correctly.

Why are my UniwebPay webhook callbacks returning 401 or not arriving?▼

The webhook route must bypass the project's API_KEY auth guard because callbacks carry only the uniweb-Signature header. Also set webhookUrl on the payment link or product, since PinMe's wallet-level fallback discards events.

Which currencies and payment methods does UniwebPay support?▼

Card supports SGD, USD, EUR, GBP, JPY, CNY, HKD, AUD, MYR, and THB with a 10 minor-unit minimum. WeChat, Alipay, and PayNow support SGD only, and subscriptions accept card payments only.

Can I fulfill orders based on the successUrl redirect?▼

No. Browser redirects are forgeable and serve only as UX. Grant access only after verified webhook processing or another explicit server-side payment status check via payments.get.

Why is UNIWEB_SECRET missing at runtime in my Worker?▼

The bindings are injected only after UniwebPay is provisioned for the PinMe user, and existing projects must be redeployed to receive them. Never fabricate the value; tell the user to enable UniwebPay and redeploy.