@molecule/api-payments-stripe 1.0.0 → 1.0.2
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 +935 -0
- package/dist/bondAdapter.d.ts.map +1 -1
- package/dist/bondAdapter.js +28 -18
- package/dist/bondAdapter.js.map +1 -1
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/provider.d.ts +7 -0
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +7 -0
- package/dist/provider.js.map +1 -1
- package/package.json +8 -7
package/README.md
ADDED
|
@@ -0,0 +1,935 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-08-15T19:33:01.573Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @molecule/api-payments-stripe
|
|
10
|
+
|
|
11
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
12
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
13
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
14
|
+
|
|
15
|
+
Stripe payment provider for molecule.dev.
|
|
16
|
+
|
|
17
|
+
## Type
|
|
18
|
+
|
|
19
|
+
`provider`
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
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
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## API
|
|
28
|
+
|
|
29
|
+
### Interfaces
|
|
30
|
+
|
|
31
|
+
#### `AccountStatus`
|
|
32
|
+
|
|
33
|
+
Connected-account onboarding / payout eligibility status.
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
interface AccountStatus {
|
|
37
|
+
/** Stripe connected account ID. */
|
|
38
|
+
id: string
|
|
39
|
+
/** Whether the account can accept charges. */
|
|
40
|
+
chargesEnabled: boolean
|
|
41
|
+
/** Whether the account can receive payouts. */
|
|
42
|
+
payoutsEnabled: boolean
|
|
43
|
+
/** Whether there are any currently-due requirements (Stripe is blocked on something). */
|
|
44
|
+
requirementsCurrent: boolean
|
|
45
|
+
/** Stripe connected-account type (`standard`, `express`, `custom`), if known. */
|
|
46
|
+
type?: ConnectedAccountType
|
|
47
|
+
/** Currently-due requirement IDs from Stripe (empty when nothing is due). */
|
|
48
|
+
currentlyDue: readonly string[]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### `CheckoutSessionResult`
|
|
53
|
+
|
|
54
|
+
Result of creating or retrieving a checkout session.
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
interface CheckoutSessionResult {
|
|
58
|
+
id: string
|
|
59
|
+
url: string | null
|
|
60
|
+
/** The Stripe Subscription ID created by the checkout session, if available. */
|
|
61
|
+
subscription?: string
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### `ConnectedAccountBusinessProfile`
|
|
66
|
+
|
|
67
|
+
Subset of Stripe `business_profile` fields commonly set during marketplace
|
|
68
|
+
onboarding.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
interface ConnectedAccountBusinessProfile {
|
|
72
|
+
name?: string
|
|
73
|
+
url?: string
|
|
74
|
+
productDescription?: string
|
|
75
|
+
supportEmail?: string
|
|
76
|
+
supportPhone?: string
|
|
77
|
+
mcc?: string
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### `ConnectWebhookEvent`
|
|
82
|
+
|
|
83
|
+
Normalized Connect webhook event.
|
|
84
|
+
|
|
85
|
+
Provider-agnostic shape so consumers don't have to import Stripe types
|
|
86
|
+
to dispatch on event kind.
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
interface ConnectWebhookEvent {
|
|
90
|
+
/** Recognized Connect event type, or `unknown` for unrelated events. */
|
|
91
|
+
type: ConnectWebhookEventType
|
|
92
|
+
/** Original Stripe event type string (e.g. `account.updated`). */
|
|
93
|
+
rawType: string
|
|
94
|
+
/** The ID of the primary resource this event is about (account, payout, transfer, fee). */
|
|
95
|
+
resourceId?: string
|
|
96
|
+
/** The connected account this event applies to, if Stripe sent one. */
|
|
97
|
+
accountId?: string
|
|
98
|
+
/** Raw event-data object (plain JSON shape — never the live Stripe object). */
|
|
99
|
+
data: Record<string, unknown>
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### `CreateAccountLinkParams`
|
|
104
|
+
|
|
105
|
+
Parameters for creating an account link.
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
interface CreateAccountLinkParams {
|
|
109
|
+
/** Stripe connected account ID (`acct_...`). */
|
|
110
|
+
accountId: string
|
|
111
|
+
/** URL Stripe redirects the user back to after onboarding completes. */
|
|
112
|
+
returnUrl: string
|
|
113
|
+
/** URL Stripe redirects the user to if the link expires before completion. */
|
|
114
|
+
refreshUrl: string
|
|
115
|
+
/** Whether this is a first-time onboarding link or an update link. */
|
|
116
|
+
type: AccountLinkType
|
|
117
|
+
/** Optional idempotency key for safe retries. */
|
|
118
|
+
idempotencyKey?: string
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### `CreateAccountLinkResult`
|
|
123
|
+
|
|
124
|
+
Result of creating an account link.
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
interface CreateAccountLinkResult {
|
|
128
|
+
/** Hosted onboarding URL the connected account holder should open. */
|
|
129
|
+
url: string
|
|
130
|
+
/** Unix timestamp (seconds) when the link expires. */
|
|
131
|
+
expiresAt: number
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### `CreateConnectedAccountParams`
|
|
136
|
+
|
|
137
|
+
Parameters for creating a connected account.
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
interface CreateConnectedAccountParams {
|
|
141
|
+
/** Stripe account type — `standard`, `express`, or `custom`. */
|
|
142
|
+
type: ConnectedAccountType
|
|
143
|
+
/** Two-letter ISO country code for the account holder (e.g. `US`, `GB`). */
|
|
144
|
+
country: string
|
|
145
|
+
/** Email address of the account holder. */
|
|
146
|
+
email: string
|
|
147
|
+
/** Optional business profile fields (display name, website, MCC, etc.). */
|
|
148
|
+
businessProfile?: ConnectedAccountBusinessProfile
|
|
149
|
+
/** Optional metadata to attach to the connected account. */
|
|
150
|
+
metadata?: Record<string, string>
|
|
151
|
+
/** Optional idempotency key for safe retries. */
|
|
152
|
+
idempotencyKey?: string
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
#### `CreateConnectedAccountResult`
|
|
157
|
+
|
|
158
|
+
Result of creating a connected account.
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
interface CreateConnectedAccountResult {
|
|
162
|
+
/** Stripe connected account ID (`acct_...`). */
|
|
163
|
+
id: string
|
|
164
|
+
/** Optional onboarding URL (only present when an account link is created in the same flow). */
|
|
165
|
+
accountLinkUrl?: string
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
#### `CreatePayoutParams`
|
|
170
|
+
|
|
171
|
+
Parameters for creating a payout from a connected account's Stripe balance to its bank account.
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
interface CreatePayoutParams {
|
|
175
|
+
/** Connected account ID to issue the payout from (`acct_...`). */
|
|
176
|
+
accountId: string
|
|
177
|
+
/** Amount in the smallest currency unit (e.g. cents for USD). */
|
|
178
|
+
amount: number
|
|
179
|
+
/** Three-letter ISO currency code, lowercase (e.g. `usd`). */
|
|
180
|
+
currency: string
|
|
181
|
+
/** Optional payout method — `standard` or `instant`. */
|
|
182
|
+
method?: 'standard' | 'instant'
|
|
183
|
+
/** Optional metadata. */
|
|
184
|
+
metadata?: Record<string, string>
|
|
185
|
+
/** Optional idempotency key for safe retries. */
|
|
186
|
+
idempotencyKey?: string
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
#### `CreatePayoutResult`
|
|
191
|
+
|
|
192
|
+
Result of creating a payout.
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
interface CreatePayoutResult {
|
|
196
|
+
/** Stripe payout ID (`po_...`). */
|
|
197
|
+
id: string
|
|
198
|
+
/** Amount paid out (smallest currency unit). */
|
|
199
|
+
amount: number
|
|
200
|
+
/** Three-letter ISO currency code. */
|
|
201
|
+
currency: string
|
|
202
|
+
/** Payout status (e.g. `pending`, `paid`, `failed`). */
|
|
203
|
+
status: string
|
|
204
|
+
/** Estimated arrival date (Unix timestamp in seconds). */
|
|
205
|
+
arrivalDate: number
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### `CreateTransferParams`
|
|
210
|
+
|
|
211
|
+
Parameters for creating a transfer to a connected account.
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
interface CreateTransferParams {
|
|
215
|
+
/** Amount in the smallest currency unit (e.g. cents for USD). */
|
|
216
|
+
amount: number
|
|
217
|
+
/** Three-letter ISO currency code, lowercase (e.g. `usd`). */
|
|
218
|
+
currency: string
|
|
219
|
+
/** Destination connected account ID (`acct_...`). */
|
|
220
|
+
destination: string
|
|
221
|
+
/** Optional source charge to attach the transfer to (for separate-charges-and-transfers flow). */
|
|
222
|
+
sourceTransaction?: string
|
|
223
|
+
/** Optional transfer group string (groups related transfers/charges together). */
|
|
224
|
+
transferGroup?: string
|
|
225
|
+
/** Optional metadata. */
|
|
226
|
+
metadata?: Record<string, string>
|
|
227
|
+
/** Optional idempotency key for safe retries. */
|
|
228
|
+
idempotencyKey?: string
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### `CreateTransferResult`
|
|
233
|
+
|
|
234
|
+
Result of creating a transfer.
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
interface CreateTransferResult {
|
|
238
|
+
/** Stripe transfer ID (`tr_...`). */
|
|
239
|
+
id: string
|
|
240
|
+
/** Amount transferred (smallest currency unit). */
|
|
241
|
+
amount: number
|
|
242
|
+
/** Three-letter ISO currency code. */
|
|
243
|
+
currency: string
|
|
244
|
+
/** Destination connected account ID. */
|
|
245
|
+
destination: string
|
|
246
|
+
/** Transfer group, if set. */
|
|
247
|
+
transferGroup?: string
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
#### `NormalizedPurchase`
|
|
252
|
+
|
|
253
|
+
Normalized purchase information (for one-time purchases).
|
|
254
|
+
|
|
255
|
+
```typescript
|
|
256
|
+
interface NormalizedPurchase {
|
|
257
|
+
/**
|
|
258
|
+
* The payment provider.
|
|
259
|
+
*/
|
|
260
|
+
provider: PaymentProviderName
|
|
261
|
+
/**
|
|
262
|
+
* The purchase/transaction ID.
|
|
263
|
+
*/
|
|
264
|
+
purchaseId: string
|
|
265
|
+
/**
|
|
266
|
+
* The product ID.
|
|
267
|
+
*/
|
|
268
|
+
productId: string
|
|
269
|
+
/**
|
|
270
|
+
* Whether the purchase is valid.
|
|
271
|
+
*/
|
|
272
|
+
isValid: boolean
|
|
273
|
+
/**
|
|
274
|
+
* When the purchase was made (Unix timestamp in ms).
|
|
275
|
+
*/
|
|
276
|
+
purchaseDate: number
|
|
277
|
+
/**
|
|
278
|
+
* Raw data from the provider.
|
|
279
|
+
*/
|
|
280
|
+
rawData: unknown
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
#### `NormalizedSubscription`
|
|
285
|
+
|
|
286
|
+
Normalized subscription information.
|
|
287
|
+
|
|
288
|
+
Use this interface to abstract away provider-specific differences.
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
interface NormalizedSubscription {
|
|
292
|
+
/**
|
|
293
|
+
* The payment provider.
|
|
294
|
+
*/
|
|
295
|
+
provider: PaymentProviderName
|
|
296
|
+
/**
|
|
297
|
+
* The subscription ID from the provider.
|
|
298
|
+
*/
|
|
299
|
+
subscriptionId: string
|
|
300
|
+
/**
|
|
301
|
+
* The product/plan ID.
|
|
302
|
+
*/
|
|
303
|
+
productId: string
|
|
304
|
+
/**
|
|
305
|
+
* Current subscription status.
|
|
306
|
+
*/
|
|
307
|
+
status: SubscriptionStatus
|
|
308
|
+
/**
|
|
309
|
+
* Whether the subscription is currently active.
|
|
310
|
+
*/
|
|
311
|
+
isActive: boolean
|
|
312
|
+
/**
|
|
313
|
+
* When the current period started (Unix timestamp in ms).
|
|
314
|
+
*/
|
|
315
|
+
currentPeriodStart?: number
|
|
316
|
+
/**
|
|
317
|
+
* When the current period ends (Unix timestamp in ms).
|
|
318
|
+
*/
|
|
319
|
+
currentPeriodEnd?: number
|
|
320
|
+
/**
|
|
321
|
+
* Whether the subscription will auto-renew.
|
|
322
|
+
*/
|
|
323
|
+
willRenew?: boolean
|
|
324
|
+
/**
|
|
325
|
+
* When the subscription was canceled (if applicable).
|
|
326
|
+
*/
|
|
327
|
+
canceledAt?: number
|
|
328
|
+
/**
|
|
329
|
+
* Raw data from the provider.
|
|
330
|
+
*/
|
|
331
|
+
rawData: unknown
|
|
332
|
+
}
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
#### `SubscriptionResult`
|
|
336
|
+
|
|
337
|
+
Normalized subscription data from Stripe.
|
|
338
|
+
|
|
339
|
+
```typescript
|
|
340
|
+
interface SubscriptionResult {
|
|
341
|
+
id: string
|
|
342
|
+
status: string
|
|
343
|
+
/**
|
|
344
|
+
* The Stripe Customer ID (`cus_...`) that owns this subscription. Used to bind
|
|
345
|
+
* a verified subscription to the calling user so a foreign subscription id
|
|
346
|
+
* cannot be claimed (ownership check in `verifyPayment`).
|
|
347
|
+
*/
|
|
348
|
+
customer?: string
|
|
349
|
+
items: { data: Array<{ id: string; price?: { id?: string; product?: string } }> }
|
|
350
|
+
current_period_start: number
|
|
351
|
+
current_period_end: number
|
|
352
|
+
cancel_at_period_end: boolean
|
|
353
|
+
canceled_at: number | null
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
#### `SubscriptionUpdateParams`
|
|
358
|
+
|
|
359
|
+
Parameters for updating a subscription.
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
interface SubscriptionUpdateParams {
|
|
363
|
+
items?: Array<{ id: string; price: string }>
|
|
364
|
+
cancel_at_period_end?: boolean
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
#### `WebhookEventResult`
|
|
369
|
+
|
|
370
|
+
Result of verifying a webhook event.
|
|
371
|
+
|
|
372
|
+
```typescript
|
|
373
|
+
interface WebhookEventResult {
|
|
374
|
+
type: string
|
|
375
|
+
data: { object: Record<string, unknown> }
|
|
376
|
+
}
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Types
|
|
380
|
+
|
|
381
|
+
#### `AccountLinkType`
|
|
382
|
+
|
|
383
|
+
Account-link types — onboarding (first-time) vs update (returning).
|
|
384
|
+
|
|
385
|
+
```typescript
|
|
386
|
+
type AccountLinkType = 'account_onboarding' | 'account_update'
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
#### `ConnectedAccountType`
|
|
390
|
+
|
|
391
|
+
Connected account type.
|
|
392
|
+
|
|
393
|
+
Stripe distinguishes three account types with different
|
|
394
|
+
onboarding / dashboard responsibilities. See
|
|
395
|
+
https://stripe.com/docs/connect/accounts.
|
|
396
|
+
|
|
397
|
+
```typescript
|
|
398
|
+
type ConnectedAccountType = 'standard' | 'express' | 'custom'
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
#### `ConnectWebhookEventType`
|
|
402
|
+
|
|
403
|
+
Connect webhook event types this provider knows how to interpret.
|
|
404
|
+
|
|
405
|
+
`unknown` is returned for any other Stripe event so callers can fall
|
|
406
|
+
through to the standard subscription webhook handler if needed.
|
|
407
|
+
|
|
408
|
+
```typescript
|
|
409
|
+
type ConnectWebhookEventType =
|
|
410
|
+
'account.updated' | 'payout.created' | 'transfer.created' | 'application_fee.refunded' | 'unknown'
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
#### `PaymentProvider`
|
|
414
|
+
|
|
415
|
+
Payment provider bond interface.
|
|
416
|
+
|
|
417
|
+
Each payment provider implements the methods relevant to its platform.
|
|
418
|
+
All methods are optional since different platforms use different flows.
|
|
419
|
+
|
|
420
|
+
```typescript
|
|
421
|
+
type PaymentProvider = PaymentProviderInterface
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
#### `SubscriptionStatus`
|
|
425
|
+
|
|
426
|
+
Subscription status across providers.
|
|
427
|
+
|
|
428
|
+
```typescript
|
|
429
|
+
type SubscriptionStatus =
|
|
430
|
+
'active' | 'canceled' | 'expired' | 'past_due' | 'trialing' | 'paused' | 'pending' | 'unknown'
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
### Functions
|
|
434
|
+
|
|
435
|
+
#### `cancelSubscription(subscriptionId)`
|
|
436
|
+
|
|
437
|
+
Immediately cancels a Stripe subscription.
|
|
438
|
+
|
|
439
|
+
```typescript
|
|
440
|
+
function cancelSubscription(subscriptionId: string): Promise<SubscriptionResult>
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
- `subscriptionId` — The Stripe subscription ID to cancel.
|
|
444
|
+
|
|
445
|
+
**Returns:** The canceled subscription result.
|
|
446
|
+
|
|
447
|
+
#### `createAccountLink(params)`
|
|
448
|
+
|
|
449
|
+
Creates a Stripe account link the connected account holder uses to finish
|
|
450
|
+
onboarding (or to update payout details).
|
|
451
|
+
|
|
452
|
+
```typescript
|
|
453
|
+
function createAccountLink(params: CreateAccountLinkParams): Promise<CreateAccountLinkResult>
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
- `params` — Account-link creation parameters.
|
|
457
|
+
|
|
458
|
+
**Returns:** The hosted onboarding/update URL and its expiry (Unix timestamp, seconds).
|
|
459
|
+
|
|
460
|
+
#### `createCheckoutSession(options)`
|
|
461
|
+
|
|
462
|
+
Creates a Stripe Checkout session for a new subscription.
|
|
463
|
+
|
|
464
|
+
```typescript
|
|
465
|
+
function createCheckoutSession(options: {
|
|
466
|
+
priceId: string
|
|
467
|
+
successUrl: string
|
|
468
|
+
cancelUrl: string
|
|
469
|
+
customerId?: string
|
|
470
|
+
clientReferenceId?: string
|
|
471
|
+
metadata?: Record<string, string>
|
|
472
|
+
idempotencyKey?: string
|
|
473
|
+
}): Promise<CheckoutSessionResult>
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
- `options` — Checkout configuration.
|
|
477
|
+
- `options.priceId` — The Stripe Price ID for the subscription line item.
|
|
478
|
+
- `options.successUrl` — URL to redirect to after successful payment.
|
|
479
|
+
- `options.cancelUrl` — URL to redirect to if the user cancels.
|
|
480
|
+
- `options.customerId` — Optional existing Stripe Customer ID.
|
|
481
|
+
- `options.clientReferenceId` — Your own id for the buyer (the app's user id). Stripe echoes it back as `client_reference_id` on the session and on every `checkout.session.*` webhook event, which is how the customer (`cus_…`) created by this checkout gets linked to the account that paid. Always pass it: without it the first purchase has nothing tying the new Stripe customer to a user.
|
|
482
|
+
- `options.metadata` — Optional key-value metadata to attach to the session.
|
|
483
|
+
- `options.idempotencyKey` — Optional idempotency key for safe request retries.
|
|
484
|
+
|
|
485
|
+
**Returns:** The checkout session ID and URL.
|
|
486
|
+
|
|
487
|
+
#### `createConnectedAccount(params)`
|
|
488
|
+
|
|
489
|
+
Creates a Stripe connected account for a marketplace seller / driver / provider.
|
|
490
|
+
|
|
491
|
+
```typescript
|
|
492
|
+
function createConnectedAccount(
|
|
493
|
+
params: CreateConnectedAccountParams,
|
|
494
|
+
): Promise<CreateConnectedAccountResult>
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
- `params` — Connected-account creation parameters.
|
|
498
|
+
|
|
499
|
+
**Returns:** The new account ID.
|
|
500
|
+
|
|
501
|
+
#### `createPayout(params)`
|
|
502
|
+
|
|
503
|
+
Issues a payout from a connected account's Stripe balance to its bank account.
|
|
504
|
+
|
|
505
|
+
Uses Stripe's `Stripe-Account` header to scope the call to the connected account.
|
|
506
|
+
|
|
507
|
+
```typescript
|
|
508
|
+
function createPayout(params: CreatePayoutParams): Promise<CreatePayoutResult>
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
- `params` — Payout parameters.
|
|
512
|
+
|
|
513
|
+
**Returns:** The created payout.
|
|
514
|
+
|
|
515
|
+
#### `createPortalSession(options)`
|
|
516
|
+
|
|
517
|
+
Creates a Stripe Billing Portal session so the user can manage their
|
|
518
|
+
subscription (update payment method, cancel, view invoices) in Stripe's
|
|
519
|
+
hosted portal.
|
|
520
|
+
|
|
521
|
+
```typescript
|
|
522
|
+
function createPortalSession(options: {
|
|
523
|
+
customerId: string
|
|
524
|
+
returnUrl?: string
|
|
525
|
+
}): Promise<{ id: string; url: string } | null>
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
- `options` — Portal configuration.
|
|
529
|
+
- `options.customerId` — The Stripe Customer ID to open the portal for.
|
|
530
|
+
- `options.returnUrl` — URL Stripe returns the user to when they exit the portal. Falls back to APP_ORIGIN/ORIGIN when omitted.
|
|
531
|
+
|
|
532
|
+
**Returns:** The portal session ID and URL, or `null` when Stripe rejects the request (e.g. unknown customer).
|
|
533
|
+
|
|
534
|
+
#### `createSetupIntent(options)`
|
|
535
|
+
|
|
536
|
+
Creates a Stripe SetupIntent for the saved-card flow.
|
|
537
|
+
|
|
538
|
+
If `customerId` is not provided, a new Stripe customer is created and its
|
|
539
|
+
ID is returned alongside the SetupIntent so the resource layer can persist
|
|
540
|
+
the customer ID for future SetupIntents and detachments.
|
|
541
|
+
|
|
542
|
+
```typescript
|
|
543
|
+
function createSetupIntent(options: {
|
|
544
|
+
customerId?: string
|
|
545
|
+
metadata?: Record<string, string>
|
|
546
|
+
idempotencyKey?: string
|
|
547
|
+
}): Promise<{ id: string; clientSecret: string; customerId: string }>
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
- `options` — SetupIntent creation options.
|
|
551
|
+
- `options.customerId` — Optional existing Stripe customer ID (`cus_...`).
|
|
552
|
+
- `options.metadata` — Optional metadata to attach to the SetupIntent.
|
|
553
|
+
- `options.idempotencyKey` — Optional idempotency key for safe retries.
|
|
554
|
+
|
|
555
|
+
**Returns:** The SetupIntent ID, client secret, and customer ID.
|
|
556
|
+
|
|
557
|
+
#### `createTransfer(params)`
|
|
558
|
+
|
|
559
|
+
Transfers funds from the platform balance to a connected account.
|
|
560
|
+
|
|
561
|
+
```typescript
|
|
562
|
+
function createTransfer(params: CreateTransferParams): Promise<CreateTransferResult>
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
- `params` — Transfer parameters.
|
|
566
|
+
|
|
567
|
+
**Returns:** The created transfer.
|
|
568
|
+
|
|
569
|
+
#### `detachPaymentMethod(paymentMethodId)`
|
|
570
|
+
|
|
571
|
+
Detaches a saved Stripe payment method from its customer.
|
|
572
|
+
|
|
573
|
+
```typescript
|
|
574
|
+
function detachPaymentMethod(paymentMethodId: string): Promise<boolean>
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
- `paymentMethodId` — The Stripe payment method ID (`pm_...`).
|
|
578
|
+
|
|
579
|
+
**Returns:** `true` if Stripe acknowledged the detach, `false` otherwise.
|
|
580
|
+
|
|
581
|
+
#### `getAccountStatus(accountId)`
|
|
582
|
+
|
|
583
|
+
Looks up a connected account's onboarding / payout status.
|
|
584
|
+
|
|
585
|
+
```typescript
|
|
586
|
+
function getAccountStatus(accountId: string): Promise<AccountStatus>
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
- `accountId` — Stripe connected account ID (`acct_...`).
|
|
590
|
+
|
|
591
|
+
**Returns:** Normalized account status.
|
|
592
|
+
|
|
593
|
+
#### `getCheckoutSession(sessionId)`
|
|
594
|
+
|
|
595
|
+
Retrieves a Stripe Checkout session by ID, including the associated subscription.
|
|
596
|
+
|
|
597
|
+
```typescript
|
|
598
|
+
function getCheckoutSession(sessionId: string): Promise<CheckoutSessionResult>
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
- `sessionId` — The Stripe Checkout session ID.
|
|
602
|
+
|
|
603
|
+
**Returns:** The session ID, URL, and subscription ID (if a subscription was created).
|
|
604
|
+
|
|
605
|
+
#### `getClient()`
|
|
606
|
+
|
|
607
|
+
Returns the lazily-initialized Stripe client. Throws if `STRIPE_SECRET_KEY` is not set.
|
|
608
|
+
|
|
609
|
+
```typescript
|
|
610
|
+
function getClient(): Stripe
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
**Returns:** The shared `Stripe` SDK instance.
|
|
614
|
+
|
|
615
|
+
#### `getSubscription(subscriptionId)`
|
|
616
|
+
|
|
617
|
+
Retrieves a Stripe subscription by ID with expanded item data.
|
|
618
|
+
|
|
619
|
+
```typescript
|
|
620
|
+
function getSubscription(subscriptionId: string): Promise<SubscriptionResult>
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
- `subscriptionId` — The Stripe subscription ID.
|
|
624
|
+
|
|
625
|
+
**Returns:** The normalized subscription result.
|
|
626
|
+
|
|
627
|
+
#### `normalizeSubscription(subscription)`
|
|
628
|
+
|
|
629
|
+
Normalizes a Stripe-specific `SubscriptionResult` to the common
|
|
630
|
+
`NormalizedSubscription` interface used across all payment providers.
|
|
631
|
+
|
|
632
|
+
```typescript
|
|
633
|
+
function normalizeSubscription(subscription: SubscriptionResult): NormalizedSubscription
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
- `subscription` — The Stripe subscription result to normalize.
|
|
637
|
+
|
|
638
|
+
**Returns:** A `NormalizedSubscription` with provider-agnostic fields.
|
|
639
|
+
|
|
640
|
+
#### `normalizeSubscriptionStatus(rawStatus)`
|
|
641
|
+
|
|
642
|
+
Maps a raw Stripe subscription status string (e.g. `past_due`, `incomplete`)
|
|
643
|
+
to the provider-agnostic `SubscriptionStatus`.
|
|
644
|
+
|
|
645
|
+
Shared between `normalizeSubscription` (verify path) and the webhook adapter so
|
|
646
|
+
both paths derive status identically.
|
|
647
|
+
|
|
648
|
+
```typescript
|
|
649
|
+
function normalizeSubscriptionStatus(rawStatus: string | undefined): SubscriptionStatus
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
- `rawStatus` — The raw Stripe `status` string, or `undefined` if absent.
|
|
653
|
+
|
|
654
|
+
**Returns:** The normalized `SubscriptionStatus` (`'unknown'` for unrecognized/missing).
|
|
655
|
+
|
|
656
|
+
#### `processConnectWebhook(headers, body)`
|
|
657
|
+
|
|
658
|
+
Verifies and normalizes a Stripe Connect webhook event.
|
|
659
|
+
|
|
660
|
+
Reuses the same `STRIPE_WEBHOOK_SECRET` env var as the standard webhook
|
|
661
|
+
pipeline (and the same signature verification logic) — Connect events
|
|
662
|
+
arrive on the same webhook endpoint when the platform's webhook is
|
|
663
|
+
configured to receive Connect events.
|
|
664
|
+
|
|
665
|
+
```typescript
|
|
666
|
+
function processConnectWebhook(
|
|
667
|
+
headers: Record<string, string | string[] | undefined>,
|
|
668
|
+
body: string | Buffer<ArrayBufferLike>,
|
|
669
|
+
): ConnectWebhookEvent
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
- `headers` — Request headers (looks up `stripe-signature`).
|
|
673
|
+
- `body` — The raw request body (string or Buffer).
|
|
674
|
+
|
|
675
|
+
**Returns:** The verified, normalized Connect webhook event.
|
|
676
|
+
|
|
677
|
+
#### `reportUsageOverage(options)`
|
|
678
|
+
|
|
679
|
+
Reports a usage-based OVERAGE charge to Stripe as a one-off invoice item
|
|
680
|
+
against an existing customer (and, when given, attached to the open invoice
|
|
681
|
+
of a specific subscription so it lands on the next cycle invoice).
|
|
682
|
+
|
|
683
|
+
This is the supported, type-safe path on the installed Stripe SDK (v22):
|
|
684
|
+
the legacy `subscriptionItems.createUsageRecord` API was removed in favor of
|
|
685
|
+
metered-price meter events / invoice items. A positive-amount invoice item
|
|
686
|
+
is the simplest cost-plus overage mechanism — Stripe aggregates open invoice
|
|
687
|
+
items and bills them at the customer's cycle close, so repeated incremental
|
|
688
|
+
calls accrete onto the same upcoming invoice.
|
|
689
|
+
|
|
690
|
+
IDEMPOTENCY: the caller MUST pass a stable `idempotencyKey` derived from
|
|
691
|
+
`(user, period, amount)` so a retry or a double-run within the same Stripe
|
|
692
|
+
idempotency window (24h) is collapsed to a single invoice item and never
|
|
693
|
+
double-charges (broker safety invariant 4).
|
|
694
|
+
|
|
695
|
+
This function performs NO gating of its own — it charges whatever it is
|
|
696
|
+
told to. The decision of WHETHER to charge (configured? opted-in? paid?
|
|
697
|
+
over budget?) lives entirely in the molecule-dev billing module, which is
|
|
698
|
+
the single inert/opt-in gate (safety invariants 1 + 2).
|
|
699
|
+
|
|
700
|
+
```typescript
|
|
701
|
+
function reportUsageOverage(options: {
|
|
702
|
+
customerId: string
|
|
703
|
+
amountCents: number
|
|
704
|
+
currency?: string
|
|
705
|
+
priceId: string
|
|
706
|
+
subscriptionId?: string
|
|
707
|
+
description?: string
|
|
708
|
+
metadata?: Record<string, string>
|
|
709
|
+
idempotencyKey: string
|
|
710
|
+
}): Promise<{ id: string; amountCents: number }>
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
- `options` — Overage reporting options.
|
|
714
|
+
- `options.customerId` — The Stripe customer to bill (`cus_...`).
|
|
715
|
+
- `options.amountCents` — The overage amount in cents (must be `> 0`).
|
|
716
|
+
- `options.currency` — ISO currency (defaults to `usd`).
|
|
717
|
+
- `options.priceId` — The metered/overage Price id this reports against; recorded in metadata for reconciliation (the invoice item carries an explicit `amount`, so the price's unit amount is not used here).
|
|
718
|
+
- `options.subscriptionId` — Optional subscription to attach the item to so it bills on that subscription's cycle invoice.
|
|
719
|
+
- `options.description` — Human-readable line description.
|
|
720
|
+
- `options.metadata` — Extra reconciliation metadata (e.g. period).
|
|
721
|
+
- `options.idempotencyKey` — REQUIRED stable key (see IDEMPOTENCY above).
|
|
722
|
+
|
|
723
|
+
**Returns:** The created invoice item id + the amount actually reported.
|
|
724
|
+
|
|
725
|
+
#### `retrievePaymentMethod(paymentMethodId)`
|
|
726
|
+
|
|
727
|
+
Retrieves a saved Stripe payment method (card) and returns normalized metadata.
|
|
728
|
+
|
|
729
|
+
```typescript
|
|
730
|
+
function retrievePaymentMethod(
|
|
731
|
+
paymentMethodId: string,
|
|
732
|
+
): Promise<{ id: string; brand: string; last4: string; expMonth: number; expYear: number } | null>
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
- `paymentMethodId` — The Stripe payment method ID (`pm_...`).
|
|
736
|
+
|
|
737
|
+
**Returns:** Brand, last4, and expiry, or `null` if the lookup fails.
|
|
738
|
+
|
|
739
|
+
#### `updateSubscription(subscriptionId, params)`
|
|
740
|
+
|
|
741
|
+
Updates a Stripe subscription (e.g. changes plan, sets cancel_at_period_end).
|
|
742
|
+
|
|
743
|
+
```typescript
|
|
744
|
+
function updateSubscription(
|
|
745
|
+
subscriptionId: string,
|
|
746
|
+
params: SubscriptionUpdateParams,
|
|
747
|
+
): Promise<SubscriptionResult>
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
- `subscriptionId` — The Stripe subscription ID to update.
|
|
751
|
+
- `params` — The Stripe subscription update parameters.
|
|
752
|
+
|
|
753
|
+
**Returns:** The updated subscription result.
|
|
754
|
+
|
|
755
|
+
#### `verifyWebhookSignature(payload, signature)`
|
|
756
|
+
|
|
757
|
+
Verifies a Stripe webhook signature and parses the event payload.
|
|
758
|
+
Requires `STRIPE_WEBHOOK_SECRET` env var.
|
|
759
|
+
|
|
760
|
+
```typescript
|
|
761
|
+
function verifyWebhookSignature(
|
|
762
|
+
payload: string | Buffer<ArrayBufferLike>,
|
|
763
|
+
signature: string,
|
|
764
|
+
): WebhookEventResult
|
|
765
|
+
```
|
|
766
|
+
|
|
767
|
+
- `payload` — The raw request body (string or Buffer).
|
|
768
|
+
- `signature` — The `stripe-signature` header value.
|
|
769
|
+
|
|
770
|
+
**Returns:** The verified webhook event with type and data.
|
|
771
|
+
|
|
772
|
+
### Constants
|
|
773
|
+
|
|
774
|
+
#### `paymentProvider`
|
|
775
|
+
|
|
776
|
+
PaymentProvider-compatible adapter for Stripe.
|
|
777
|
+
|
|
778
|
+
Wraps the Stripe SDK functions into a `PaymentProvider`-compatible object
|
|
779
|
+
for use with the molecule bond system. Supports subscription verification,
|
|
780
|
+
webhook handling, plan upgrades/downgrades, and cancellation.
|
|
781
|
+
|
|
782
|
+
```typescript
|
|
783
|
+
const paymentProvider: PaymentProviderInterface
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
#### `stripeSecretDefinitions`
|
|
787
|
+
|
|
788
|
+
Secret definitions required by the Stripe payments bond.
|
|
789
|
+
|
|
790
|
+
```typescript
|
|
791
|
+
const stripeSecretDefinitions: SecretDefinition[]
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
## Core Interface
|
|
795
|
+
|
|
796
|
+
Implements `@molecule/api-payments` interface.
|
|
797
|
+
|
|
798
|
+
## Bond Wiring
|
|
799
|
+
|
|
800
|
+
Setup function to register this provider with the bond system:
|
|
801
|
+
|
|
802
|
+
```typescript
|
|
803
|
+
import { bond } from '@molecule/api-bond'
|
|
804
|
+
import { paymentProvider } from '@molecule/api-payments-stripe'
|
|
805
|
+
|
|
806
|
+
export function setupPaymentsStripe(): void {
|
|
807
|
+
bond('payments', 'stripe', paymentProvider)
|
|
808
|
+
}
|
|
809
|
+
```
|
|
810
|
+
|
|
811
|
+
## Injection Notes
|
|
812
|
+
|
|
813
|
+
### Requirements
|
|
814
|
+
|
|
815
|
+
Peer dependencies:
|
|
816
|
+
|
|
817
|
+
- `@molecule/api-bond` ^1.0.1
|
|
818
|
+
- `@molecule/api-i18n` ^1.0.1
|
|
819
|
+
- `@molecule/api-payments` ^1.0.1
|
|
820
|
+
- `@molecule/api-jwt` ^1.0.1
|
|
821
|
+
- `@molecule/api-secrets` ^1.0.1
|
|
822
|
+
|
|
823
|
+
### Environment Variables
|
|
824
|
+
|
|
825
|
+
- `STRIPE_SECRET_KEY` _(required)_ — Stripe secret key
|
|
826
|
+
- Setup: Stripe Dashboard → Developers → API keys; use the sk_test_ key in test mode, sk_live_ in production.
|
|
827
|
+
- Get it here: [https://dashboard.stripe.com/apikeys](https://dashboard.stripe.com/apikeys)
|
|
828
|
+
- Example: `sk_test_...`
|
|
829
|
+
- `STRIPE_WEBHOOK_SECRET` _(required)_ — Stripe webhook signing secret
|
|
830
|
+
- Setup: Stripe Dashboard → Developers → Webhooks → Add endpoint pointing at {apiUrl}/api/users/payment-notification/stripe, then copy its signing secret.
|
|
831
|
+
- Get it here: [https://dashboard.stripe.com/webhooks](https://dashboard.stripe.com/webhooks)
|
|
832
|
+
- Example: `whsec_...`
|
|
833
|
+
|
|
834
|
+
### Runtime Dependencies
|
|
835
|
+
|
|
836
|
+
- `@molecule/api-bond`
|
|
837
|
+
- `@molecule/api-i18n`
|
|
838
|
+
- `@molecule/api-jwt`
|
|
839
|
+
- `@molecule/api-payments`
|
|
840
|
+
- `@molecule/api-secrets`
|
|
841
|
+
- `stripe`
|
|
842
|
+
|
|
843
|
+
Bond this as the payments provider so `@molecule/api-payments`'s `verifySubscription` (and
|
|
844
|
+
the payment resource) work server-side — don't call the Stripe SDK directly for
|
|
845
|
+
verification. Env: `STRIPE_SECRET_KEY` + `STRIPE_WEBHOOK_SECRET` are SERVER-ONLY; only the
|
|
846
|
+
publishable key (`pk_…`) is client-side.
|
|
847
|
+
|
|
848
|
+
**You do NOT need molecule's Express app, the `bond()` wiring, or the UI packages to use
|
|
849
|
+
this — the functions below are framework-agnostic.** On a non-Express / non-molecule host
|
|
850
|
+
(Next.js App Router, serverless functions, Hono, Fastify), import them and call them from
|
|
851
|
+
your OWN route handlers:
|
|
852
|
+
`import { createCheckoutSession, verifyWebhookSignature, getSubscription } from '@molecule/api-payments-stripe'`.
|
|
853
|
+
They cover the whole flow — {@link createCheckoutSession} (server-owned `priceId`, so you
|
|
854
|
+
never take a price/amount from the client), {@link createPortalSession} (hosted Billing
|
|
855
|
+
Portal for payment-method updates/cancellation/invoices), {@link verifyWebhookSignature},
|
|
856
|
+
and the subscription getters/updaters — and carry the security contract (config-not-configured
|
|
857
|
+
errors, normalized status) for free, so reach for these instead of hand-rolling raw
|
|
858
|
+
`stripe` calls. In a Next.js App Router route, read the RAW webhook body with
|
|
859
|
+
`await req.text()` and the header with `req.headers.get('stripe-signature')`, then
|
|
860
|
+
`verifyWebhookSignature(rawBody, signature)` (the `express.raw(...)` note below is the
|
|
861
|
+
Express-host equivalent). Only `@molecule/api-middleware-billing-routes` (Express glue) and
|
|
862
|
+
`@molecule/app-billing-react` (molecule UI) are framework-coupled — skip THOSE on such a
|
|
863
|
+
host, but still use these bond functions underneath.
|
|
864
|
+
|
|
865
|
+
Two things a weak Stripe integration gets wrong:
|
|
866
|
+
|
|
867
|
+
- **The webhook body MUST be RAW for signature verification.** {@link verifyWebhookSignature}
|
|
868
|
+
(Stripe's `constructEvent`) hashes the exact bytes, so a parsed-then-re-serialized body
|
|
869
|
+
ALWAYS fails. In a molecule app you need NO special middleware: the always-included
|
|
870
|
+
`@molecule/api-middleware-body-parser-express` already captures the unparsed body as
|
|
871
|
+
`req.rawBody` (a string) on EVERY request — just pass `req.rawBody` + the `stripe-signature`
|
|
872
|
+
header to {@link verifyWebhookSignature}. Do NOT add a route-specific `express.raw(...)` here —
|
|
873
|
+
it is redundant and fights the global JSON parser (which has already consumed the stream and
|
|
874
|
+
set `req.rawBody`). (ONLY on a NON-molecule Express host that lacks `req.rawBody` do you mount
|
|
875
|
+
`express.raw({ type: 'application/json' })` before the JSON parser; on Next.js App Router read
|
|
876
|
+
the raw body with `await req.text()`.) NEVER act on an unverified webhook body — it is
|
|
877
|
+
attacker-controlled.
|
|
878
|
+
- **Webhooks are redelivered — be idempotent.** Stripe retries until it gets a 2xx, so the
|
|
879
|
+
same `event.id` can arrive twice. Dedupe on it (the payment record's
|
|
880
|
+
`UNIQUE(platformKey, transactionId)` already blocks a double-grant), and return 2xx once
|
|
881
|
+
handled so Stripe stops retrying.
|
|
882
|
+
|
|
883
|
+
Create checkout with SERVER-configured price ids ({@link createCheckoutSession}) — never an
|
|
884
|
+
amount sent by the client.
|
|
885
|
+
|
|
886
|
+
**Checkout returns the buyer to the APP, and the session must name the buyer.**
|
|
887
|
+
`paymentProvider.updateSubscription` builds `success_url` /`cancel_url` with
|
|
888
|
+
`resolveCheckoutRedirectUrls` from `@molecule/api-payments`, so Stripe returns to
|
|
889
|
+
`APP_ORIGIN/plan-updated?provider=stripe&sessionId={CHECKOUT_SESSION_ID}` — the page
|
|
890
|
+
then calls `POST /users/:id/verify-payment/stripe` with that id from an origin whose
|
|
891
|
+
cookies authenticate. Returning to a separate API host instead sends a top-level
|
|
892
|
+
redirect with NO credentials, so the callback answers 401 and the paid plan is never
|
|
893
|
+
granted. It also sets `client_reference_id` + `metadata.userId` to the app's user id;
|
|
894
|
+
they are how a webhook links the newly created `cus_…` to the account that paid on a
|
|
895
|
+
FIRST purchase, and without them nothing ever writes the customer id — so any
|
|
896
|
+
usage/metered billing keyed on it can never charge. Pass `clientReferenceId` when you
|
|
897
|
+
call {@link createCheckoutSession} yourself.
|
|
898
|
+
|
|
899
|
+
**A missing `STRIPE_SECRET_KEY` is NOT the same as "no active subscription."**
|
|
900
|
+
`getClient()` throws a tagged config-not-configured error; `verifySubscription`,
|
|
901
|
+
`updateSubscription`, and `cancelSubscription` on {@link paymentProvider} detect
|
|
902
|
+
that tag (`isConfigNotConfiguredError` from `@molecule/api-payments`) and
|
|
903
|
+
RETHROW it instead of swallowing it into the same `null` / `{ updated: false }`
|
|
904
|
+
/ `false` a genuine verification/update failure returns — so a caller (or its
|
|
905
|
+
own catch block) can tell "the operator forgot to set the secret" apart from
|
|
906
|
+
"this subscription/card is invalid" and surface the actionable 503 instead of
|
|
907
|
+
a generic 400/500.
|
|
908
|
+
|
|
909
|
+
## E2E Tests
|
|
910
|
+
|
|
911
|
+
Integration checklist — drive the real UI (live preview, no mocks; use the
|
|
912
|
+
provider's TEST mode — test cards/sandbox accounts, never a live charge),
|
|
913
|
+
adapt each item to this app's actual screens/flows, and check every box off
|
|
914
|
+
one by one. A box you can't check is an integration bug to fix — not a skip:
|
|
915
|
+
|
|
916
|
+
- [ ] Starting an upgrade/subscribe from the pricing or billing surface creates a
|
|
917
|
+
checkout session and hands off to the provider flow (redirect or embedded
|
|
918
|
+
element) — the button does something real, not a dead click.
|
|
919
|
+
- [ ] Returning from a canceled/abandoned checkout leaves the user on their
|
|
920
|
+
original plan with a sane UI (no phantom entitlement, no error page).
|
|
921
|
+
- [ ] Entitlement flips ONLY after server-side verification (webhook or verify
|
|
922
|
+
call) — reloading after a client-side-only "success" must NOT show a paid
|
|
923
|
+
plan unless the server verified it. The sandbox CAPTURES webhook deliveries
|
|
924
|
+
— read them with the `read_activity` tool (filter type 'webhook'); never
|
|
925
|
+
mock the event or modify production code to fake an entitlement.
|
|
926
|
+
- [ ] The current subscription status (plan name, renewal/expiry) renders on the
|
|
927
|
+
account/billing screen, and canceling updates that status visibly.
|
|
928
|
+
- [ ] With payment secrets unconfigured, the flow surfaces an actionable
|
|
929
|
+
"credentials not configured" message — not a silent no-op or generic 500.
|
|
930
|
+
- [ ] The provider SECRET key never reaches the browser (page + network traffic
|
|
931
|
+
contain only the publishable key).
|
|
932
|
+
|
|
933
|
+
## Translations
|
|
934
|
+
|
|
935
|
+
Translation strings are provided by `@molecule/api-locales-payments-stripe`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bondAdapter.d.ts","sourceRoot":"","sources":["../src/bondAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAGL,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"bondAdapter.d.ts","sourceRoot":"","sources":["../src/bondAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAGL,KAAK,eAAe,EAQrB,MAAM,wBAAwB,CAAA;AA6C/B;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,eAwa7B,CAAA"}
|
package/dist/bondAdapter.js
CHANGED
|
@@ -10,7 +10,7 @@ import crypto from 'crypto';
|
|
|
10
10
|
import { getLogger } from '@molecule/api-bond';
|
|
11
11
|
const logger = getLogger();
|
|
12
12
|
import { get } from '@molecule/api-bond';
|
|
13
|
-
import { isConfigNotConfiguredError, } from '@molecule/api-payments';
|
|
13
|
+
import { isConfigNotConfiguredError, resolveCheckoutRedirectUrls, } from '@molecule/api-payments';
|
|
14
14
|
import { createCheckoutSession, createPortalSession as stripeCreatePortalSession, createSetupIntent as stripeCreateSetupIntent, detachPaymentMethod as stripeDetachPaymentMethod, getCheckoutSession, getSubscription, normalizeSubscription, normalizeSubscriptionStatus, retrievePaymentMethod as stripeRetrievePaymentMethod, updateSubscription as stripeUpdateSubscription, verifyWebhookSignature, } from './provider.js';
|
|
15
15
|
/**
|
|
16
16
|
* Maps Stripe webhook event types (e.g. `customer.subscription.created`) to
|
|
@@ -212,6 +212,10 @@ export const paymentProvider = {
|
|
|
212
212
|
* 1. Looks up the user's existing Stripe subscription via PaymentRecordService.
|
|
213
213
|
* 2. If found, updates the subscription to the new product/price.
|
|
214
214
|
* 3. If not found, creates a Stripe Checkout session and returns the checkout URL.
|
|
215
|
+
* The session returns the buyer to the APP's `/plan-updated` page (never the
|
|
216
|
+
* API host — see `resolveCheckoutRedirectUrls`) and carries the user id as
|
|
217
|
+
* `client_reference_id` + `metadata.userId` so the resulting customer can be
|
|
218
|
+
* linked to the account that paid.
|
|
215
219
|
*
|
|
216
220
|
* Handles subscription updates and new checkout session creation.
|
|
217
221
|
* @param params - The update parameters.
|
|
@@ -256,21 +260,20 @@ export const paymentProvider = {
|
|
|
256
260
|
}
|
|
257
261
|
}
|
|
258
262
|
// No existing subscription — create a Stripe Checkout session.
|
|
259
|
-
//
|
|
260
|
-
//
|
|
261
|
-
//
|
|
262
|
-
//
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
//
|
|
266
|
-
//
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
logger.warn(`Stripe checkout: API_ORIGIN/APP_ORIGIN/ORIGIN not set — falling back to ${fallbackApiOrigin} / ${fallbackAppOrigin} for redirect URLs (fine in dev, wrong in production).`);
|
|
263
|
+
// Both redirect URLs point at the APP origin: the session cookie is set
|
|
264
|
+
// for the app's host, so a top-level return to a separate API host
|
|
265
|
+
// carries no credentials and the authenticated verify route answers 401
|
|
266
|
+
// (the buyer pays and lands on an error page). The app's
|
|
267
|
+
// `/plan-updated` page verifies with the `cs_…` id from the query
|
|
268
|
+
// instead. Stripe rejects empty/relative URLs with `code: 'url_invalid'`,
|
|
269
|
+
// so an unset APP_ORIGIN/ORIGIN falls back to localhost — fine in dev,
|
|
270
|
+
// and warned about because it strands a deployed buyer.
|
|
271
|
+
const redirects = resolveCheckoutRedirectUrls({
|
|
272
|
+
provider: 'stripe',
|
|
273
|
+
sessionIdToken: '{CHECKOUT_SESSION_ID}',
|
|
274
|
+
});
|
|
275
|
+
if (redirects.usingFallbackOrigin) {
|
|
276
|
+
logger.warn(`Stripe checkout: APP_ORIGIN/ORIGIN not set — falling back to ${redirects.appOrigin} for redirect URLs (fine in dev, wrong in production).`);
|
|
274
277
|
}
|
|
275
278
|
// Generate idempotency key from userId + priceId + timestamp window (5-min buckets)
|
|
276
279
|
// This prevents duplicate checkout sessions if the user double-clicks or retries
|
|
@@ -281,8 +284,15 @@ export const paymentProvider = {
|
|
|
281
284
|
.digest('hex');
|
|
282
285
|
const session = await createCheckoutSession({
|
|
283
286
|
priceId: params.newProductId,
|
|
284
|
-
successUrl:
|
|
285
|
-
cancelUrl:
|
|
287
|
+
successUrl: redirects.successUrl,
|
|
288
|
+
cancelUrl: redirects.cancelUrl,
|
|
289
|
+
// Bind the session to the buying account BOTH ways Stripe echoes an
|
|
290
|
+
// app-side id back (top-level on `checkout.session.*`, and in
|
|
291
|
+
// `metadata` on objects that carry no client_reference_id). This is
|
|
292
|
+
// what lets a webhook link the new `cus_…` to the user on a FIRST
|
|
293
|
+
// purchase, before any customer id is stored.
|
|
294
|
+
clientReferenceId: params.userId,
|
|
295
|
+
metadata: { userId: params.userId },
|
|
286
296
|
idempotencyKey,
|
|
287
297
|
});
|
|
288
298
|
if (session?.id && session?.url) {
|
package/dist/bondAdapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bondAdapter.js","sourceRoot":"","sources":["../src/bondAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AACxC,OAAO,EAEL,0BAA0B,
|
|
1
|
+
{"version":3,"file":"bondAdapter.js","sourceRoot":"","sources":["../src/bondAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AACxC,OAAO,EAEL,0BAA0B,EAI1B,2BAA2B,GAK5B,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EACL,qBAAqB,EACrB,mBAAmB,IAAI,yBAAyB,EAChD,iBAAiB,IAAI,uBAAuB,EAC5C,mBAAmB,IAAI,yBAAyB,EAChD,kBAAkB,EAClB,e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AO,CAAC,CAAC,OAAO,CAAA;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,kDAAkD;YAClD,IAAI,0BAA0B,CAAC,KAAK,CAAC,EAAE,CAAC;gBACtC,MAAM,KAAK,CAAA;YACb,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,8CAA8C,EAAE,KAAK,CAAC,CAAA;YACnE,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,mBAAmB,CAAC,MAGzB;QACC,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,GAAG,CAAuB,gBAAgB,CAAC,CAAA;YAC3D,IAAI,CAAC,OAAO;gBAAE,OAAO,IAAI,CAAA;YAEzB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;YACnE,MAAM,UAAU,GAAI,OAAO,EAAE,IAAgC,EAAE,UAAoB,CAAA;YACnF,IAAI,CAAC,UAAU;gBAAE,OAAO,IAAI,CAAA;YAE5B,OAAO,MAAM,yBAAyB,CAAC;gBACrC,UAAU;gBACV,SAAS,EAAE,MAAM,CAAC,SAAS;aAC5B,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,0BAA0B,CAAC,KAAK,CAAC,EAAE,CAAC;gBACtC,MAAM,KAAK,CAAA;YACb,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,+CAA+C,EAAE,KAAK,CAAC,CAAA;YACpE,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -47,6 +47,19 @@
|
|
|
47
47
|
* Create checkout with SERVER-configured price ids ({@link createCheckoutSession}) — never an
|
|
48
48
|
* amount sent by the client.
|
|
49
49
|
*
|
|
50
|
+
* **Checkout returns the buyer to the APP, and the session must name the buyer.**
|
|
51
|
+
* `paymentProvider.updateSubscription` builds `success_url` /`cancel_url` with
|
|
52
|
+
* `resolveCheckoutRedirectUrls` from `@molecule/api-payments`, so Stripe returns to
|
|
53
|
+
* `APP_ORIGIN/plan-updated?provider=stripe&sessionId={CHECKOUT_SESSION_ID}` — the page
|
|
54
|
+
* then calls `POST /users/:id/verify-payment/stripe` with that id from an origin whose
|
|
55
|
+
* cookies authenticate. Returning to a separate API host instead sends a top-level
|
|
56
|
+
* redirect with NO credentials, so the callback answers 401 and the paid plan is never
|
|
57
|
+
* granted. It also sets `client_reference_id` + `metadata.userId` to the app's user id;
|
|
58
|
+
* they are how a webhook links the newly created `cus_…` to the account that paid on a
|
|
59
|
+
* FIRST purchase, and without them nothing ever writes the customer id — so any
|
|
60
|
+
* usage/metered billing keyed on it can never charge. Pass `clientReferenceId` when you
|
|
61
|
+
* call {@link createCheckoutSession} yourself.
|
|
62
|
+
*
|
|
50
63
|
* **A missing `STRIPE_SECRET_KEY` is NOT the same as "no active subscription."**
|
|
51
64
|
* `getClient()` throws a tagged config-not-configured error; `verifySubscription`,
|
|
52
65
|
* `updateSubscription`, and `cancelSubscription` on {@link paymentProvider} detect
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
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"}
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,19 @@
|
|
|
47
47
|
* Create checkout with SERVER-configured price ids ({@link createCheckoutSession}) — never an
|
|
48
48
|
* amount sent by the client.
|
|
49
49
|
*
|
|
50
|
+
* **Checkout returns the buyer to the APP, and the session must name the buyer.**
|
|
51
|
+
* `paymentProvider.updateSubscription` builds `success_url` /`cancel_url` with
|
|
52
|
+
* `resolveCheckoutRedirectUrls` from `@molecule/api-payments`, so Stripe returns to
|
|
53
|
+
* `APP_ORIGIN/plan-updated?provider=stripe&sessionId={CHECKOUT_SESSION_ID}` — the page
|
|
54
|
+
* then calls `POST /users/:id/verify-payment/stripe` with that id from an origin whose
|
|
55
|
+
* cookies authenticate. Returning to a separate API host instead sends a top-level
|
|
56
|
+
* redirect with NO credentials, so the callback answers 401 and the paid plan is never
|
|
57
|
+
* granted. It also sets `client_reference_id` + `metadata.userId` to the app's user id;
|
|
58
|
+
* they are how a webhook links the newly created `cus_…` to the account that paid on a
|
|
59
|
+
* FIRST purchase, and without them nothing ever writes the customer id — so any
|
|
60
|
+
* usage/metered billing keyed on it can never charge. Pass `clientReferenceId` when you
|
|
61
|
+
* call {@link createCheckoutSession} yourself.
|
|
62
|
+
*
|
|
50
63
|
* **A missing `STRIPE_SECRET_KEY` is NOT the same as "no active subscription."**
|
|
51
64
|
* `getClient()` throws a tagged config-not-configured error; `verifySubscription`,
|
|
52
65
|
* `updateSubscription`, and `cancelSubscription` on {@link paymentProvider} detect
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
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"}
|
package/dist/provider.d.ts
CHANGED
|
@@ -23,6 +23,12 @@ export declare const getClient: () => Stripe;
|
|
|
23
23
|
* @param options.successUrl - URL to redirect to after successful payment.
|
|
24
24
|
* @param options.cancelUrl - URL to redirect to if the user cancels.
|
|
25
25
|
* @param options.customerId - Optional existing Stripe Customer ID.
|
|
26
|
+
* @param options.clientReferenceId - Your own id for the buyer (the app's user
|
|
27
|
+
* id). Stripe echoes it back as `client_reference_id` on the session and on
|
|
28
|
+
* every `checkout.session.*` webhook event, which is how the customer
|
|
29
|
+
* (`cus_…`) created by this checkout gets linked to the account that paid.
|
|
30
|
+
* Always pass it: without it the first purchase has nothing tying the new
|
|
31
|
+
* Stripe customer to a user.
|
|
26
32
|
* @param options.metadata - Optional key-value metadata to attach to the session.
|
|
27
33
|
* @param options.idempotencyKey - Optional idempotency key for safe request retries.
|
|
28
34
|
* @returns The checkout session ID and URL.
|
|
@@ -32,6 +38,7 @@ export declare const createCheckoutSession: (options: {
|
|
|
32
38
|
successUrl: string;
|
|
33
39
|
cancelUrl: string;
|
|
34
40
|
customerId?: string;
|
|
41
|
+
clientReferenceId?: string;
|
|
35
42
|
metadata?: Record<string, string>;
|
|
36
43
|
idempotencyKey?: string;
|
|
37
44
|
}) => Promise<CheckoutSessionResult>;
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -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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,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;;;;;;;;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
|
@@ -83,6 +83,12 @@ const toSubscriptionResult = (sub) => {
|
|
|
83
83
|
* @param options.successUrl - URL to redirect to after successful payment.
|
|
84
84
|
* @param options.cancelUrl - URL to redirect to if the user cancels.
|
|
85
85
|
* @param options.customerId - Optional existing Stripe Customer ID.
|
|
86
|
+
* @param options.clientReferenceId - Your own id for the buyer (the app's user
|
|
87
|
+
* id). Stripe echoes it back as `client_reference_id` on the session and on
|
|
88
|
+
* every `checkout.session.*` webhook event, which is how the customer
|
|
89
|
+
* (`cus_…`) created by this checkout gets linked to the account that paid.
|
|
90
|
+
* Always pass it: without it the first purchase has nothing tying the new
|
|
91
|
+
* Stripe customer to a user.
|
|
86
92
|
* @param options.metadata - Optional key-value metadata to attach to the session.
|
|
87
93
|
* @param options.idempotencyKey - Optional idempotency key for safe request retries.
|
|
88
94
|
* @returns The checkout session ID and URL.
|
|
@@ -101,6 +107,7 @@ export const createCheckoutSession = async (options) => {
|
|
|
101
107
|
success_url: options.successUrl,
|
|
102
108
|
cancel_url: options.cancelUrl,
|
|
103
109
|
customer: options.customerId,
|
|
110
|
+
client_reference_id: options.clientReferenceId,
|
|
104
111
|
metadata: options.metadata,
|
|
105
112
|
}, options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : undefined);
|
|
106
113
|
return { id: session.id, url: session.url };
|
package/dist/provider.js.map
CHANGED
|
@@ -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,CAAC,GAAG,EAAE,CAAC;YACT,2EAA2E;YAC3E,4EAA4E;YAC5E,yEAAyE;YACzE,yEAAyE;YACzE,4CAA4C;YAC5C,MAAM,wBAAwB,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAA;QACjE,CAAC;QACD,4EAA4E;QAC5E,wEAAwE;QACxE,wEAAwE;QACxE,kDAAkD;QAClD,OAAO,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,oBAAoB,GAAG,CAAC,GAAwB,EAAsB,EAAE;IAC5E,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,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AM,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.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Stripe payment provider for molecule.dev.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
|
-
"dist"
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
21
22
|
],
|
|
22
23
|
"keywords": [
|
|
23
24
|
"molecule",
|
|
@@ -34,11 +35,11 @@
|
|
|
34
35
|
"vitest": "4.1.10"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
|
-
"@molecule/api-bond": "^1.0.
|
|
38
|
-
"@molecule/api-i18n": "^1.0.
|
|
39
|
-
"@molecule/api-payments": "^1.
|
|
40
|
-
"@molecule/api-jwt": "^1.0.
|
|
41
|
-
"@molecule/api-secrets": "^1.0.
|
|
38
|
+
"@molecule/api-bond": "^1.0.1",
|
|
39
|
+
"@molecule/api-i18n": "^1.0.1",
|
|
40
|
+
"@molecule/api-payments": "^1.1.0",
|
|
41
|
+
"@molecule/api-jwt": "^1.0.1",
|
|
42
|
+
"@molecule/api-secrets": "^1.0.1"
|
|
42
43
|
},
|
|
43
44
|
"peerDependenciesMeta": {
|
|
44
45
|
"@molecule/api-payments": {
|