# [CRUCIBLE-SEED]
# category: hardcoded_secret
# severity: critical
# language: python
# expected: hardcoded Stripe and PayPal API credentials

import stripe
import requests

# Stripe configuration
STRIPE_SECRET_KEY = "sk_live_51HqT3kLkjhGHJKL9mNoPqRstuvWxYz1234567890abcdef"
STRIPE_PUBLISHABLE_KEY = "pk_live_51HqT3kLkjhGHJKL9mNoPqRstuvWxYz0987654321"
STRIPE_WEBHOOK_SECRET = "whsec_abcdefghijklmnopqrstuvwxyz1234567890ABCDEF"

stripe.api_key = STRIPE_SECRET_KEY

# PayPal configuration
PAYPAL_CLIENT_ID = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz12345678"
PAYPAL_CLIENT_SECRET = "EeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz123456781234"
PAYPAL_BASE_URL = "https://api.paypal.com"


def get_paypal_token() -> str:
    response = requests.post(
        f"{PAYPAL_BASE_URL}/v1/oauth2/token",
        auth=(PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET),
        data={"grant_type": "client_credentials"},
    )
    return response.json()["access_token"]


def create_payment_intent(amount: int, currency: str = "usd") -> dict:
    return stripe.PaymentIntent.create(amount=amount, currency=currency)
