Stripe Payments API

Integrating Stripe payments, managing subscription billing checkout sessions, and validation signatures on webhooks.

Lord1Egypt Updated 2 repo stars

File contents

Stripe Payments Api

Overview

Stripe is a suite of APIs powering online payment processing and commerce solutions.

When to Use This Skill

Use to implement e-commerce checkouts or software-as-a-service subscription pricing models.

Quick Start (with runnable code examples)

import stripe

stripe.api_key = "sk_test_..."

def create_checkout():
    session = stripe.checkout.Session.create(
        payment_method_types=['card'],
        line_items=[{
            'price_data': {
                'currency': 'usd',
                'product_data': {'name': 'Agent subscription'},
                'unit_amount': 2000,
            },
            'quantity': 1,
        }],
        mode='payment',
        success_url='https://example.com/success',
        cancel_url='https://example.com/cancel',
    )
    return session.url

Advanced Usage

Handle Stripe webhook event signature verification (stripe.Webhook.construct_event) and customer portals.

Key References

Dependencies

  • stripe>=8.0.0

Lord1Egypt/ai-skillforge/tree/main/skills/gemini/stripe-payments-api commit ddc75137d5

Frequently asked questions

npx skillmds@latest add lord1egypt/stripe-payments-api