@emulators/stripe 0.4.0 → 0.4.1
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 +78 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# @emulators/stripe
|
|
2
|
+
|
|
3
|
+
Stripe API emulation with customers, payment intents, charges, products, prices, and checkout sessions. Includes a hosted checkout page and webhook delivery.
|
|
4
|
+
|
|
5
|
+
Part of [emulate](https://github.com/vercel-labs/emulate) — local drop-in replacement services for CI and no-network sandboxes.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @emulators/stripe
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Endpoints
|
|
14
|
+
|
|
15
|
+
### Customers
|
|
16
|
+
- `POST /v1/customers` — create customer
|
|
17
|
+
- `GET /v1/customers/:id` — retrieve customer
|
|
18
|
+
- `POST /v1/customers/:id` — update customer
|
|
19
|
+
- `DELETE /v1/customers/:id` — delete customer
|
|
20
|
+
- `GET /v1/customers` — list customers
|
|
21
|
+
|
|
22
|
+
### Payment Intents
|
|
23
|
+
- `POST /v1/payment_intents` — create payment intent
|
|
24
|
+
- `GET /v1/payment_intents/:id` — retrieve payment intent
|
|
25
|
+
- `POST /v1/payment_intents/:id` — update payment intent
|
|
26
|
+
- `POST /v1/payment_intents/:id/confirm` — confirm payment intent
|
|
27
|
+
- `POST /v1/payment_intents/:id/cancel` — cancel payment intent
|
|
28
|
+
- `GET /v1/payment_intents` — list payment intents
|
|
29
|
+
|
|
30
|
+
### Charges
|
|
31
|
+
- `GET /v1/charges/:id` — retrieve charge
|
|
32
|
+
- `GET /v1/charges` — list charges
|
|
33
|
+
|
|
34
|
+
### Products
|
|
35
|
+
- `POST /v1/products` — create product
|
|
36
|
+
- `GET /v1/products/:id` — retrieve product
|
|
37
|
+
- `GET /v1/products` — list products
|
|
38
|
+
|
|
39
|
+
### Prices
|
|
40
|
+
- `POST /v1/prices` — create price
|
|
41
|
+
- `GET /v1/prices/:id` — retrieve price
|
|
42
|
+
- `GET /v1/prices` — list prices
|
|
43
|
+
|
|
44
|
+
### Checkout Sessions
|
|
45
|
+
- `POST /v1/checkout/sessions` — create checkout session
|
|
46
|
+
- `GET /v1/checkout/sessions/:id` — retrieve session
|
|
47
|
+
- `POST /v1/checkout/sessions/:id/expire` — expire session
|
|
48
|
+
- `GET /v1/checkout/sessions` — list sessions (filter by `customer`, `status`, `payment_status`)
|
|
49
|
+
- `GET /checkout/:id` — hosted checkout page (HTML)
|
|
50
|
+
- `POST /checkout/:id/complete` — complete payment flow
|
|
51
|
+
|
|
52
|
+
## Webhooks
|
|
53
|
+
|
|
54
|
+
Events are delivered to configured webhook URLs:
|
|
55
|
+
- `checkout.session.completed` — when a checkout session is completed
|
|
56
|
+
- `checkout.session.expired` — when a checkout session expires
|
|
57
|
+
|
|
58
|
+
## Seed Configuration
|
|
59
|
+
|
|
60
|
+
```yaml
|
|
61
|
+
stripe:
|
|
62
|
+
customers:
|
|
63
|
+
- name: Test Customer
|
|
64
|
+
email: test@example.com
|
|
65
|
+
products:
|
|
66
|
+
- name: Pro Plan
|
|
67
|
+
prices:
|
|
68
|
+
- product: Pro Plan
|
|
69
|
+
unit_amount: 2000
|
|
70
|
+
currency: usd
|
|
71
|
+
recurring:
|
|
72
|
+
interval: month
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Links
|
|
76
|
+
|
|
77
|
+
- [Full documentation](https://emulate.dev)
|
|
78
|
+
- [GitHub](https://github.com/vercel-labs/emulate)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emulators/stripe",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"hono": "^4",
|
|
31
|
-
"@emulators/core": "0.4.
|
|
31
|
+
"@emulators/core": "0.4.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"tsup": "^8",
|