Payment Gateway Integration

Payment Gateway Integration

Teaches an AI agent to integrate Stripe, PayPal and Square payments in backends, including subscriptions, refunds, webhooks and secure handling.

Skill files7 files

references/

scripts/

templates/

SKILL.md106 lines
1
---
2
name: payment-gateway-integration
3
description: >
4
Integrate payment gateways like Stripe, PayPal, and Square with backends for
5
payment processing, subscription management, and webhook handling. Use when
6
building e-commerce platforms, implementing billing systems, and handling
7
payments securely.
8
---
9
10
# Payment Gateway Integration
11
12
## Table of Contents
13
14
- [Overview](#overview)
15
- [When to Use](#when-to-use)
16
- [Quick Start](#quick-start)
17
- [Reference Guides](#reference-guides)
18
- [Best Practices](#best-practices)
19
20
## Overview
21
22
Build secure payment processing systems with major payment providers (Stripe, PayPal, Square), handling transactions, subscriptions, webhooks, PCI compliance, and error scenarios across different backend frameworks.
23
24
## When to Use
25
26
- Processing customer payments
27
- Implementing subscription billing
28
- Building e-commerce platforms
29
- Handling refunds and disputes
30
- Managing recurring charges
31
- Integrating payment webhooks
32
33
## Quick Start
34
35
Minimal working example:
36
37
```python
38
# config.py
39
import os
40
41
class StripeConfig:
42
STRIPE_SECRET_KEY = os.getenv('STRIPE_SECRET_KEY')
43
STRIPE_PUBLISHABLE_KEY = os.getenv('STRIPE_PUBLISHABLE_KEY')
44
STRIPE_WEBHOOK_SECRET = os.getenv('STRIPE_WEBHOOK_SECRET')
45
46
# stripe_service.py
47
import stripe
48
from datetime import datetime, timedelta
49
import logging
50
51
logger = logging.getLogger(__name__)
52
53
stripe.api_key = os.getenv('STRIPE_SECRET_KEY')
54
55
class StripePaymentService:
56
@staticmethod
57
def create_payment_intent(amount, currency='usd', description=None, metadata=None):
58
"""Create a payment intent"""
59
try:
60
intent = stripe.PaymentIntent.create(
61
amount=int(amount * 100), # Convert to cents
62
currency=currency,
63
// ... (see reference guides for full implementation)
64
```
65
66
## Reference Guides
67
68
Detailed implementations in the `references/` directory:
69
70
| Guide | Contents |
71
|---|---|
72
| [Stripe Integration with Python/Flask](references/stripe-integration-with-pythonflask.md) | Stripe Integration with Python/Flask |
73
| [Node.js/Express Stripe Integration](references/nodejsexpress-stripe-integration.md) | Node.js/Express Stripe Integration |
74
| [PayPal Integration](references/paypal-integration.md) | PayPal Integration |
75
| [Subscription Management](references/subscription-management.md) | Subscription Management |
76
77
## Best Practices
78
79
### ✅ DO
80
81
- Use official payment SDK libraries
82
- Verify webhook signatures
83
- Store minimal payment information
84
- Never store full credit card numbers
85
- Use HTTPS for all payment routes
86
- Implement proper error handling
87
- Test with sandbox environments
88
- Handle payment failures gracefully
89
- Implement PCI compliance
90
- Log all payment transactions
91
- Use idempotency keys
92
- Implement retry logic
93
94
### ❌ DON'T
95
96
- Handle raw card data
97
- Store sensitive payment information
98
- Log sensitive details
99
- Trust client-side validation only
100
- Ignore webhook events
101
- Hardcode API keys
102
- Use test keys in production
103
- Skip SSL/TLS verification
104
- Forget to validate amounts
105
- Store payment tokens without encryption
106

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…