@emulators/stripe 0.4.1 → 0.5.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
@@ -1,6 +1,6 @@
1
1
  # @emulators/stripe
2
2
 
3
- Stripe API emulation with customers, payment intents, charges, products, prices, and checkout sessions. Includes a hosted checkout page and webhook delivery.
3
+ Stripe API emulation with customers, payment methods, customer sessions, payment intents, charges, products, prices, and checkout sessions. Includes a hosted checkout page and webhook delivery.
4
4
 
5
5
  Part of [emulate](https://github.com/vercel-labs/emulate) — local drop-in replacement services for CI and no-network sandboxes.
6
6
 
@@ -19,6 +19,12 @@ npm install @emulators/stripe
19
19
  - `DELETE /v1/customers/:id` — delete customer
20
20
  - `GET /v1/customers` — list customers
21
21
 
22
+ ### Payment Methods
23
+ - `GET /v1/payment_methods` — list payment methods
24
+
25
+ ### Customer Sessions
26
+ - `POST /v1/customer_sessions` — create customer session
27
+
22
28
  ### Payment Intents
23
29
  - `POST /v1/payment_intents` — create payment intent
24
30
  - `GET /v1/payment_intents/:id` — retrieve payment intent
Binary file
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Entity, Collection, Store, ServicePlugin } from '@emulators/core';
1
+ import { Entity, Collection, Store, ServicePlugin, WebhookDispatcher } from '@emulators/core';
2
2
 
3
3
  interface StripeCustomer extends Entity {
4
4
  stripe_id: string;
@@ -72,21 +72,29 @@ declare function getStripeStore(store: Store): StripeStore;
72
72
  interface StripeSeedConfig {
73
73
  port?: number;
74
74
  customers?: Array<{
75
+ id?: string;
75
76
  email?: string;
76
77
  name?: string;
77
78
  description?: string;
78
79
  }>;
79
80
  products?: Array<{
81
+ id?: string;
80
82
  name: string;
81
83
  description?: string;
82
84
  }>;
83
85
  prices?: Array<{
86
+ id?: string;
84
87
  product_name: string;
85
88
  currency: string;
86
89
  unit_amount: number;
87
90
  }>;
91
+ webhooks?: Array<{
92
+ url: string;
93
+ events: string[];
94
+ secret?: string;
95
+ }>;
88
96
  }
89
- declare function seedFromConfig(store: Store, _baseUrl: string, config: StripeSeedConfig): void;
97
+ declare function seedFromConfig(store: Store, _baseUrl: string, config: StripeSeedConfig, webhooks?: WebhookDispatcher): void;
90
98
  declare const stripePlugin: ServicePlugin;
91
99
 
92
100
  export { type PaymentIntentStatus, type StripeCharge, type StripeCheckoutSession, type StripeCustomer, type StripePaymentIntent, type StripePrice, type StripeProduct, type StripeSeedConfig, type StripeStore, stripePlugin as default, getStripeStore, seedFromConfig, stripePlugin };