@stacksjs/payments 0.61.24 → 0.62.0

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.
Files changed (2) hide show
  1. package/dist/index.js +217 -694
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -714,7 +714,7 @@ var require_util_inspect = __commonJS((exports, module) => {
714
714
  // ../../../../node_modules/object-inspect/index.js
715
715
  var require_object_inspect = __commonJS((exports, module) => {
716
716
  var addNumericSeparator = function(num, str) {
717
- if (num === Infinity || num === (-Infinity) || num !== num || num && num > -1000 && num < 1000 || $test.call(/e/, str)) {
717
+ if (num === Infinity || num === -Infinity || num !== num || num && num > -1000 && num < 1000 || $test.call(/e/, str)) {
718
718
  return str;
719
719
  }
720
720
  var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
@@ -2025,78 +2025,15 @@ var require_lib = __commonJS((exports, module) => {
2025
2025
  // src/drivers/stripe.ts
2026
2026
  var exports_stripe = {};
2027
2027
  __export(exports_stripe, {
2028
- paymentIntent: () => {
2029
- {
2030
- return paymentIntent;
2031
- }
2032
- },
2033
- events: () => {
2034
- {
2035
- return events;
2036
- }
2037
- },
2038
- dispute: () => {
2039
- {
2040
- return dispute;
2041
- }
2042
- },
2043
- customer: () => {
2044
- {
2045
- return customer;
2046
- }
2047
- },
2048
- charge: () => {
2049
- {
2050
- return charge;
2051
- }
2052
- },
2053
- balanceTransactions: () => {
2054
- {
2055
- return balanceTransactions;
2056
- }
2057
- },
2058
- balance: () => {
2059
- {
2060
- return balance;
2061
- }
2062
- }
2028
+ paymentIntent: () => paymentIntent,
2029
+ events: () => events,
2030
+ dispute: () => dispute,
2031
+ customer: () => customer,
2032
+ charge: () => charge,
2033
+ balanceTransactions: () => balanceTransactions,
2034
+ balance: () => balance
2063
2035
  });
2064
2036
 
2065
- // ../../../../node_modules/stripe/esm/platform/NodePlatformFunctions.js
2066
- import * as crypto3 from "crypto";
2067
- import {EventEmitter} from "events";
2068
-
2069
- // ../../../../node_modules/stripe/esm/crypto/NodeCryptoProvider.js
2070
- import * as crypto2 from "crypto";
2071
-
2072
- // ../../../../node_modules/stripe/esm/crypto/CryptoProvider.js
2073
- class CryptoProvider {
2074
- computeHMACSignature(payload, secret) {
2075
- throw new Error("computeHMACSignature not implemented.");
2076
- }
2077
- computeHMACSignatureAsync(payload, secret) {
2078
- throw new Error("computeHMACSignatureAsync not implemented.");
2079
- }
2080
- }
2081
-
2082
- class CryptoProviderOnlySupportsAsyncError extends Error {
2083
- }
2084
-
2085
- // ../../../../node_modules/stripe/esm/crypto/NodeCryptoProvider.js
2086
- class NodeCryptoProvider extends CryptoProvider {
2087
- computeHMACSignature(payload, secret) {
2088
- return crypto2.createHmac("sha256", secret).update(payload, "utf8").digest("hex");
2089
- }
2090
- async computeHMACSignatureAsync(payload, secret) {
2091
- const signature = await this.computeHMACSignature(payload, secret);
2092
- return signature;
2093
- }
2094
- }
2095
-
2096
- // ../../../../node_modules/stripe/esm/net/NodeHttpClient.js
2097
- import * as http_ from "http";
2098
- import * as https_ from "https";
2099
-
2100
2037
  // ../../../../node_modules/stripe/esm/net/HttpClient.js
2101
2038
  class HttpClient {
2102
2039
  getClientName() {
@@ -2136,98 +2073,13 @@ class HttpClientResponse {
2136
2073
  }
2137
2074
  }
2138
2075
 
2139
- // ../../../../node_modules/stripe/esm/net/NodeHttpClient.js
2140
- var http = http_.default || http_;
2141
- var https = https_.default || https_;
2142
- var defaultHttpAgent = new http.Agent({ keepAlive: true });
2143
- var defaultHttpsAgent = new https.Agent({ keepAlive: true });
2144
-
2145
- class NodeHttpClient extends HttpClient {
2146
- constructor(agent) {
2147
- super();
2148
- this._agent = agent;
2149
- }
2150
- getClientName() {
2151
- return "node";
2152
- }
2153
- makeRequest(host, port, path, method, headers, requestData, protocol, timeout) {
2154
- const isInsecureConnection = protocol === "http";
2155
- let agent = this._agent;
2156
- if (!agent) {
2157
- agent = isInsecureConnection ? defaultHttpAgent : defaultHttpsAgent;
2158
- }
2159
- const requestPromise = new Promise((resolve, reject) => {
2160
- const req = (isInsecureConnection ? http : https).request({
2161
- host,
2162
- port,
2163
- path,
2164
- method,
2165
- agent,
2166
- headers,
2167
- ciphers: "DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:!MD5"
2168
- });
2169
- req.setTimeout(timeout, () => {
2170
- req.destroy(HttpClient.makeTimeoutError());
2171
- });
2172
- req.on("response", (res) => {
2173
- resolve(new NodeHttpClientResponse(res));
2174
- });
2175
- req.on("error", (error) => {
2176
- reject(error);
2177
- });
2178
- req.once("socket", (socket) => {
2179
- if (socket.connecting) {
2180
- socket.once(isInsecureConnection ? "connect" : "secureConnect", () => {
2181
- req.write(requestData);
2182
- req.end();
2183
- });
2184
- } else {
2185
- req.write(requestData);
2186
- req.end();
2187
- }
2188
- });
2189
- });
2190
- return requestPromise;
2191
- }
2192
- }
2193
-
2194
- class NodeHttpClientResponse extends HttpClientResponse {
2195
- constructor(res) {
2196
- super(res.statusCode, res.headers || {});
2197
- this._res = res;
2198
- }
2199
- getRawResponse() {
2200
- return this._res;
2201
- }
2202
- toStream(streamCompleteCallback) {
2203
- this._res.once("end", () => streamCompleteCallback());
2204
- return this._res;
2205
- }
2206
- toJSON() {
2207
- return new Promise((resolve, reject) => {
2208
- let response = "";
2209
- this._res.setEncoding("utf8");
2210
- this._res.on("data", (chunk) => {
2211
- response += chunk;
2212
- });
2213
- this._res.once("end", () => {
2214
- try {
2215
- resolve(JSON.parse(response));
2216
- } catch (e) {
2217
- reject(e);
2218
- }
2219
- });
2220
- });
2221
- }
2222
- }
2223
-
2224
2076
  // ../../../../node_modules/stripe/esm/net/FetchHttpClient.js
2225
2077
  class FetchHttpClient extends HttpClient {
2226
2078
  constructor(fetchFn) {
2227
2079
  super();
2228
2080
  if (!fetchFn) {
2229
2081
  if (!globalThis.fetch) {
2230
- throw new Error("fetch() function not provided and is not defined in the global scope. You must provide a fetch implementation.");
2082
+ throw new Error("fetch() function not provided and is not defined in the global scope. " + "You must provide a fetch implementation.");
2231
2083
  }
2232
2084
  fetchFn = globalThis.fetch;
2233
2085
  }
@@ -2321,6 +2173,19 @@ class FetchHttpClientResponse extends HttpClientResponse {
2321
2173
  }
2322
2174
  }
2323
2175
 
2176
+ // ../../../../node_modules/stripe/esm/crypto/CryptoProvider.js
2177
+ class CryptoProvider {
2178
+ computeHMACSignature(payload, secret) {
2179
+ throw new Error("computeHMACSignature not implemented.");
2180
+ }
2181
+ computeHMACSignatureAsync(payload, secret) {
2182
+ throw new Error("computeHMACSignatureAsync not implemented.");
2183
+ }
2184
+ }
2185
+
2186
+ class CryptoProviderOnlySupportsAsyncError extends Error {
2187
+ }
2188
+
2324
2189
  // ../../../../node_modules/stripe/esm/crypto/SubtleCryptoProvider.js
2325
2190
  class SubtleCryptoProvider extends CryptoProvider {
2326
2191
  constructor(subtleCrypto) {
@@ -2403,74 +2268,89 @@ class PlatformFunctions {
2403
2268
  }
2404
2269
  }
2405
2270
 
2271
+ // ../../../../node_modules/stripe/esm/StripeEmitter.js
2272
+ class _StripeEvent extends Event {
2273
+ constructor(eventName, data) {
2274
+ super(eventName);
2275
+ this.data = data;
2276
+ }
2277
+ }
2278
+
2279
+ class StripeEmitter {
2280
+ constructor() {
2281
+ this.eventTarget = new EventTarget;
2282
+ this.listenerMapping = new Map;
2283
+ }
2284
+ on(eventName, listener) {
2285
+ const listenerWrapper = (event) => {
2286
+ listener(event.data);
2287
+ };
2288
+ this.listenerMapping.set(listener, listenerWrapper);
2289
+ return this.eventTarget.addEventListener(eventName, listenerWrapper);
2290
+ }
2291
+ removeListener(eventName, listener) {
2292
+ const listenerWrapper = this.listenerMapping.get(listener);
2293
+ this.listenerMapping.delete(listener);
2294
+ return this.eventTarget.removeEventListener(eventName, listenerWrapper);
2295
+ }
2296
+ once(eventName, listener) {
2297
+ const listenerWrapper = (event) => {
2298
+ listener(event.data);
2299
+ };
2300
+ this.listenerMapping.set(listener, listenerWrapper);
2301
+ return this.eventTarget.addEventListener(eventName, listenerWrapper, {
2302
+ once: true
2303
+ });
2304
+ }
2305
+ emit(eventName, data) {
2306
+ return this.eventTarget.dispatchEvent(new _StripeEvent(eventName, data));
2307
+ }
2308
+ }
2309
+
2310
+ // ../../../../node_modules/stripe/esm/platform/WebPlatformFunctions.js
2311
+ class WebPlatformFunctions extends PlatformFunctions {
2312
+ getUname() {
2313
+ return Promise.resolve(null);
2314
+ }
2315
+ createEmitter() {
2316
+ return new StripeEmitter;
2317
+ }
2318
+ tryBufferData(data) {
2319
+ if (data.file.data instanceof ReadableStream) {
2320
+ throw new Error("Uploading a file as a stream is not supported in non-Node environments. Please open or upvote an issue at github.com/stripe/stripe-node if you use this, detailing your use-case.");
2321
+ }
2322
+ return Promise.resolve(data);
2323
+ }
2324
+ createNodeHttpClient() {
2325
+ throw new Error("Stripe: `createNodeHttpClient()` is not available in non-Node environments. Please use `createFetchHttpClient()` instead.");
2326
+ }
2327
+ createDefaultHttpClient() {
2328
+ return super.createFetchHttpClient();
2329
+ }
2330
+ createNodeCryptoProvider() {
2331
+ throw new Error("Stripe: `createNodeCryptoProvider()` is not available in non-Node environments. Please use `createSubtleCryptoProvider()` instead.");
2332
+ }
2333
+ createDefaultCryptoProvider() {
2334
+ return this.createSubtleCryptoProvider();
2335
+ }
2336
+ }
2337
+
2406
2338
  // ../../../../node_modules/stripe/esm/Error.js
2407
2339
  var exports_Error = {};
2408
2340
  __export(exports_Error, {
2409
- generate: () => {
2410
- {
2411
- return generate;
2412
- }
2413
- },
2414
- StripeUnknownError: () => {
2415
- {
2416
- return StripeUnknownError;
2417
- }
2418
- },
2419
- StripeSignatureVerificationError: () => {
2420
- {
2421
- return StripeSignatureVerificationError;
2422
- }
2423
- },
2424
- StripeRateLimitError: () => {
2425
- {
2426
- return StripeRateLimitError;
2427
- }
2428
- },
2429
- StripePermissionError: () => {
2430
- {
2431
- return StripePermissionError;
2432
- }
2433
- },
2434
- StripeInvalidRequestError: () => {
2435
- {
2436
- return StripeInvalidRequestError;
2437
- }
2438
- },
2439
- StripeInvalidGrantError: () => {
2440
- {
2441
- return StripeInvalidGrantError;
2442
- }
2443
- },
2444
- StripeIdempotencyError: () => {
2445
- {
2446
- return StripeIdempotencyError;
2447
- }
2448
- },
2449
- StripeError: () => {
2450
- {
2451
- return StripeError;
2452
- }
2453
- },
2454
- StripeConnectionError: () => {
2455
- {
2456
- return StripeConnectionError;
2457
- }
2458
- },
2459
- StripeCardError: () => {
2460
- {
2461
- return StripeCardError;
2462
- }
2463
- },
2464
- StripeAuthenticationError: () => {
2465
- {
2466
- return StripeAuthenticationError;
2467
- }
2468
- },
2469
- StripeAPIError: () => {
2470
- {
2471
- return StripeAPIError;
2472
- }
2473
- }
2341
+ generate: () => generate,
2342
+ StripeUnknownError: () => StripeUnknownError,
2343
+ StripeSignatureVerificationError: () => StripeSignatureVerificationError,
2344
+ StripeRateLimitError: () => StripeRateLimitError,
2345
+ StripePermissionError: () => StripePermissionError,
2346
+ StripeInvalidRequestError: () => StripeInvalidRequestError,
2347
+ StripeInvalidGrantError: () => StripeInvalidGrantError,
2348
+ StripeIdempotencyError: () => StripeIdempotencyError,
2349
+ StripeError: () => StripeError,
2350
+ StripeConnectionError: () => StripeConnectionError,
2351
+ StripeCardError: () => StripeCardError,
2352
+ StripeAuthenticationError: () => StripeAuthenticationError,
2353
+ StripeAPIError: () => StripeAPIError
2474
2354
  });
2475
2355
  var generate = (rawStripeError) => {
2476
2356
  switch (rawStripeError.type) {
@@ -2586,6 +2466,97 @@ class StripeUnknownError extends StripeError {
2586
2466
  }
2587
2467
  }
2588
2468
 
2469
+ // ../../../../node_modules/stripe/esm/apiVersion.js
2470
+ var ApiVersion = "2024-06-20";
2471
+
2472
+ // ../../../../node_modules/stripe/esm/resources.js
2473
+ var exports_resources = {};
2474
+ __export(exports_resources, {
2475
+ WebhookEndpoints: () => WebhookEndpoints,
2476
+ Treasury: () => Treasury,
2477
+ Transfers: () => Transfers,
2478
+ Topups: () => Topups,
2479
+ Tokens: () => Tokens2,
2480
+ TestHelpers: () => TestHelpers,
2481
+ Terminal: () => Terminal,
2482
+ TaxRates: () => TaxRates,
2483
+ TaxIds: () => TaxIds,
2484
+ TaxCodes: () => TaxCodes,
2485
+ Tax: () => Tax,
2486
+ Subscriptions: () => Subscriptions,
2487
+ SubscriptionSchedules: () => SubscriptionSchedules,
2488
+ SubscriptionItems: () => SubscriptionItems,
2489
+ Sources: () => Sources,
2490
+ Sigma: () => Sigma,
2491
+ ShippingRates: () => ShippingRates,
2492
+ SetupIntents: () => SetupIntents,
2493
+ SetupAttempts: () => SetupAttempts,
2494
+ Reviews: () => Reviews,
2495
+ Reporting: () => Reporting,
2496
+ Refunds: () => Refunds2,
2497
+ Radar: () => Radar,
2498
+ Quotes: () => Quotes,
2499
+ PromotionCodes: () => PromotionCodes,
2500
+ Products: () => Products2,
2501
+ Prices: () => Prices,
2502
+ Plans: () => Plans,
2503
+ Payouts: () => Payouts,
2504
+ PaymentMethods: () => PaymentMethods,
2505
+ PaymentMethodDomains: () => PaymentMethodDomains,
2506
+ PaymentMethodConfigurations: () => PaymentMethodConfigurations,
2507
+ PaymentLinks: () => PaymentLinks,
2508
+ PaymentIntents: () => PaymentIntents,
2509
+ OAuth: () => OAuth,
2510
+ Mandates: () => Mandates,
2511
+ Issuing: () => Issuing,
2512
+ Invoices: () => Invoices,
2513
+ InvoiceItems: () => InvoiceItems,
2514
+ Identity: () => Identity,
2515
+ Forwarding: () => Forwarding,
2516
+ FinancialConnections: () => FinancialConnections,
2517
+ Files: () => Files,
2518
+ FileLinks: () => FileLinks,
2519
+ ExchangeRates: () => ExchangeRates,
2520
+ Events: () => Events,
2521
+ EphemeralKeys: () => EphemeralKeys,
2522
+ Entitlements: () => Entitlements,
2523
+ Disputes: () => Disputes2,
2524
+ Customers: () => Customers2,
2525
+ CustomerSessions: () => CustomerSessions,
2526
+ CreditNotes: () => CreditNotes,
2527
+ Coupons: () => Coupons,
2528
+ CountrySpecs: () => CountrySpecs,
2529
+ ConfirmationTokens: () => ConfirmationTokens2,
2530
+ Climate: () => Climate,
2531
+ Checkout: () => Checkout,
2532
+ Charges: () => Charges,
2533
+ BillingPortal: () => BillingPortal,
2534
+ Billing: () => Billing,
2535
+ BalanceTransactions: () => BalanceTransactions,
2536
+ Balance: () => Balance,
2537
+ Apps: () => Apps,
2538
+ ApplicationFees: () => ApplicationFees,
2539
+ ApplePayDomains: () => ApplePayDomains,
2540
+ Accounts: () => Accounts2,
2541
+ AccountSessions: () => AccountSessions,
2542
+ AccountLinks: () => AccountLinks,
2543
+ Account: () => Accounts2
2544
+ });
2545
+
2546
+ // ../../../../node_modules/stripe/esm/ResourceNamespace.js
2547
+ var ResourceNamespace = function(stripe, resources) {
2548
+ for (const name in resources) {
2549
+ const camelCaseName = name[0].toLowerCase() + name.substring(1);
2550
+ const resource = new resources[name](stripe);
2551
+ this[camelCaseName] = resource;
2552
+ }
2553
+ };
2554
+ function resourceNamespace(namespace, resources) {
2555
+ return function(stripe) {
2556
+ return new ResourceNamespace(stripe, resources);
2557
+ };
2558
+ }
2559
+
2589
2560
  // ../../../../node_modules/stripe/esm/utils.js
2590
2561
  var qs = __toESM(require_lib(), 1);
2591
2562
  function isOptionsHash(o) {
@@ -2759,16 +2730,6 @@ function determineProcessUserAgentProperties() {
2759
2730
  platform: process.platform
2760
2731
  };
2761
2732
  }
2762
- function concat(arrays) {
2763
- const totalLength = arrays.reduce((len, array) => len + array.length, 0);
2764
- const merged = new Uint8Array(totalLength);
2765
- let offset = 0;
2766
- arrays.forEach((array) => {
2767
- merged.set(array, offset);
2768
- offset += array.length;
2769
- });
2770
- return merged;
2771
- }
2772
2733
  var OPTIONS_KEYS = [
2773
2734
  "apiKey",
2774
2735
  "idempotencyKey",
@@ -2793,460 +2754,6 @@ var makeURLInterpolator = (() => {
2793
2754
  };
2794
2755
  })();
2795
2756
 
2796
- // ../../../../node_modules/stripe/esm/platform/NodePlatformFunctions.js
2797
- import {exec} from "child_process";
2798
-
2799
- class StreamProcessingError extends StripeError {
2800
- }
2801
-
2802
- class NodePlatformFunctions extends PlatformFunctions {
2803
- constructor() {
2804
- super();
2805
- this._exec = exec;
2806
- this._UNAME_CACHE = null;
2807
- }
2808
- uuid4() {
2809
- if (crypto3.randomUUID) {
2810
- return crypto3.randomUUID();
2811
- }
2812
- return super.uuid4();
2813
- }
2814
- getUname() {
2815
- if (!this._UNAME_CACHE) {
2816
- this._UNAME_CACHE = new Promise((resolve, reject) => {
2817
- try {
2818
- this._exec("uname -a", (err, uname) => {
2819
- if (err) {
2820
- return resolve(null);
2821
- }
2822
- resolve(uname);
2823
- });
2824
- } catch (e) {
2825
- resolve(null);
2826
- }
2827
- });
2828
- }
2829
- return this._UNAME_CACHE;
2830
- }
2831
- secureCompare(a, b) {
2832
- if (!a || !b) {
2833
- throw new Error("secureCompare must receive two arguments");
2834
- }
2835
- if (a.length !== b.length) {
2836
- return false;
2837
- }
2838
- if (crypto3.timingSafeEqual) {
2839
- const textEncoder = new TextEncoder;
2840
- const aEncoded = textEncoder.encode(a);
2841
- const bEncoded = textEncoder.encode(b);
2842
- return crypto3.timingSafeEqual(aEncoded, bEncoded);
2843
- }
2844
- return super.secureCompare(a, b);
2845
- }
2846
- createEmitter() {
2847
- return new EventEmitter;
2848
- }
2849
- tryBufferData(data) {
2850
- if (!(data.file.data instanceof EventEmitter)) {
2851
- return Promise.resolve(data);
2852
- }
2853
- const bufferArray = [];
2854
- return new Promise((resolve, reject) => {
2855
- data.file.data.on("data", (line) => {
2856
- bufferArray.push(line);
2857
- }).once("end", () => {
2858
- const bufferData = Object.assign({}, data);
2859
- bufferData.file.data = concat(bufferArray);
2860
- resolve(bufferData);
2861
- }).on("error", (err) => {
2862
- reject(new StreamProcessingError({
2863
- message: "An error occurred while attempting to process the file for upload.",
2864
- detail: err
2865
- }));
2866
- });
2867
- });
2868
- }
2869
- createNodeHttpClient(agent) {
2870
- return new NodeHttpClient(agent);
2871
- }
2872
- createDefaultHttpClient() {
2873
- return new NodeHttpClient;
2874
- }
2875
- createNodeCryptoProvider() {
2876
- return new NodeCryptoProvider;
2877
- }
2878
- createDefaultCryptoProvider() {
2879
- return this.createNodeCryptoProvider();
2880
- }
2881
- }
2882
-
2883
- // ../../../../node_modules/stripe/esm/apiVersion.js
2884
- var ApiVersion = "2024-04-10";
2885
-
2886
- // ../../../../node_modules/stripe/esm/resources.js
2887
- var exports_resources = {};
2888
- __export(exports_resources, {
2889
- WebhookEndpoints: () => {
2890
- {
2891
- return WebhookEndpoints;
2892
- }
2893
- },
2894
- Treasury: () => {
2895
- {
2896
- return Treasury;
2897
- }
2898
- },
2899
- Transfers: () => {
2900
- {
2901
- return Transfers;
2902
- }
2903
- },
2904
- Topups: () => {
2905
- {
2906
- return Topups;
2907
- }
2908
- },
2909
- Tokens: () => {
2910
- {
2911
- return Tokens2;
2912
- }
2913
- },
2914
- TestHelpers: () => {
2915
- {
2916
- return TestHelpers;
2917
- }
2918
- },
2919
- Terminal: () => {
2920
- {
2921
- return Terminal;
2922
- }
2923
- },
2924
- TaxRates: () => {
2925
- {
2926
- return TaxRates;
2927
- }
2928
- },
2929
- TaxIds: () => {
2930
- {
2931
- return TaxIds;
2932
- }
2933
- },
2934
- TaxCodes: () => {
2935
- {
2936
- return TaxCodes;
2937
- }
2938
- },
2939
- Tax: () => {
2940
- {
2941
- return Tax;
2942
- }
2943
- },
2944
- Subscriptions: () => {
2945
- {
2946
- return Subscriptions;
2947
- }
2948
- },
2949
- SubscriptionSchedules: () => {
2950
- {
2951
- return SubscriptionSchedules;
2952
- }
2953
- },
2954
- SubscriptionItems: () => {
2955
- {
2956
- return SubscriptionItems;
2957
- }
2958
- },
2959
- Sources: () => {
2960
- {
2961
- return Sources;
2962
- }
2963
- },
2964
- Sigma: () => {
2965
- {
2966
- return Sigma;
2967
- }
2968
- },
2969
- ShippingRates: () => {
2970
- {
2971
- return ShippingRates;
2972
- }
2973
- },
2974
- SetupIntents: () => {
2975
- {
2976
- return SetupIntents;
2977
- }
2978
- },
2979
- SetupAttempts: () => {
2980
- {
2981
- return SetupAttempts;
2982
- }
2983
- },
2984
- Reviews: () => {
2985
- {
2986
- return Reviews;
2987
- }
2988
- },
2989
- Reporting: () => {
2990
- {
2991
- return Reporting;
2992
- }
2993
- },
2994
- Refunds: () => {
2995
- {
2996
- return Refunds2;
2997
- }
2998
- },
2999
- Radar: () => {
3000
- {
3001
- return Radar;
3002
- }
3003
- },
3004
- Quotes: () => {
3005
- {
3006
- return Quotes;
3007
- }
3008
- },
3009
- PromotionCodes: () => {
3010
- {
3011
- return PromotionCodes;
3012
- }
3013
- },
3014
- Products: () => {
3015
- {
3016
- return Products2;
3017
- }
3018
- },
3019
- Prices: () => {
3020
- {
3021
- return Prices;
3022
- }
3023
- },
3024
- Plans: () => {
3025
- {
3026
- return Plans;
3027
- }
3028
- },
3029
- Payouts: () => {
3030
- {
3031
- return Payouts;
3032
- }
3033
- },
3034
- PaymentMethods: () => {
3035
- {
3036
- return PaymentMethods;
3037
- }
3038
- },
3039
- PaymentMethodDomains: () => {
3040
- {
3041
- return PaymentMethodDomains;
3042
- }
3043
- },
3044
- PaymentMethodConfigurations: () => {
3045
- {
3046
- return PaymentMethodConfigurations;
3047
- }
3048
- },
3049
- PaymentLinks: () => {
3050
- {
3051
- return PaymentLinks;
3052
- }
3053
- },
3054
- PaymentIntents: () => {
3055
- {
3056
- return PaymentIntents;
3057
- }
3058
- },
3059
- OAuth: () => {
3060
- {
3061
- return OAuth;
3062
- }
3063
- },
3064
- Mandates: () => {
3065
- {
3066
- return Mandates;
3067
- }
3068
- },
3069
- Issuing: () => {
3070
- {
3071
- return Issuing;
3072
- }
3073
- },
3074
- Invoices: () => {
3075
- {
3076
- return Invoices;
3077
- }
3078
- },
3079
- InvoiceItems: () => {
3080
- {
3081
- return InvoiceItems;
3082
- }
3083
- },
3084
- Identity: () => {
3085
- {
3086
- return Identity;
3087
- }
3088
- },
3089
- Forwarding: () => {
3090
- {
3091
- return Forwarding;
3092
- }
3093
- },
3094
- FinancialConnections: () => {
3095
- {
3096
- return FinancialConnections;
3097
- }
3098
- },
3099
- Files: () => {
3100
- {
3101
- return Files;
3102
- }
3103
- },
3104
- FileLinks: () => {
3105
- {
3106
- return FileLinks;
3107
- }
3108
- },
3109
- ExchangeRates: () => {
3110
- {
3111
- return ExchangeRates;
3112
- }
3113
- },
3114
- Events: () => {
3115
- {
3116
- return Events;
3117
- }
3118
- },
3119
- EphemeralKeys: () => {
3120
- {
3121
- return EphemeralKeys;
3122
- }
3123
- },
3124
- Entitlements: () => {
3125
- {
3126
- return Entitlements;
3127
- }
3128
- },
3129
- Disputes: () => {
3130
- {
3131
- return Disputes2;
3132
- }
3133
- },
3134
- Customers: () => {
3135
- {
3136
- return Customers2;
3137
- }
3138
- },
3139
- CustomerSessions: () => {
3140
- {
3141
- return CustomerSessions;
3142
- }
3143
- },
3144
- CreditNotes: () => {
3145
- {
3146
- return CreditNotes;
3147
- }
3148
- },
3149
- Coupons: () => {
3150
- {
3151
- return Coupons;
3152
- }
3153
- },
3154
- CountrySpecs: () => {
3155
- {
3156
- return CountrySpecs;
3157
- }
3158
- },
3159
- ConfirmationTokens: () => {
3160
- {
3161
- return ConfirmationTokens2;
3162
- }
3163
- },
3164
- Climate: () => {
3165
- {
3166
- return Climate;
3167
- }
3168
- },
3169
- Checkout: () => {
3170
- {
3171
- return Checkout;
3172
- }
3173
- },
3174
- Charges: () => {
3175
- {
3176
- return Charges;
3177
- }
3178
- },
3179
- BillingPortal: () => {
3180
- {
3181
- return BillingPortal;
3182
- }
3183
- },
3184
- Billing: () => {
3185
- {
3186
- return Billing;
3187
- }
3188
- },
3189
- BalanceTransactions: () => {
3190
- {
3191
- return BalanceTransactions;
3192
- }
3193
- },
3194
- Balance: () => {
3195
- {
3196
- return Balance;
3197
- }
3198
- },
3199
- Apps: () => {
3200
- {
3201
- return Apps;
3202
- }
3203
- },
3204
- ApplicationFees: () => {
3205
- {
3206
- return ApplicationFees;
3207
- }
3208
- },
3209
- ApplePayDomains: () => {
3210
- {
3211
- return ApplePayDomains;
3212
- }
3213
- },
3214
- Accounts: () => {
3215
- {
3216
- return Accounts2;
3217
- }
3218
- },
3219
- AccountSessions: () => {
3220
- {
3221
- return AccountSessions;
3222
- }
3223
- },
3224
- AccountLinks: () => {
3225
- {
3226
- return AccountLinks;
3227
- }
3228
- },
3229
- Account: () => {
3230
- {
3231
- return Accounts2;
3232
- }
3233
- }
3234
- });
3235
-
3236
- // ../../../../node_modules/stripe/esm/ResourceNamespace.js
3237
- var ResourceNamespace = function(stripe, resources) {
3238
- for (const name in resources) {
3239
- const camelCaseName = name[0].toLowerCase() + name.substring(1);
3240
- const resource = new resources[name](stripe);
3241
- this[camelCaseName] = resource;
3242
- }
3243
- };
3244
- function resourceNamespace(namespace, resources) {
3245
- return function(stripe) {
3246
- return new ResourceNamespace(stripe, resources);
3247
- };
3248
- }
3249
-
3250
2757
  // ../../../../node_modules/stripe/esm/autoPagination.js
3251
2758
  var getAsyncIteratorSymbol = function() {
3252
2759
  if (typeof Symbol !== "undefined" && Symbol.asyncIterator) {
@@ -3645,6 +3152,10 @@ var Authorizations = StripeResource.extend({
3645
3152
  method: "POST",
3646
3153
  fullPath: "/v1/test_helpers/issuing/authorizations/{authorization}/expire"
3647
3154
  }),
3155
+ finalizeAmount: stripeMethod4({
3156
+ method: "POST",
3157
+ fullPath: "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount"
3158
+ }),
3648
3159
  increment: stripeMethod4({
3649
3160
  method: "POST",
3650
3161
  fullPath: "/v1/test_helpers/issuing/authorizations/{authorization}/increment"
@@ -5251,6 +4762,10 @@ var Invoices = StripeResource.extend({
5251
4762
  methodType: "list"
5252
4763
  }),
5253
4764
  del: stripeMethod87({ method: "DELETE", fullPath: "/v1/invoices/{invoice}" }),
4765
+ addLines: stripeMethod87({
4766
+ method: "POST",
4767
+ fullPath: "/v1/invoices/{invoice}/add_lines"
4768
+ }),
5254
4769
  createPreview: stripeMethod87({
5255
4770
  method: "POST",
5256
4771
  fullPath: "/v1/invoices/create_preview"
@@ -5274,6 +4789,10 @@ var Invoices = StripeResource.extend({
5274
4789
  fullPath: "/v1/invoices/{invoice}/mark_uncollectible"
5275
4790
  }),
5276
4791
  pay: stripeMethod87({ method: "POST", fullPath: "/v1/invoices/{invoice}/pay" }),
4792
+ removeLines: stripeMethod87({
4793
+ method: "POST",
4794
+ fullPath: "/v1/invoices/{invoice}/remove_lines"
4795
+ }),
5277
4796
  retrieveUpcoming: stripeMethod87({
5278
4797
  method: "GET",
5279
4798
  fullPath: "/v1/invoices/upcoming"
@@ -5287,6 +4806,10 @@ var Invoices = StripeResource.extend({
5287
4806
  method: "POST",
5288
4807
  fullPath: "/v1/invoices/{invoice}/send"
5289
4808
  }),
4809
+ updateLines: stripeMethod87({
4810
+ method: "POST",
4811
+ fullPath: "/v1/invoices/{invoice}/update_lines"
4812
+ }),
5290
4813
  updateLineItem: stripeMethod87({
5291
4814
  method: "POST",
5292
4815
  fullPath: "/v1/invoices/{invoice}/lines/{line_item_id}"
@@ -6378,16 +5901,16 @@ function createWebhooks(platformFunctions) {
6378
5901
  }
6379
5902
  function validateComputedSignature(payload, header, details, expectedSignature, tolerance, suspectPayloadType, secretContainsWhitespace, receivedAt) {
6380
5903
  const signatureFound = !!details.signatures.filter(platformFunctions.secureCompare.bind(platformFunctions, expectedSignature)).length;
6381
- const docsLocation = "\nLearn more about webhook signing and explore webhook integration examples for various frameworks at https://github.com/stripe/stripe-node#webhook-signing";
5904
+ const docsLocation = "\nLearn more about webhook signing and explore webhook integration examples for various frameworks at " + "https://github.com/stripe/stripe-node#webhook-signing";
6382
5905
  const whitespaceMessage = secretContainsWhitespace ? "\n\nNote: The provided signing secret contains whitespace. This often indicates an extra newline or space is in the value" : "";
6383
5906
  if (!signatureFound) {
6384
5907
  if (suspectPayloadType) {
6385
5908
  throw new StripeSignatureVerificationError(header, payload, {
6386
- message: "Webhook payload must be provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body.Payload was provided as a parsed JavaScript object instead. \nSignature verification is impossible without access to the original signed material. \n" + docsLocation + "\n" + whitespaceMessage
5909
+ message: "Webhook payload must be provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body." + "Payload was provided as a parsed JavaScript object instead. \n" + "Signature verification is impossible without access to the original signed material. \n" + docsLocation + "\n" + whitespaceMessage
6387
5910
  });
6388
5911
  }
6389
5912
  throw new StripeSignatureVerificationError(header, payload, {
6390
- message: "No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? \n If a webhook request is being forwarded by a third-party tool, ensure that the exact request body, including JSON formatting and new line style, is preserved.\n" + docsLocation + "\n" + whitespaceMessage
5913
+ message: "No signatures found matching the expected signature for payload." + " Are you passing the raw request body you received from Stripe? \n" + " If a webhook request is being forwarded by a third-party tool," + " ensure that the exact request body, including JSON formatting and new line style, is preserved.\n" + docsLocation + "\n" + whitespaceMessage
6391
5914
  });
6392
5915
  }
6393
5916
  const timestampAge = Math.floor((typeof receivedAt === "number" ? receivedAt : Date.now()) / 1000) - details.timestamp;
@@ -6429,7 +5952,7 @@ function createWebhooks(platformFunctions) {
6429
5952
 
6430
5953
  // ../../../../node_modules/stripe/esm/stripe.core.js
6431
5954
  function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
6432
- Stripe.PACKAGE_VERSION = "15.9.0";
5955
+ Stripe.PACKAGE_VERSION = "16.2.0";
6433
5956
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: "node", publisher: "stripe", uname: null, typescript: false }, determineProcessUserAgentProperties());
6434
5957
  Stripe.StripeResource = StripeResource;
6435
5958
  Stripe.resources = exports_resources;
@@ -6661,13 +6184,13 @@ var ALLOWED_CONFIG_PROPERTIES = [
6661
6184
  ];
6662
6185
  var defaultRequestSenderFactory = (stripe) => new RequestSender(stripe, StripeResource.MAX_BUFFERED_REQUEST_METRICS);
6663
6186
 
6664
- // ../../../../node_modules/stripe/esm/stripe.esm.node.js
6665
- var Stripe = createStripe(new NodePlatformFunctions);
6666
- var stripe_esm_node_default = Stripe;
6187
+ // ../../../../node_modules/stripe/esm/stripe.esm.worker.js
6188
+ var Stripe = createStripe(new WebPlatformFunctions);
6189
+ var stripe_esm_worker_default = Stripe;
6667
6190
 
6668
6191
  // src/drivers/stripe.ts
6669
6192
  var apiKey = "";
6670
- var stripe = new stripe_esm_node_default(apiKey, {
6193
+ var stripe = new stripe_esm_worker_default(apiKey, {
6671
6194
  apiVersion: "2023-10-16"
6672
6195
  });
6673
6196
  var paymentIntent = (() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/payments",
3
3
  "type": "module",
4
- "version": "0.61.24",
4
+ "version": "0.62.0",
5
5
  "description": "The Stacks payments package. Currently supporting Stripe.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@stacksjs/utils": "latest",
54
- "@stripe/stripe-js": "^3.5.0",
55
- "stripe": "^15.9.0"
54
+ "@stripe/stripe-js": "^4.1.0",
55
+ "stripe": "^16.2.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@stacksjs/config": "latest",