@stacksjs/payments 0.74.11 → 0.74.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/drivers/stripe.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type Stripe from 'stripe';
|
|
2
|
+
/** Whether this process has the credential required to make Stripe calls. */
|
|
3
|
+
export declare function isStripeConfigured(): boolean;
|
|
2
4
|
/**
|
|
3
5
|
* Lazy-initialized Stripe instance.
|
|
4
6
|
* Only throws when you actually try to use Stripe, not at module load time.
|
package/dist/drivers/stripe.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire}from"node:module";import{services}from"@stacksjs/config";const require=createRequire(import.meta.url);function StripeCtor(){try{return require("stripe")}catch{throw Error("Stripe payments are being used but the `stripe` package is not installed. It is an opt-in dependency - run `bun add stripe` to enable server-side Stripe payments.")}}let _stripe=null;export const stripe=new Proxy({},{get(_target,prop){if(!_stripe){const apiKey=services?.stripe?.secretKey;if(!apiKey)throw Error("Stripe secret key is not configured. Set STRIPE_SECRET_KEY in your .env file.");const apiVersion="2026-06-24.dahlia",configuredVersion=services?.stripe?.apiVersion;if(configuredVersion&&configuredVersion!==apiVersion)throw Error(`Stripe API version ${configuredVersion} does not match the installed SDK version ${apiVersion}`);_stripe=new(StripeCtor())(apiKey,{apiVersion})}return _stripe[prop]}});
|
|
1
|
+
import{createRequire}from"node:module";import{services}from"@stacksjs/config";const require=createRequire(import.meta.url);function StripeCtor(){try{return require("stripe")}catch{throw Error("Stripe payments are being used but the `stripe` package is not installed. It is an opt-in dependency - run `bun add stripe` to enable server-side Stripe payments.")}}let _stripe=null;export function isStripeConfigured(){return Boolean(String(services?.stripe?.secretKey||"").trim())}export const stripe=new Proxy({},{get(_target,prop){if(!_stripe){const apiKey=services?.stripe?.secretKey;if(!apiKey)throw Error("Stripe secret key is not configured. Set STRIPE_SECRET_KEY in your .env file.");const apiVersion="2026-06-24.dahlia",configuredVersion=services?.stripe?.apiVersion;if(configuredVersion&&configuredVersion!==apiVersion)throw Error(`Stripe API version ${configuredVersion} does not match the installed SDK version ${apiVersion}`);_stripe=new(StripeCtor())(apiKey,{apiVersion})}return _stripe[prop]}});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/payments",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.74.
|
|
5
|
+
"version": "0.74.12",
|
|
6
6
|
"description": "The Stacks payments package. Currently supporting Stripe.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
"prepublishOnly": "bun run build"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@stacksjs/config": "0.74.
|
|
64
|
-
"@stacksjs/database": "0.74.
|
|
65
|
-
"@stacksjs/error-handling": "0.74.
|
|
66
|
-
"@stacksjs/logging": "0.74.
|
|
67
|
-
"@stacksjs/orm": "0.74.
|
|
63
|
+
"@stacksjs/config": "0.74.12",
|
|
64
|
+
"@stacksjs/database": "0.74.12",
|
|
65
|
+
"@stacksjs/error-handling": "0.74.12",
|
|
66
|
+
"@stacksjs/logging": "0.74.12",
|
|
67
|
+
"@stacksjs/orm": "0.74.12"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@stripe/stripe-js": "^9.10.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@stacksjs/utils": "0.74.
|
|
82
|
+
"@stacksjs/utils": "0.74.12",
|
|
83
83
|
"@stripe/stripe-js": "^9.10.0",
|
|
84
84
|
"better-dx": "^0.2.24",
|
|
85
85
|
"stripe": "22.3.2"
|