-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-test.http
More file actions
42 lines (35 loc) · 946 Bytes
/
Copy pathapi-test.http
File metadata and controls
42 lines (35 loc) · 946 Bytes
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
### 1. Test Validation Error (Thiếu cardId)
POST http://localhost:8080/api/authorization
Content-Type: application/json
X-Trace-Id: trace-validation-001
{
"amount": 50000,
"merchantName": "Shopee"
}
### 2. Test Resource Not Found (Card ID không tồn tại)
POST http://localhost:8080/api/authorization
Content-Type: application/json
X-Trace-Id: trace-notfound-002
{
"cardId": 999999,
"amount": 50000,
"merchantName": "Lazada"
}
### 3. Test Insufficient Funds (Số dư không đủ - Card 1 có 5,000,000)
POST http://localhost:8080/api/authorization
Content-Type: application/json
X-Trace-Id: trace-insufficient-003
{
"cardId": 1,
"amount": 999999999,
"merchantName": "Tiki"
}
### 4. SUCCESS Case: Authorize 50k (Đủ tiền -> 200 OK)
POST http://localhost:8080/api/authorization
Content-Type: application/json
X-Trace-Id: trace-success-004
{
"cardId": 1,
"amount": 50000,
"merchantName": "Highlands Coffee"
}