Download src/lib/stripe.js from NeoPy/hugging-c-ai: direct link, hf CLI and curl.
- Browser
- Download file 483 Bytes
-
https://huggingface.co/NeoPy/hugging-c-ai/resolve/main/src/lib/stripe.js
- Command line
-
hf download hf://NeoPy/hugging-c-ai/src/lib/stripe.js
-
curl -L -o stripe.js https://huggingface.co/NeoPy/hugging-c-ai/resolve/main/src/lib/stripe.js
483 Bytes
| import Stripe from "stripe"; | |
| import config from "./config"; | |
| const apiKey = | |
| config.stripe.secretKey && config.stripe.secretKey.trim() !== "" | |
| ? config.stripe.secretKey | |
| : "sk_test_placeholder_key_for_build_purposes"; | |
| let _stripe = null; | |
| export function getStripe() { | |
| if (!_stripe) { | |
| _stripe = new Stripe(apiKey, { apiVersion: "2024-04-10" }); | |
| } | |
| return _stripe; | |
| } | |
| export const stripe = new Proxy({}, { | |
| get(_target, prop) { | |
| return getStripe()[prop]; | |
| }, | |
| }); | |