360 Secure SkillHub
360 安全技能中心

a2a-Market-Stripe-Payment

该 Skill 提供 Stripe 支付集成骨架:根据订单条款创建支付意图,按订单状态捕获或取消授权,校验 Webhook 签名并同步支付状态,同时定义支付成功/失败事件映射;当前以契约、布局和实现清单为主,声称本地运行时已实现并有测试。

luoqianchenguni-max
luoqianchenguni-max
热度 62.61
最近更新 2026-05-11 17:33:42
分类:开发依赖:代码执行 / 第三方 API应用场景:API 集成 / 代码生成 / 财务 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add a2a-market-stripe-payment
Metadata
name
a2a-market-stripe-payment
description
Integrate Stripe payment intents, capture flow, and webhook reconciliation for A2A orders. Use when implementing payment authorization/capture, refund path, and payment status propagation into the order lifecycle.

a2a-Market Stripe Payment

Create the Stripe payment integration skeleton for order settlement.

Current status: registration scaffold with stable payment contracts and webhook map.

Scope

  • Create payment intent from negotiated order terms.
  • Capture or cancel payments based on order transitions.
  • Reconcile webhook events with internal order state.

Suggested Project Layout

  • app/integrations/stripe/stripe_client.py
  • app/application/services/payment_service.py
  • app/interfaces/api/payment_routes.py
  • app/infrastructure/tasks/stripe_webhook_worker.py

Minimum Contracts (MVP P0)

  1. create_payment_intent(order_id, amount, currency) returns provider intent id + client secret.
  2. capture_payment(provider_intent_id) captures authorized funds.
  3. cancel_payment(provider_intent_id) voids uncaptured authorization.
  4. handle_webhook(event) verifies signature and upserts payment status.

Event Mapping

  • Emit ORDER_CREATED when payment intent is created.
  • Emit PAYMENT_SUCCEEDED when capture confirms.
  • Emit payment-failed incident event when authorization/capture fails.

Guardrails

  • Verify webhook signature before parsing payload.
  • Enforce idempotency key for create/capture endpoints.
  • Keep provider status mapping table explicit and versioned.

Implementation Backlog

  • Add partial refund and dispute webhook handling.
  • Add multi-currency routing and fee optimization.

Runtime Implementation

  • Status: implemented in local runtime package.
  • Primary code paths:
  • runtime/src/integrations/stripe/stripe-payment-service.js
  • Validation: covered by runtime/tests and npm test in runtime/.