Passerelle de Paiement

VérifiéPrudence

Traite les paiements de manière sécurisée via Stripe, PayPal ou ACH. Utilisé pour payer des factures, planifier des paiements futurs et gérer les méthodes de paiement. Inclut une journalisation complète des audits et la gestion des webhooks pour la confirmation des paiements et les alertes d'échec.

Spar Skills Guide Bot
DeveloppementIntermédiaire
02/06/2026
Claude Code
#payment-gateway#stripe#paypal#ach#invoicing

Recommandé pour

Synthèse automatique

Cette compétence permet de traiter des paiements via Stripe, PayPal ou ACH, avec planification, exécution et confirmation, ainsi qu'une piste d'audit complète.

Points forts

  • Intègre plusieurs passerelles de paiement (Stripe, PayPal, ACH).
  • Gère la planification des paiements et les webhooks.
  • Inclut des validations robustes et un journal d'audit.

Limites

  • Nécessite des clés API et une configuration tenant par passerelle.
  • La gestion des erreurs peut être complexe (échecs, remboursements).
  • Dépend de services externes (Stripe, PayPal).
Quand l'utiliser

Utilisez cette compétence pour automatiser le traitement des paiements de factures ou de clients.

Quand l'éviter

Ne l'utilisez pas pour des paiements manuels simples ou si vous utilisez une passerelle non supportée.

Analyse de sécurité

Prudence
Score qualité90/100

The skill processes live payments and updates databases, which carries inherent financial risk. It follows security best practices (idempotency, PCI compliance, RBAC, parameterized queries), but the operational power of the actions (charging cards, transferring funds) warrants caution to prevent misuse or accidental execution.

Points d'attention
  • •Instructs execution of real financial transactions (Stripe, PayPal, ACH) with monetary impact
  • •SQL update and insert operations that modify database state
  • •Uses environment variables for API secrets; exposure risk if the skill runtime is compromised
Comment cette analyse est faite

Exemples

Pay an invoice immediately
Pay invoice INV-2025-001 for $500.00 using Stripe, with approval from user admin@example.com.
Schedule a future payment
Schedule payment for invoice INV-2025-002 via ACH on March 1, 2025. Approved by user jdoe.
Process a refund
Refund payment pi_1234abc for invoice INV-2025-003. The original payment was made via PayPal.

name: payment-gateway description: "Process payments via Stripe, PayPal, or ACH. Use when paying invoices, processing customer payments, or managing payment methods. Handles payment scheduling, execution, and confirmation with full audit trail."

Payment Gateway Skill

Purpose

Processes payments securely through integrated payment gateways (Stripe, PayPal, ACH), with proper authorization, audit logging, and error handling.

Triggers

  • Invoice approved and ready for payment
  • Customer payment submitted
  • Scheduled payment due date reached
  • Manual payment initiated

Capabilities

  1. Payment Processing - Execute payments via Stripe/PayPal/ACH
  2. Payment Scheduling - Schedule future payments
  3. Payment Confirmation - Verify payment succeeded
  4. Refund Processing - Handle refunds and reversals
  5. Payment Method Management - Store and manage payment methods
  6. Webhook Handling - Process payment status webhooks

Instructions

Step 1: Validate Payment Request

Required fields:

  • tenant_id - For multi-tenant isolation
  • invoice_id or amount - What to pay
  • payment_method - stripe, paypal, ach
  • approved_by - User ID who approved payment
  • scheduled_date - When to execute (can be immediate)

Validations:

  • Invoice status is 'approved'
  • Amount matches invoice amount
  • Payment method is configured for tenant
  • User has permission to approve payments
  • Sufficient funds (if applicable)

Step 2: Execute Payment

Stripe Payment

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);

const payment_intent = await stripe.paymentIntents.create({
  amount: invoice.amount,  // cents
  currency: invoice.currency,
  description: `Invoice ${invoice.invoice_number} - ${invoice.vendor_name}`,
  metadata: {
    tenant_id: invoice.tenant_id,
    invoice_id: invoice.id,
  },
});

// Confirm payment
const confirmed = await stripe.paymentIntents.confirm(payment_intent.id, {
  payment_method: tenant_payment_method_id,
});

ACH Payment

// Via Stripe or Plaid
const transfer = await stripe.transfers.create({
  amount: invoice.amount,
  currency: invoice.currency,
  destination: vendor_stripe_account_id,
});

PayPal Payment

// Via PayPal SDK
const payment = await paypal.createPayment({
  amount: cents_to_dollars(invoice.amount),
  currency: invoice.currency,
  recipient: vendor_paypal_email,
});

Step 3: Update Invoice Status

On success:

UPDATE invoices
SET status = 'paid',
    paid_at = NOW(),
    updated_at = NOW()
WHERE id = $1 AND tenant_id = $2;

On failure:

  • Log error to agent_runs table
  • Create alert for manual review
  • Do NOT mark as paid

Step 4: Audit Log

INSERT INTO audit_log (tenant_id, user_id, action, entity_type, entity_id, changes)
VALUES (
  $1,  -- tenant_id
  $2,  -- user_id (approved_by)
  'approve',  -- action
  'invoices',  -- entity_type
  $3,  -- invoice_id
  jsonb_build_object(
    'payment_method', 'stripe',
    'payment_intent_id', payment_intent.id,
    'amount', invoice.amount,
    'status', 'paid'
  )
);

Step 5: Confirmation

Return payment confirmation:

{
  "success": true,
  "invoice_id": "uuid",
  "payment_id": "pi_1234...",  // Stripe payment intent ID
  "amount": 50000,  // cents
  "currency": "USD",
  "status": "paid",
  "paid_at": "2026-01-15T14:30:00Z",
  "payment_method": "stripe",
  "confirmation_number": "..."
}

Payment Scheduling

For future payments:

INSERT INTO scheduled_payments (
  tenant_id, invoice_id, amount, currency,
  payment_method, scheduled_date, status
)
VALUES ($1, $2, $3, $4, $5, $6, 'pending');

Cron job checks scheduled_payments daily and executes when scheduled_date <= NOW().

Webhook Handling

Process Stripe webhooks:

  • payment_intent.succeeded - Mark invoice as paid
  • payment_intent.payment_failed - Alert user, retry or manual review
  • charge.refunded - Create refund transaction

Error Handling

  • Insufficient Funds - Alert user, reschedule payment
  • Payment Method Invalid - Request updated payment method
  • API Error - Retry with exponential backoff (3 attempts)
  • Network Timeout - Check payment status before retry (idempotency)
  • Declined Payment - Alert user, mark for manual review

Integration Points

  • stripe-integrator (Integration worker) - Stripe API
  • paypal-integrator (Integration worker) - PayPal API
  • payment-processor (AP worker) - Payment execution logic
  • audit-trail - Immutable audit log

Models

  • Payment Logic: Deterministic (no LLM)
  • Error Analysis: Claude Sonnet 4 (for complex error scenarios)

Security

  • Idempotency - Use idempotency keys for Stripe to prevent duplicate charges
  • PCI Compliance - Never store full credit card numbers
  • Secrets Management - API keys in environment variables, never in code
  • Rate Limiting - Respect payment gateway rate limits
  • Audit Trail - Log all payment attempts (success and failure)
  • User Authorization - Verify user can approve payments (RBAC)
  • Amount Verification - Confirm amount matches invoice before payment

Invoke this skill when executing vendor payments or processing customer payments through integrated gateways.

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/payment-gateway-mmbizkcb/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/payment-gateway-mmbizkcb' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/payment-gateway-mmbizkcb/download' --output '.skill-downloads/payment-gateway-mmbizkcb/SKILL.md.part' && mv '.skill-downloads/payment-gateway-mmbizkcb/SKILL.md.part' '.skill-downloads/payment-gateway-mmbizkcb/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/payment-gateway-mmbizkcb/SKILL.md' && test -s '.skill-downloads/payment-gateway-mmbizkcb/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/payment-gateway' && cp -R '.skill-downloads/payment-gateway-mmbizkcb' '.claude/skills/payment-gateway'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/payment-gateway-mmbizkcb'

openskills read 'payment-gateway-mmbizkcb'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/payment-gateway-mmbizkcb/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires