agentleFS
28672032962867203296/hermes-agent/skills/productivity/payment-integration/SKILL.md

payment-integration

Skill0 starsChanged 4 months agoMITView on GitHub

支付集成:Stripe/支付宝/微信支付、Webhook、退款、对账.

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use Problem-Solving Techniques, ads-management and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • truongtv22Skill

    Problem-Solving Techniques

    Apply systematic problem-solving techniques for complexity spirals (simplification cascades), innovation blocks (collision-zone thinking), recurring patterns (meta-pattern recognition), assumption constraints (inversion exercise), scale uncertainty (scale game), and dispatch when stuck. Techniques derived from Microsoft Amplifier project patterns adapted for immediate application.

    Also in 6 projects that use this

  • OpenAnalystIncSkill

    ads-management

    Activate for paid advertising campaigns on Google Ads, Meta Ads, LinkedIn Ads, TikTok Ads. Includes ad copywriting, audience targeting, budget optimization, A/B testing, and ROAS tracking. Used by ads-specialist and campaign-manager agents.

    Also in 3 projects that use this

  • OpenAnalystIncSkill

    ai-artist

    Write and optimize prompts for AI-generated outcomes across text and image models. Use when crafting prompts for LLMs (Claude, GPT, Gemini), image generators (Midjourney, DALL-E, Stable Diffusion, Imagen, Flux), or video generators (Veo, Runway). Covers prompt structure, style keywords, negative prompts, chain-of-thought, few-shot examples, iterative refinement, and domain-specific patterns for marketing, code, and creative writing.

    Also in 3 projects that use this

  • truongtv22Skill

    mobile-development

    Build modern mobile applications with React Native, Flutter, Swift/SwiftUI, and Kotlin/Jetpack Compose. Covers mobile-first design principles, performance optimization (battery, memory, network), offline-first architecture, platform-specific guidelines (iOS HIG, Material Design), testing strategies, security best practices, accessibility, app store deployment, and mobile development mindset. Use when building mobile apps, implementing mobile UX patterns, optimizing for mobile constraints, or making native vs cross-platform decisions.

    Also in 4 projects that use this

  • sumuligeSkill

    seo-optimization

    SEO best practices for Git, documentation, and web projects

    Also in 3 projects that use this

  • claude-office-skillsSkill

    email-marketing

    Email marketing automation - campaign creation, sequence building, A/B testing, deliverability optimization, and analytics

    Also in 3 projects that use this

  • +6 more from OpenAnalystInc

The file

Files
SKILL.md

支付集成

支付方式对比

国内:支付宝、微信支付(扫码/H5/APP)
国外:Stripe、PayPal(信用卡/Apple Pay/Google Pay)

卖数字产品:面包多、小报童(平台帮你搞定支付)
自己做 SaaS:Stripe(国外)+ 支付宝(国内)

Stripe(推荐,API 最优雅)

import stripe
stripe.api_key = "sk_live_xxx"

# 创建支付会话
session = stripe.checkout.Session.create(
    payment_method_types=['card', 'alipay'],
    line_items=[{
        'price_data': {
            'currency': 'cny',
            'product_data': {'name': 'AI Agent 入门指南'},
            'unit_amount': 2900,  # 29元 = 2900分
        },
        'quantity': 1,
    }],
    mode='payment',
    success_url='https://yoursite.com/success',
    cancel_url='https://yoursite.com/cancel',
)
# 返回 session.url → 用户跳转支付

# Webhook:支付成功后 Stripe 回调你的服务器
@app.post("/stripe-webhook")
async def stripe_webhook(request):
    payload = await request.body()
    event = stripe.Webhook.construct_event(
        payload, request.headers['stripe-signature'], webhook_secret
    )
    if event['type'] == 'checkout.session.completed':
        session = event['data']['object']
        fulfill_order(session)  # 发货
    return {"status": "ok"}

支付宝

# 当面付(扫码支付)
from alipay import AliPay

alipay = AliPay(
    appid="你的APPID",
    app_private_key_path="private_key.pem",
    alipay_public_key_path="alipay_public_key.pem",
    sign_type="RSA2",
)

# 生成支付链接
order_string = alipay.api_alipay_trade_page_pay(
    out_trade_no="ORDER20260730001",
    total_amount=29.00,
    subject="AI Agent 入门指南",
    return_url="https://yoursite.com/success",
)
pay_url = f"https://openapi.alipay.com/gateway.do?{order_string}"

订阅模式

# Stripe 订阅
product = stripe.Product.create(name="AI Agent Pro")
price = stripe.Price.create(
    product=product.id,
    unit_amount=7900,  # ¥79/月
    currency='cny',
    recurring={'interval': 'month'},
)

# 创建订阅
subscription = stripe.Subscription.create(
    customer=customer_id,
    items=[{'price': price.id}],
)

退款

# Stripe 退款
stripe.Refund.create(payment_intent=payment_intent_id)

# 支付宝退款
alipay.api_alipay_trade_refund(
    out_trade_no="ORDER20260730001",
    refund_amount=29.00,
)

安全

1. 验证 Webhook 签名(防伪造回调)
2. 幂等处理(同一笔支付多次回调)
3. 不信任客户端(金额必须在服务端验证)
4. 密钥放环境变量
5. 记录所有支付日志

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.