@djangocfg/payments 2.1.457 → 2.1.459

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/README.md CHANGED
@@ -23,8 +23,8 @@ import { PaymentProvider, createMockPaymentAdapter } from '@djangocfg/payments';
23
23
  Swapping to real Stripe is a one-line host change:
24
24
 
25
25
  ```tsx
26
- import { loadStripe } from '@stripe/stripe-js';
27
- import { PaymentProvider, createStripeAdapter } from '@djangocfg/payments';
26
+ // loadStripe is re-exported by this package — the host never declares @stripe/*.
27
+ import { PaymentProvider, createStripeAdapter, loadStripe } from '@djangocfg/payments';
28
28
 
29
29
  const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PK!); // once, module scope
30
30
  const adapter = createStripeAdapter({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/payments",
3
- "version": "2.1.457",
3
+ "version": "2.1.459",
4
4
  "description": "Provider-agnostic React payments module (Stripe-first): checkout state machine, Payment Element wrapper, close-guard context, mock adapter for keyless development",
5
5
  "keywords": [
6
6
  "payments",
@@ -53,8 +53,8 @@
53
53
  "@stripe/stripe-js": "^9.9.0"
54
54
  },
55
55
  "peerDependencies": {
56
- "@djangocfg/ui-core": "^2.1.457",
57
- "@djangocfg/ui-tools": "^2.1.457",
56
+ "@djangocfg/ui-core": "^2.1.459",
57
+ "@djangocfg/ui-tools": "^2.1.459",
58
58
  "lucide-react": "^0.545.0",
59
59
  "react": "^19.2.4",
60
60
  "react-dom": "^19.2.4"
@@ -65,9 +65,9 @@
65
65
  }
66
66
  },
67
67
  "devDependencies": {
68
- "@djangocfg/typescript-config": "^2.1.457",
69
- "@djangocfg/ui-core": "^2.1.457",
70
- "@djangocfg/ui-tools": "^2.1.457",
68
+ "@djangocfg/typescript-config": "^2.1.459",
69
+ "@djangocfg/ui-core": "^2.1.459",
70
+ "@djangocfg/ui-tools": "^2.1.459",
71
71
  "@types/node": "^25.2.3",
72
72
  "@types/react": "^19.2.15",
73
73
  "@types/react-dom": "^19.2.3",
package/src/index.ts CHANGED
@@ -23,9 +23,12 @@ export {
23
23
  } from './context/CheckoutGuard';
24
24
 
25
25
  // Transport adapters (mock + stripe)
26
+ // `loadStripe` / `Stripe` are re-exported so hosts never declare @stripe/*
27
+ // themselves (the SDK is this package's dependency).
26
28
  export {
27
29
  createMockPaymentAdapter,
28
30
  createStripeAdapter,
31
+ loadStripe,
29
32
  } from './transport';
30
33
  export type {
31
34
  MockAdapterConfig,
@@ -33,6 +36,7 @@ export type {
33
36
  StripeAdapterConfig,
34
37
  BackendIntent,
35
38
  BackendSubscription,
39
+ Stripe,
36
40
  } from './transport';
37
41
 
38
42
  // Hooks
@@ -5,9 +5,10 @@
5
5
  export { createMockPaymentAdapter } from './mock-adapter';
6
6
  export type { MockAdapterConfig, MockOutcome } from './mock-adapter';
7
7
 
8
- export { createStripeAdapter } from './stripe-adapter';
8
+ export { createStripeAdapter, loadStripe } from './stripe-adapter';
9
9
  export type {
10
10
  StripeAdapterConfig,
11
11
  BackendIntent,
12
12
  BackendSubscription,
13
+ Stripe,
13
14
  } from './stripe-adapter';
@@ -10,6 +10,12 @@
10
10
  // reads env vars or imports the generated API client.
11
11
 
12
12
  import type { Stripe, StripeElements } from '@stripe/stripe-js';
13
+
14
+ // Re-exported so hosts can build their memoized `getStripe()` without
15
+ // declaring @stripe/stripe-js themselves — the SDK stays this package's
16
+ // dependency and the "only 2 files import @stripe/*" rule holds.
17
+ export { loadStripe } from '@stripe/stripe-js';
18
+ export type { Stripe } from '@stripe/stripe-js';
13
19
  import type {
14
20
  ConfirmArgs,
15
21
  ConfirmResult,