Skip to main content

LFS Stripe

A Django Lightning Fast Shop (LFS) payment integration for Stripe.

Overview

This package provides Stripe payment integration for LFS e-commerce platform. It allows customers to make secure credit card payments through Stripe's payment processing system.

Features

  • Seamless integration with LFS checkout process
  • Secure credit card processing via Stripe API
  • Support for payment intents
  • Client-side card validation

Installation

  1. Install the package:

    pip install lfs-stripe
    
  2. Add to your INSTALLED_APPS in settings.py:

    INSTALLED_APPS = [
        # ...
        'lfs_stripe',
        # ...
    ]
    
  3. Configure Stripe in settings.py (best read from environment variables):

    STRIPE_SECRET_KEY = os.environ["STRIPE_SECRET_KEY"]            # sk_..., stays on the server
    STRIPE_PUBLISHABLE_KEY = os.environ["STRIPE_PUBLISHABLE_KEY"]  # pk_..., sent to the browser
    STRIPE_SHOP_NAME = "My shop"  # prefix of the cart and order references shown in Stripe
    

    Both keys must belong to the same Stripe account.

  4. Include the URLs in your project's urls.py:

    urlpatterns = [
        # ...
        path('stripe/', include('lfs_stripe.urls')),
        # ...
    ]
    

Request flow

The URLs must be included under stripe/, because the checkout script calls these paths.

  1. The checkout script fetches the publishable key from /stripe/config/ and starts Stripe Elements.
  2. On payment it calls /stripe/create-payment-intent/. The server creates a PaymentIntent for the cart total with the secret key and returns its client secret.
  3. The browser confirms the payment with Stripe (confirmCardPayment) using the client secret.
  4. On success it calls /stripe/create-order/, which creates the order and adds its number to the PaymentIntent.
  5. The browser goes to the thank-you page.

Payments are in EUR (fixed in create_payment_intent). The PaymentIntent is always created on the server: only there is the secret key, and the amount comes from the cart, so it cannot be changed in the browser.

Differences from LFS-PayPal

While both lfs-stripe and lfs-paypal provide payment integration for LFS, there are several key differences:

  1. Payment Processing:

    • Stripe processes credit card payments directly on your site (with client-side tokenization)
  2. API Integration:

    • Stripe uses a modern API with Payment Intents
  3. Payment Methods:

    • Stripe primarily handles credit card payments directly
  4. User Experience:

    • Stripe allows customers to stay on your site throughout the checkout process

Metadata

Release files for lfs-stripe 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lfs-stripe 1.0.2
File Size Uploaded Provenance Actions
lfs_stripe-1.0.2.tar.gz 6.3 kB Without provenance Details for lfs_stripe-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lfs-stripe 1.0.2
File Interpreter ABI Platform Actions
lfs_stripe-1.0.2-py3-none-any.whl Python 3 none any Details for lfs_stripe-1.0.2-py3-none-any.whl

Total release size: 13.8 kB

Release files / lfs_stripe-1.0.2.tar.gz

Download URL lfs_stripe-1.0.2.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e4eeda9e97d8623dad1105c912105650124ac4ae79625bbc67857158efa1ab23
BLAKE2b-256 checksum
How to use checksums
f3335fcde6db4c4f9640f68993af80168413645486058b4ee4a4ce52f0f0180d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Release files / lfs_stripe-1.0.2-py3-none-any.whl

Download URL lfs_stripe-1.0.2-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0eff02b92c616e6353ac91f5cb63093df782b8ebd71c446a64659c16fc64458e
BLAKE2b-256 checksum
How to use checksums
8483a7f84cb9af0b366412b7684a50f06683aba6285ffeded20a535b09f9924a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Security for lfs-stripe 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page