@molecule/api-payments-stripe 1.0.2 → 1.1.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.
package/README.md CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-08-15T19:33:01.573Z
6
+ Generated: 2026-08-16T18:13:51.310Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-payments-stripe
@@ -21,7 +21,7 @@ Stripe payment provider for molecule.dev.
21
21
  ## Installation
22
22
 
23
23
  ```bash
24
- npm install @molecule/api-payments-stripe @molecule/api-bond @molecule/api-i18n @molecule/api-jwt @molecule/api-payments @molecule/api-secrets stripe
24
+ npm install @molecule/api-payments-stripe @molecule/api-bond @molecule/api-i18n @molecule/api-jwt @molecule/api-payments @molecule/api-proxy-agent @molecule/api-secrets stripe
25
25
  ```
26
26
 
27
27
  ## API
@@ -444,6 +444,62 @@ function cancelSubscription(subscriptionId: string): Promise<SubscriptionResult>
444
444
 
445
445
  **Returns:** The canceled subscription result.
446
446
 
447
+ #### `chargeOffSession(options)`
448
+
449
+ Charges a customer's saved card OFF-SESSION for a fixed amount — the
450
+ PREPAID top-up primitive (the customer is not present to authenticate).
451
+
452
+ Distinct from {@link reportUsageOverage} in the property that matters:
453
+ `reportUsageOverage` records an amount to be collected LATER on an invoice,
454
+ so the money is a receivable until the cycle closes. This CAPTURES the money
455
+ now and reports whether it actually settled, which is what makes a prepaid
456
+ balance prepaid. Only credit a balance on `status: 'succeeded'`.
457
+
458
+ A saved card is required: the charge uses the customer's `invoice_settings.
459
+ default_payment_method`, falling back to their most recent attached card.
460
+ With `off_session: true` + `confirm: true`, Stripe either settles the payment
461
+ or fails — it never returns a client-side flow the absent customer could
462
+ complete. A card that demands 3DS therefore surfaces as
463
+ `status: 'requires_action'`, which callers MUST treat as a failure and
464
+ resolve by asking the customer to re-authenticate on-session.
465
+
466
+ IDEMPOTENCY: the caller MUST pass a stable `idempotencyKey`. A retry inside
467
+ Stripe's 24h idempotency window returns the ORIGINAL PaymentIntent rather
468
+ than charging again — the property that makes an auto-refill retry safe.
469
+
470
+ This function performs NO gating of its own — it charges what it is told to.
471
+ Whether a top-up is permitted (balance low? refill cap? velocity?) is the
472
+ consuming application's decision.
473
+
474
+ ```typescript
475
+ function chargeOffSession(options: {
476
+ customerId: string
477
+ amountCents: number
478
+ currency?: string
479
+ paymentMethodId?: string
480
+ description?: string
481
+ metadata?: Record<string, string>
482
+ idempotencyKey: string
483
+ }): Promise<{
484
+ id: string | null
485
+ status: 'succeeded' | 'requires_action' | 'failed'
486
+ amountCents: number
487
+ declineCode?: string
488
+ failureMessage?: string
489
+ }>
490
+ ```
491
+
492
+ - `options` — Off-session charge options.
493
+ - `options.customerId` — The Stripe customer to charge (`cus_...`).
494
+ - `options.amountCents` — The amount to capture in cents (must be `> 0`).
495
+ - `options.currency` — ISO currency (defaults to `usd`).
496
+ - `options.paymentMethodId` — Explicit payment method; defaults to the customer's default card, then their most recently attached card.
497
+ - `options.description` — Human-readable statement/line description.
498
+ - `options.metadata` — Reconciliation metadata (e.g. userId, period).
499
+ - `options.idempotencyKey` — REQUIRED stable key (see IDEMPOTENCY above).
500
+
501
+ **Returns:** The PaymentIntent id, the normalized outcome, the amount actually captured (0 unless settled), and a decline code/reason when it did not.
502
+
447
503
  #### `createAccountLink(params)`
448
504
 
449
505
  Creates a Stripe account link the connected account holder uses to finish
@@ -816,7 +872,7 @@ Peer dependencies:
816
872
 
817
873
  - `@molecule/api-bond` ^1.0.1
818
874
  - `@molecule/api-i18n` ^1.0.1
819
- - `@molecule/api-payments` ^1.0.1
875
+ - `@molecule/api-payments` ^1.1.0
820
876
  - `@molecule/api-jwt` ^1.0.1
821
877
  - `@molecule/api-secrets` ^1.0.1
822
878
 
@@ -837,6 +893,7 @@ Peer dependencies:
837
893
  - `@molecule/api-i18n`
838
894
  - `@molecule/api-jwt`
839
895
  - `@molecule/api-payments`
896
+ - `@molecule/api-proxy-agent`
840
897
  - `@molecule/api-secrets`
841
898
  - `stripe`
842
899
 
@@ -906,6 +963,15 @@ own catch block) can tell "the operator forgot to set the secret" apart from
906
963
  "this subscription/card is invalid" and surface the actionable 503 instead of
907
964
  a generic 400/500.
908
965
 
966
+ **Runs behind an outbound proxy when `HTTPS_PROXY` is set.** The `stripe` SDK
967
+ builds its own agent and reads no proxy variable, so on a host whose only
968
+ egress path is a proxy every call used to fail with a bare connection error.
969
+ This bond now passes a CONNECT-capable agent into the SDK's `httpAgent` hook
970
+ (`@molecule/api-proxy-agent`, resolved against `https://api.stripe.com` so
971
+ `NO_PROXY` is honoured). With no proxy configured nothing is passed and the
972
+ SDK keeps its own default agent — a standalone app behaves exactly as before.
973
+ Allowlist `api.stripe.com` on the proxy.
974
+
909
975
  ## E2E Tests
910
976
 
911
977
  Integration checklist — drive the real UI (live preview, no mocks; use the
package/dist/index.d.ts CHANGED
@@ -70,6 +70,15 @@
70
70
  * "this subscription/card is invalid" and surface the actionable 503 instead of
71
71
  * a generic 400/500.
72
72
  *
73
+ * **Runs behind an outbound proxy when `HTTPS_PROXY` is set.** The `stripe` SDK
74
+ * builds its own agent and reads no proxy variable, so on a host whose only
75
+ * egress path is a proxy every call used to fail with a bare connection error.
76
+ * This bond now passes a CONNECT-capable agent into the SDK's `httpAgent` hook
77
+ * (`@molecule/api-proxy-agent`, resolved against `https://api.stripe.com` so
78
+ * `NO_PROXY` is honoured). With no proxy configured nothing is passed and the
79
+ * SDK keeps its own default agent — a standalone app behaves exactly as before.
80
+ * Allowlist `api.stripe.com` on the proxy.
81
+ *
73
82
  * @module
74
83
  */
75
84
  export * from './bondAdapter.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AAEH,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AAEH,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -70,6 +70,15 @@
70
70
  * "this subscription/card is invalid" and surface the actionable 503 instead of
71
71
  * a generic 400/500.
72
72
  *
73
+ * **Runs behind an outbound proxy when `HTTPS_PROXY` is set.** The `stripe` SDK
74
+ * builds its own agent and reads no proxy variable, so on a host whose only
75
+ * egress path is a proxy every call used to fail with a bare connection error.
76
+ * This bond now passes a CONNECT-capable agent into the SDK's `httpAgent` hook
77
+ * (`@molecule/api-proxy-agent`, resolved against `https://api.stripe.com` so
78
+ * `NO_PROXY` is honoured). With no proxy configured nothing is passed and the
79
+ * SDK keeps its own default agent — a standalone app behaves exactly as before.
80
+ * Allowlist `api.stripe.com` on the proxy.
81
+ *
73
82
  * @module
74
83
  */
75
84
  export * from './bondAdapter.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AAEH,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AAEH,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
@@ -190,6 +190,59 @@ export declare const reportUsageOverage: (options: {
190
190
  id: string;
191
191
  amountCents: number;
192
192
  }>;
193
+ /**
194
+ * Charges a customer's saved card OFF-SESSION for a fixed amount — the
195
+ * PREPAID top-up primitive (the customer is not present to authenticate).
196
+ *
197
+ * Distinct from {@link reportUsageOverage} in the property that matters:
198
+ * `reportUsageOverage` records an amount to be collected LATER on an invoice,
199
+ * so the money is a receivable until the cycle closes. This CAPTURES the money
200
+ * now and reports whether it actually settled, which is what makes a prepaid
201
+ * balance prepaid. Only credit a balance on `status: 'succeeded'`.
202
+ *
203
+ * A saved card is required: the charge uses the customer's `invoice_settings.
204
+ * default_payment_method`, falling back to their most recent attached card.
205
+ * With `off_session: true` + `confirm: true`, Stripe either settles the payment
206
+ * or fails — it never returns a client-side flow the absent customer could
207
+ * complete. A card that demands 3DS therefore surfaces as
208
+ * `status: 'requires_action'`, which callers MUST treat as a failure and
209
+ * resolve by asking the customer to re-authenticate on-session.
210
+ *
211
+ * IDEMPOTENCY: the caller MUST pass a stable `idempotencyKey`. A retry inside
212
+ * Stripe's 24h idempotency window returns the ORIGINAL PaymentIntent rather
213
+ * than charging again — the property that makes an auto-refill retry safe.
214
+ *
215
+ * This function performs NO gating of its own — it charges what it is told to.
216
+ * Whether a top-up is permitted (balance low? refill cap? velocity?) is the
217
+ * consuming application's decision.
218
+ *
219
+ * @param options - Off-session charge options.
220
+ * @param options.customerId - The Stripe customer to charge (`cus_...`).
221
+ * @param options.amountCents - The amount to capture in cents (must be `> 0`).
222
+ * @param options.currency - ISO currency (defaults to `usd`).
223
+ * @param options.paymentMethodId - Explicit payment method; defaults to the
224
+ * customer's default card, then their most recently attached card.
225
+ * @param options.description - Human-readable statement/line description.
226
+ * @param options.metadata - Reconciliation metadata (e.g. userId, period).
227
+ * @param options.idempotencyKey - REQUIRED stable key (see IDEMPOTENCY above).
228
+ * @returns The PaymentIntent id, the normalized outcome, the amount actually
229
+ * captured (0 unless settled), and a decline code/reason when it did not.
230
+ */
231
+ export declare const chargeOffSession: (options: {
232
+ customerId: string;
233
+ amountCents: number;
234
+ currency?: string;
235
+ paymentMethodId?: string;
236
+ description?: string;
237
+ metadata?: Record<string, string>;
238
+ idempotencyKey: string;
239
+ }) => Promise<{
240
+ id: string | null;
241
+ status: "succeeded" | "requires_action" | "failed";
242
+ amountCents: number;
243
+ declineCode?: string;
244
+ failureMessage?: string;
245
+ }>;
193
246
  /**
194
247
  * Maps a raw Stripe subscription status string (e.g. `past_due`, `incomplete`)
195
248
  * to the provider-agnostic `SubscriptionStatus`.
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAA;AAO3B,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAGxF,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,YAAY,CAAA;AASnB;;;;GAIG;AACH,eAAO,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AW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,cAAc,EAAE,MAAM,CAAA;CACvB,KAAG,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAmB9C,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,gBAAgB,GAAU,SAAS;IAC9C,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,cAAc,EAAE,MAAM,CAAA;CACvB,KAAG,OAAO,CAAC;IACV,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IACjB,MAAM,EAAE,WAAW,GAAG,iBAAiB,GAAG,QAAQ,CAAA;IAClD,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CA4FA,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GAAI,WAAW,MAAM,GAAG,SAAS,KAAG,kBAa3E,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,cAAc,kBAAkB,KAAG,sBAaxE,CAAA"}
package/dist/provider.js CHANGED
@@ -12,7 +12,16 @@ const logger = getLogger();
12
12
  // runtime registry is populated even when provider.js is imported directly
13
13
  // (not through the package barrel).
14
14
  import './secrets.js';
15
+ import { getProxyAgent } from '@molecule/api-proxy-agent';
15
16
  import { configNotConfiguredError } from '@molecule/api-secrets';
17
+ /**
18
+ * The Stripe REST endpoint every request in this bond goes to.
19
+ *
20
+ * Only used to resolve the outbound proxy: the target URL is what decides which
21
+ * proxy variable applies and whether `NO_PROXY` exempts the host, so it has to
22
+ * be the real endpoint rather than a placeholder.
23
+ */
24
+ const STRIPE_API_URL = 'https://api.stripe.com';
16
25
  /**
17
26
  * The lazily-initialized `Stripe` instance.
18
27
  *
@@ -35,11 +44,24 @@ export const getClient = () => {
35
44
  // they're trying to upgrade to a paid plan.
36
45
  throw configNotConfiguredError('STRIPE_SECRET_KEY', 'payments');
37
46
  }
47
+ // The Stripe SDK builds its own `https.Agent` and does NOT read
48
+ // HTTPS_PROXY/NO_PROXY — `NODE_USE_ENV_PROXY` does not reach it either,
49
+ // because it never goes through Node's proxy-aware paths. On a workstation
50
+ // that direct dial to api.stripe.com succeeds, so the gap is invisible; in
51
+ // an environment whose only egress path is a proxy (a molecule.dev sandbox,
52
+ // a deployed molecule.dev app) every call failed with a bare connection
53
+ // error. `httpAgent` is the SDK's own hook for exactly this. Undefined when
54
+ // no proxy is configured, so a standalone app is unaffected.
55
+ const httpAgent = getProxyAgent(STRIPE_API_URL);
38
56
  // Bound each request: Stripe's SDK default is an 80s timeout with automatic
39
57
  // retries, so a Stripe slowdown during a signup/upgrade surge would pin
40
58
  // request workers for over a minute each and cascade into a pool/worker
41
59
  // exhaustion outage. Cap at 15s with two retries.
42
- _client = new Stripe(key, { timeout: 15_000, maxNetworkRetries: 2 });
60
+ _client = new Stripe(key, {
61
+ timeout: 15_000,
62
+ maxNetworkRetries: 2,
63
+ ...(httpAgent ? { httpAgent } : {}),
64
+ });
43
65
  }
44
66
  return _client;
45
67
  };
@@ -374,6 +396,134 @@ export const reportUsageOverage = async (options) => {
374
396
  throw error;
375
397
  }
376
398
  };
399
+ /**
400
+ * Charges a customer's saved card OFF-SESSION for a fixed amount — the
401
+ * PREPAID top-up primitive (the customer is not present to authenticate).
402
+ *
403
+ * Distinct from {@link reportUsageOverage} in the property that matters:
404
+ * `reportUsageOverage` records an amount to be collected LATER on an invoice,
405
+ * so the money is a receivable until the cycle closes. This CAPTURES the money
406
+ * now and reports whether it actually settled, which is what makes a prepaid
407
+ * balance prepaid. Only credit a balance on `status: 'succeeded'`.
408
+ *
409
+ * A saved card is required: the charge uses the customer's `invoice_settings.
410
+ * default_payment_method`, falling back to their most recent attached card.
411
+ * With `off_session: true` + `confirm: true`, Stripe either settles the payment
412
+ * or fails — it never returns a client-side flow the absent customer could
413
+ * complete. A card that demands 3DS therefore surfaces as
414
+ * `status: 'requires_action'`, which callers MUST treat as a failure and
415
+ * resolve by asking the customer to re-authenticate on-session.
416
+ *
417
+ * IDEMPOTENCY: the caller MUST pass a stable `idempotencyKey`. A retry inside
418
+ * Stripe's 24h idempotency window returns the ORIGINAL PaymentIntent rather
419
+ * than charging again — the property that makes an auto-refill retry safe.
420
+ *
421
+ * This function performs NO gating of its own — it charges what it is told to.
422
+ * Whether a top-up is permitted (balance low? refill cap? velocity?) is the
423
+ * consuming application's decision.
424
+ *
425
+ * @param options - Off-session charge options.
426
+ * @param options.customerId - The Stripe customer to charge (`cus_...`).
427
+ * @param options.amountCents - The amount to capture in cents (must be `> 0`).
428
+ * @param options.currency - ISO currency (defaults to `usd`).
429
+ * @param options.paymentMethodId - Explicit payment method; defaults to the
430
+ * customer's default card, then their most recently attached card.
431
+ * @param options.description - Human-readable statement/line description.
432
+ * @param options.metadata - Reconciliation metadata (e.g. userId, period).
433
+ * @param options.idempotencyKey - REQUIRED stable key (see IDEMPOTENCY above).
434
+ * @returns The PaymentIntent id, the normalized outcome, the amount actually
435
+ * captured (0 unless settled), and a decline code/reason when it did not.
436
+ */
437
+ export const chargeOffSession = async (options) => {
438
+ const amount = Math.round(options.amountCents);
439
+ if (!Number.isFinite(amount) || amount <= 0) {
440
+ throw new Error('chargeOffSession requires a positive amountCents');
441
+ }
442
+ const client = getClient();
443
+ // Resolve the card to charge. Off-session confirmation cannot prompt the
444
+ // customer to pick one, so an unresolvable payment method is a failure to
445
+ // report — never an implicit "charge whatever Stripe finds".
446
+ let paymentMethodId = options.paymentMethodId;
447
+ if (!paymentMethodId) {
448
+ try {
449
+ const customer = await client.customers.retrieve(options.customerId);
450
+ if (!customer.deleted) {
451
+ const defaultPm = customer.invoice_settings?.default_payment_method;
452
+ paymentMethodId = typeof defaultPm === 'string' ? defaultPm : (defaultPm?.id ?? undefined);
453
+ }
454
+ }
455
+ catch (error) {
456
+ logger.error('Error resolving Stripe default payment method:', error);
457
+ }
458
+ }
459
+ if (!paymentMethodId) {
460
+ const methods = await client.paymentMethods.list({
461
+ customer: options.customerId,
462
+ type: 'card',
463
+ limit: 1,
464
+ });
465
+ paymentMethodId = methods.data[0]?.id;
466
+ }
467
+ if (!paymentMethodId) {
468
+ return {
469
+ id: null,
470
+ status: 'failed',
471
+ amountCents: 0,
472
+ failureMessage: 'No saved card on file for this customer.',
473
+ };
474
+ }
475
+ try {
476
+ const intent = await client.paymentIntents.create({
477
+ customer: options.customerId,
478
+ amount,
479
+ currency: options.currency ?? 'usd',
480
+ payment_method: paymentMethodId,
481
+ // The absent-customer contract: confirm immediately, and never hand
482
+ // back a redirect/next-action the customer is not there to complete.
483
+ off_session: true,
484
+ confirm: true,
485
+ automatic_payment_methods: { enabled: true, allow_redirects: 'never' },
486
+ description: options.description,
487
+ metadata: options.metadata,
488
+ }, { idempotencyKey: options.idempotencyKey });
489
+ if (intent.status === 'succeeded') {
490
+ return { id: intent.id, status: 'succeeded', amountCents: intent.amount_received || amount };
491
+ }
492
+ // Anything short of settled is NOT money: report it as such so the caller
493
+ // cannot mistake an authentication prompt for a captured payment.
494
+ return {
495
+ id: intent.id,
496
+ status: intent.status === 'requires_action' ? 'requires_action' : 'failed',
497
+ amountCents: 0,
498
+ failureMessage: intent.last_payment_error?.message,
499
+ ...(intent.last_payment_error?.decline_code
500
+ ? { declineCode: intent.last_payment_error.decline_code }
501
+ : {}),
502
+ };
503
+ }
504
+ catch (error) {
505
+ // A declined off-session charge arrives as a thrown StripeCardError whose
506
+ // payload carries the intent — a normal, expected outcome (an expired or
507
+ // insufficient-funds card), so it is reported, not re-thrown.
508
+ if (error instanceof Stripe.errors.StripeCardError) {
509
+ const intent = error.payment_intent;
510
+ logger.warn('Stripe off-session charge declined', {
511
+ code: error.code,
512
+ declineCode: error.decline_code,
513
+ });
514
+ return {
515
+ id: intent?.id ?? null,
516
+ status: intent?.status === 'requires_action' ? 'requires_action' : 'failed',
517
+ amountCents: 0,
518
+ ...(error.decline_code ? { declineCode: error.decline_code } : {}),
519
+ failureMessage: error.message,
520
+ };
521
+ }
522
+ // Never log the customer id or amount beyond the bare fact of failure.
523
+ logger.error('Error creating Stripe off-session charge:', error);
524
+ throw error;
525
+ }
526
+ };
377
527
  /**
378
528
  * Maps a raw Stripe subscription status string (e.g. `past_due`, `incomplete`)
379
529
  * to the provider-agnostic `SubscriptionStatus`.
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;AAC1B,sEAAsE;AACtE,2EAA2E;AAC3E,oCAAoC;AACpC,OAAO,cAAc,CAAA;AAGrB,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAShE;;;;GAIG;AACH,IAAI,OAAO,GAAkB,IAAI,CAAA;AAEjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,GAAW,EAAE;IACpC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAA;QACzC,IAAI,C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SAAS,IAAI,SAAS,CAAC,SAAS,CAAC,CAAC,IAAI,SAAS,CAAA;AACzD,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAgC,EAA0B,EAAE;IAChG,OAAO;QACL,QAAQ,EAAE,QAAQ;QAClB,cAAc,EAAE,YAAY,CAAC,EAAE;QAC/B,SAAS,EAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAkB,IAAI,EAAE;QACvE,MAAM,EAAE,2BAA2B,CAAC,YAAY,CAAC,MAAM,CAAC;QACxD,QAAQ,EAAE,YAAY,CAAC,MAAM,KAAK,QAAQ,IAAI,YAAY,CAAC,MAAM,KAAK,UAAU;QAChF,kBAAkB,EAAE,YAAY,CAAC,oBAAoB,GAAG,IAAI;QAC5D,gBAAgB,EAAE,YAAY,CAAC,kBAAkB,GAAG,IAAI;QACxD,SAAS,EAAE,CAAC,YAAY,CAAC,oBAAoB;QAC7C,UAAU,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS;QAClF,OAAO,EAAE,YAAkD;KAC5D,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-payments-stripe",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Stripe payment provider for molecule.dev.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,6 +27,7 @@
27
27
  ],
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
+ "@molecule/api-proxy-agent": "1.1.0",
30
31
  "stripe": "22.4.0"
31
32
  },
32
33
  "devDependencies": {