Download stripe_checkout.py from mgbam/AICEO: direct link, hf CLI and curl.
- Browser
- Download file 666 Bytes
-
https://huggingface.co/spaces/mgbam/AICEO/resolve/d16d5a2341e13fd72b8f9a26fd7a183551400155/stripe_checkout.py
- Command line
-
hf download hf://spaces/mgbam/AICEO@d16d5a2341e13fd72b8f9a26fd7a183551400155/stripe_checkout.py
-
curl -L -o stripe_checkout.py https://huggingface.co/spaces/mgbam/AICEO/resolve/d16d5a2341e13fd72b8f9a26fd7a183551400155/stripe_checkout.py
666 Bytes
| # stripe_checkout.py | |
| import os | |
| import stripe | |
| stripe.api_key = os.getenv("STRIPE_API_KEY") | |
| def create_stripe_session(): | |
| session = stripe.checkout.Session.create( | |
| payment_method_types=["card"], | |
| line_items=[{ | |
| "price_data": { | |
| "currency": "usd", | |
| "product_data": {"name": "AutoExec AI Pro Subscription"}, | |
| "unit_amount": 4900, | |
| }, | |
| "quantity": 1, | |
| }], | |
| mode="subscription", | |
| success_url=os.getenv("SUCCESS_URL", "https://example.com/success"), | |
| cancel_url=os.getenv("CANCEL_URL", "https://example.com/cancel"), | |
| ) | |
| return session.url | |