@stacksjs/payments 0.75.40 → 0.75.41
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/billable/intent.js +1 -1
- package/dist/drivers/stripe.js +1 -1
- package/package.json +12 -12
package/dist/billable/intent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{stripe}from"../drivers/stripe";import{manageCustomer}from"./customer";import{freshIdempotencyKey}from"../idempotency";export const manageSetupIntent=(()=>{async function create(user,params){const mergedParams={...{customer:await manageCustomer.createOrGetStripeUser(user,{}).then((customer)=>{if(!customer||!customer.id)throw Error("Customer does not exist in Stripe");return customer.id}),
|
|
1
|
+
import{stripe}from"../drivers/stripe";import{manageCustomer}from"./customer";import{freshIdempotencyKey}from"../idempotency";export const manageSetupIntent=(()=>{async function create(user,params){const mergedParams={...{customer:await manageCustomer.createOrGetStripeUser(user,{}).then((customer)=>{if(!customer||!customer.id)throw Error("Customer does not exist in Stripe");return customer.id}),allowed_payment_method_types:["card"]},...params};return await stripe.setupIntents.create(mergedParams,{idempotencyKey:freshIdempotencyKey("setup_intent.create",user.id)})}return{create}})();
|
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 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=
|
|
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 Stripe=StripeCtor(),apiVersion=Stripe.API_VERSION,configuredVersion=services?.stripe?.apiVersion;if(configuredVersion&&configuredVersion!==apiVersion)throw Error(`Stripe API version ${configuredVersion} does not match the installed SDK version ${apiVersion}`);_stripe=new Stripe(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.75.
|
|
5
|
+
"version": "0.75.41",
|
|
6
6
|
"description": "The Stacks payments package. Currently supporting Stripe.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -60,16 +60,16 @@
|
|
|
60
60
|
"prepublishOnly": "bun run build"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@stacksjs/config": "0.75.
|
|
64
|
-
"@stacksjs/database": "0.75.
|
|
65
|
-
"@stacksjs/error-handling": "0.75.
|
|
66
|
-
"@stacksjs/logging": "0.75.
|
|
67
|
-
"@stacksjs/orm": "0.75.
|
|
68
|
-
"@stacksjs/types": "0.75.
|
|
63
|
+
"@stacksjs/config": "0.75.41",
|
|
64
|
+
"@stacksjs/database": "0.75.41",
|
|
65
|
+
"@stacksjs/error-handling": "0.75.41",
|
|
66
|
+
"@stacksjs/logging": "0.75.41",
|
|
67
|
+
"@stacksjs/orm": "0.75.41",
|
|
68
|
+
"@stacksjs/types": "0.75.41"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@stripe/stripe-js": "^
|
|
72
|
-
"stripe": "
|
|
71
|
+
"@stripe/stripe-js": "^10.0.0",
|
|
72
|
+
"stripe": "23.0.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependenciesMeta": {
|
|
75
75
|
"@stripe/stripe-js": {
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@stacksjs/utils": "0.75.
|
|
84
|
-
"@stripe/stripe-js": "^
|
|
83
|
+
"@stacksjs/utils": "0.75.41",
|
|
84
|
+
"@stripe/stripe-js": "^10.0.0",
|
|
85
85
|
"better-dx": "^0.2.24",
|
|
86
|
-
"stripe": "
|
|
86
|
+
"stripe": "23.0.0"
|
|
87
87
|
}
|
|
88
88
|
}
|