stripe-payments
$
npx mdskill add mkurman/zorai/stripe-paymentsProcess payments, manage subscriptions, and prevent fraud using Stripe.
- Enables agents to handle one-time charges, recurring billing, and marketplace payouts.
- Depends on the Stripe Python SDK and requires valid API keys for all operations.
- Executes transactions by parsing webhook signatures and validating event types.
- Returns transaction IDs, status updates, and payment confirmation details.
SKILL.md
.github/skills/stripe-paymentsView on GitHub ↗
---
name: stripe-payments
description: "Stripe payments integration: charges, subscriptions, invoices, webhooks, Connect platform, and fraud prevention (Radar). Build payment workflows, recurring billing, and marketplace payouts."
tags: [stripe, payments, billing, subscriptions, fintech, api, zorai]
---
## Overview
Stripe handles payment processing for online businesses — one-time charges, subscription billing, invoicing, marketplace payouts (Connect), and fraud prevention (Radar). This skill covers the Python SDK (`stripe` module).
## Installation
```bash
uv pip install stripe
```
## One-Time Charge
```python
import stripe
stripe.api_key = "sk_test_..."
charge = stripe.Charge.create(
amount=2000, # $20.00 in cents
currency="usd",
source="tok_visa", # token from Stripe.js
description="Example charge",
)
print(charge.id, charge.status)
```
## Subscription
```python
customer = stripe.Customer.create(email="customer@example.com")
subscription = stripe.Subscription.create(
customer=customer.id,
items=[{"price": "price_123"}], # recurring price ID
)
print(subscription.id, subscription.status)
```
## Webhook Verification
```python
from flask import request
import stripe
payload = request.data
sig_header = request.headers.get("Stripe-Signature")
event = stripe.Webhook.construct_event(payload, sig_header, "whsec_...")
if event.type == "payment_intent.succeeded":
payment_intent = event.data.object
print(f"Payment {payment_intent.id} succeeded")
```
## Connect Platform (Marketplace Payouts)
```python
# Create a connected account
account = stripe.Account.create(
type="express",
country="US",
email="seller@example.com",
)
# Transfer funds
transfer = stripe.Transfer.create(
amount=1000,
currency="usd",
destination=account.id,
)
```
## Error Handling
```python
try:
charge = stripe.Charge.create(amount=-1, currency="usd")
except stripe.error.InvalidRequestError as e:
print(f"Invalid request: {e.user_message}")
except stripe.error.CardError as e:
print(f"Card declined: {e.error.decline_code}")
except stripe.error.RateLimitError:
print("Rate limited — retry with exponential backoff")
```
## References
- [Stripe Python SDK docs](https://stripe.com/docs/api?lang=python)
- [Stripe webhook best practices](https://stripe.com/docs/webhooks)
- [Stripe Connect docs](https://stripe.com/docs/connect)More from mkurman/zorai
- account-management>
- agile-scrum>
- albumentationsFast image augmentation library (Albumentations). 70+ transforms for classification, segmentation, object detection, keypoints, and pose estimation. Optimized OpenCV-based pipeline with unified API across all CV tasks. Supports images, masks, bounding boxes, and keypoints simultaneously. Note: classic Albumentations (MIT) is no longer maintained; successor AlbumentationsX uses AGPL-3.0. For torchvision-native augmentations, use torchvision.transforms.v2.
- aml-complianceAnti-Money Laundering (AML) and Know Your Customer (KYC) compliance workflow. Sanctions screening, PEP detection, transaction monitoring, suspicious activity reporting (SAR), and OFAC compliance.
- anki-connectThis skill is for interacting with Anki through AnkiConnect, and should be used whenever a user asks to interact with Anki, including to read or modify decks, notes, cards, models, media, or sync operations.
- approval-checkpoint-long-taskCanonical long-task pack for daemon-managed work with deliberate approval checkpoints, status summaries, rollback notes, and mobile-safe governance-aware updates.
- auditing-goal-artifactsUse when reviewing recent zorai goal run outputs, closure markers, ledgers, or evidence bundles to judge whether completion is credible or to identify remaining uncertainty.
- autogenAutoGen (Microsoft) — multi-agent conversation framework. Agent-to-agent chat, code generation & execution, tool use, group chat, and human-in-the-loop. Build collaborative AI systems with specialized agents.
- backtraderPython backtesting framework for trading strategies. Data feeds, brokers, analyzers, and live trading support. Strategy development with commission models, slippage, and signal-based execution.
- beautiful-mermaidRender Mermaid diagrams as SVG and PNG using the Beautiful Mermaid library. Use when the user asks to render a Mermaid diagram.