-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckout.http
More file actions
77 lines (60 loc) · 1.94 KB
/
Copy pathcheckout.http
File metadata and controls
77 lines (60 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@baseUrl = http://localhost:8080
### Health check
GET {{baseUrl}}/actuator/health
### Happy path — COMPLETED
# @name happyPath
POST {{baseUrl}}/checkout
Content-Type: application/json
{
"customerId": "cust_123",
"items": [{"productId": "prod_1", "quantity": 2}],
"paymentMethod": {"type": "card", "token": "tok_abc"}
}
### Poll status
GET {{baseUrl}}/checkout/{{happyPath.response.body.sagaId}}
### PERMANENT failure — Payment declined (tok_declined) → FAILED, no retry
POST {{baseUrl}}/checkout
Content-Type: application/json
{
"customerId": "cust_123",
"items": [{"productId": "prod_1", "quantity": 1}],
"paymentMethod": {"type": "card", "token": "tok_declined"}
}
### TRANSIENT failure — Payment error (tok_error) → PENDING_RETRY
POST {{baseUrl}}/checkout
Content-Type: application/json
{
"customerId": "cust_123",
"items": [{"productId": "prod_1", "quantity": 1}],
"paymentMethod": {"type": "card", "token": "tok_error"}
}
### Out of stock — prod_3 has 0 qty → InsufficientStockException → FAILED
POST {{baseUrl}}/checkout
Content-Type: application/json
{
"customerId": "cust_123",
"items": [{"productId": "prod_3", "quantity": 1}],
"paymentMethod": {"type": "card", "token": "tok_abc"}
}
### Partial stock — prod_2 has only 3 qty, requesting 10 → FAILED
POST {{baseUrl}}/checkout
Content-Type: application/json
{
"customerId": "cust_123",
"items": [{"productId": "prod_2", "quantity": 10}],
"paymentMethod": {"type": "card", "token": "tok_abc"}
}
### Transient failure in order worker
POST {{baseUrl}}/checkout
Content-Type: application/json
{
"customerId": "cust_error",
"items": [{"productId": "prod_1", "quantity": 1}],
"paymentMethod": {"type": "card", "token": "tok_abc"}
}
### Validation — missing fields → 400
POST {{baseUrl}}/checkout
Content-Type: application/json
{"customerId":"","items":[],"paymentMethod":null}
### Not found → 404
GET {{baseUrl}}/checkout/00000000-0000-0000-0000-000000000000