in-skill-stripe-payments-demo

Stripe in-skill payments demo: gate premium behavior behind a one-time checkout, verify via Stripe API and local receipt. Use when demonstrating or implementing paid skills, in-skill payment, Stripe payment gate, or verify payment before premium features. Trigger for: "in-skill Stripe payments", "paid skill", "skill payment demo", "Stripe checkout gate", "verify payment before premium".

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "in-skill-stripe-payments-demo" with this command: npx skills add divyn/in-skill-stripe-payment

Skill payments demo (placeholder)

This repository is a minimal template for gating a skill behind a one-time Stripe payment. The “premium” behavior is intentionally a placeholder: after payment verification, your product code would run here.

What ships in this demo

  • scripts/check_payment.py — Stripe Checkout Session lookup by customer email, minimum amount check (MIN_AMOUNT_CENTS in code), optional Payment Link URL from the environment, and a local receipt cache on disk (see below).
  • requirements.txt — pins stripe>=7.0.0 (Stripe’s Python SDK). Install before importing check_payment.
  • This SKILL.md — agent instructions: always verify payment first, then proceed to placeholder premium steps.

Environment variables (sensitive — host / deployment only)

These are read by scripts/check_payment.py via os.environ. Do not ask end users for STRIPE_SECRET_KEY. Configure them in the environment where the agent or skill host runs (or a local .env for development — see .env.example; never commit secrets).

VariableRequired?Purpose
STRIPE_SECRET_KEYYesStripe secret API key (sk_test_... or sk_live_...). Without it, verification against Stripe fails.
STRIPE_PAYMENT_LINK_URLNoFull URL of a Stripe Payment Link. If unset, get_payment_link() returns an obvious placeholder string.

Dependencies and install

  1. Use Python 3 with pip available.
  2. From this skill’s repository root, install the declared dependency:
pip install -r requirements.txt

That installs stripe>=7.0.0. Calls to Stripe’s API require outbound network access from the runtime.

Local disk: receipt cache

After a successful complete_payment_verification, the script writes a small JSON file (with a checksum) to:

~/.skill-payment-demo-receipt

On later runs, check_payment_status() reads that file to skip re-querying Stripe when the receipt is still valid. Users and publishers should treat this path as agent-local state (not shared across machines). Production skills may replace this with different storage or user binding.


Step 1 — Payment gate (mandatory first)

The agent must run the payment check before any premium behavior.

1a. Import and check existing receipt

import sys
sys.path.insert(0, "<SKILL_DIR>/scripts")
from check_payment import (
    check_payment_status,
    get_payment_link,
    complete_payment_verification,
)

if check_payment_status():
    print("Payment verified — premium section allowed.")
else:
    print("Payment required for premium features.")

Replace <SKILL_DIR> with this skill’s directory on disk.

If check_payment_status() is True, skip to Step 2.

1b. Not paid — show Payment Link

link = get_payment_link()
print("Complete the one-time payment to unlock premium features:")
print(f"  → {link}")
print()
print("After paying, reply with the email address you used at checkout.")

Stop and wait for the user’s email.

1c. Verify by email

email = "<user's email>"
if complete_payment_verification(email):
    print("Payment verified.")
else:
    print("No matching completed payment for that email. Check the address and try again.")
    # Do not run premium logic

If verification fails, do not proceed. If STRIPE_SECRET_KEY is missing or misconfigured, treat it as a server-side error (do not ask the user for the secret).


Step 2 — Placeholder premium behavior

After payment is verified (receipt or successful complete_payment_verification), respond with a short confirmation, for example:

Premium area unlocked (demo). Replace this section in SKILL.md with your real skill: API calls, tools, or scripts.

There is no streaming or external data feed in this repo by design.


Error handling

  • Not paid / verification failed: Show the link again; do not run premium logic.
  • Stripe errors: Say verification is temporarily unavailable; retry later.
  • CLI test: python scripts/check_payment.py (requires STRIPE_SECRET_KEY; optional STRIPE_PAYMENT_LINK_URL).

Security notes for publishers

  • Never commit STRIPE_SECRET_KEY or live customer data; use environment variables and a .gitignore for local secrets.
  • Adjust MIN_AMOUNT_CENTS in check_payment.py to match your Payment Link price.
  • The receipt cache path and behavior are documented under Local disk: receipt cache above.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated