POST /api/payments
{
"merchantId" : "merchant-001",
"customerId" : "customer-abc",
"amount" : 128.5,
"currency" : "USD",
"description" : "Order #ORD-20260430-001"
}
{
"id" : "pay_c98bef45881a",
"merchantId" : "merchant-001",
"customerId" : "customer-abc",
"amount" : 128.5,
"currency" : "USD",
"status" : "COMPLETED",
"description" : "Order #ORD-20260430-001",
"createdAt" : "2026-05-09T02:20:07.274143Z",
"updatedAt" : "2026-05-09T02:20:07.274143Z"
}
| Field | Expected | Actual | Status |
|---|---|---|---|
id | non-null | pay_c98bef45881a | ✅ |
merchantId | merchant-001 | merchant-001 | ✅ |
customerId | customer-abc | customer-abc | ✅ |
amount | 128.5 | 128.5 | ✅ |
currency | USD | USD | ✅ |
status | COMPLETED | COMPLETED | ✅ |
description | Order #ORD-20260430-001 | Order #ORD-20260430-001 | ✅ |
createdAt | non-null | 2026-05-09T02:20:07.274143Z | ✅ |
updatedAt | non-null | 2026-05-09T02:20:07.274143Z | ✅ |
POST /api/payments
{
"merchantId" : "merchant-001",
"customerId" : "customer-abc",
"amount" : 0.01,
"currency" : "EUR"
}
{
"id" : "pay_7a8aa7faf516",
"merchantId" : "merchant-001",
"customerId" : "customer-abc",
"amount" : 0.01,
"currency" : "EUR",
"status" : "COMPLETED",
"createdAt" : "2026-05-09T02:20:07.300497Z",
"updatedAt" : "2026-05-09T02:20:07.300497Z"
}
| Field | Expected | Actual | Status |
|---|---|---|---|
id | non-null | pay_7a8aa7faf516 | ✅ |
merchantId | merchant-001 | merchant-001 | ✅ |
customerId | customer-abc | customer-abc | ✅ |
amount | 0.01 | 0.01 | ✅ |
currency | EUR | EUR | ✅ |
status | COMPLETED | COMPLETED | ✅ |
createdAt | non-null | 2026-05-09T02:20:07.300497Z | ✅ |
updatedAt | non-null | 2026-05-09T02:20:07.300497Z | ✅ |
POST /api/payments
{
"merchantId" : "merchant-001",
"customerId" : "customer-abc",
"amount" : 50.0
}
{
"status" : 400,
"code" : "VALIDATION_ERROR",
"message" : "Request validation failed",
"errors" : [ {
"field" : "currency",
"message" : "不能为空"
} ],
"timestamp" : "2026-05-09T02:20:07.326876Z"
}
| Field | Expected | Actual | Status |
|---|---|---|---|
status | 400 | 400 | ✅ |
code | VALIDATION_ERROR | VALIDATION_ERROR | ✅ |
GET /api/payments/pay_e5e5cc1e930e
{
"id" : "pay_e5e5cc1e930e",
"merchantId" : "setup-merchant",
"customerId" : "setup-customer",
"amount" : 100.0,
"currency" : "USD",
"status" : "COMPLETED",
"createdAt" : "2026-05-09T02:20:07.336010Z",
"updatedAt" : "2026-05-09T02:20:07.336010Z"
}
| Field | Expected | Actual | Status |
|---|---|---|---|
createdAt | non-null | 2026-05-09T02:20:07.336010Z | ✅ |
amount | non-null | 100.0 | ✅ |
merchantId | non-null | setup-merchant | ✅ |
customerId | non-null | setup-customer | ✅ |
currency | non-null | USD | ✅ |
id | non-null | pay_e5e5cc1e930e | ✅ |
status | COMPLETED | COMPLETED | ✅ |
updatedAt | non-null | 2026-05-09T02:20:07.336010Z | ✅ |
GET /api/payments/non-existent-id
{
"status" : 404,
"code" : "PAYMENT_NOT_FOUND",
"message" : "Payment not found: non-existent-id",
"timestamp" : "2026-05-09T02:20:07.343190Z"
}
| Field | Expected | Actual | Status |
|---|---|---|---|
timestamp | non-null | 2026-05-09T02:20:07.343190Z | ✅ |
GET /api/payments/' OR '1'='1
{
"status" : 404,
"code" : "PAYMENT_NOT_FOUND",
"message" : "Payment not found: ' OR '1'='1",
"timestamp" : "2026-05-09T02:20:07.345665Z"
}
| Field | Expected | Actual | Status |
|---|---|---|---|
timestamp | non-null | 2026-05-09T02:20:07.345665Z | ✅ |
POST /api/payments/pay_1387ba7cfea4/refund
{
"reason" : "Customer requested partial cancellation",
"amount" : 10.0
}
{
"id" : "pay_1387ba7cfea4",
"merchantId" : "setup-merchant",
"customerId" : "setup-customer",
"amount" : 100.0,
"currency" : "USD",
"status" : "PARTIALLY_REFUNDED",
"refundReason" : "Customer requested partial cancellation",
"createdAt" : "2026-05-09T02:20:07.348071Z",
"updatedAt" : "2026-05-09T02:20:07.355221Z"
}
| Field | Expected | Actual | Status |
|---|---|---|---|
createdAt | non-null | 2026-05-09T02:20:07.348071Z | ✅ |
refundReason | Customer requested partial cancellation | Customer requested partial cancellation | ✅ |
id | non-null | pay_1387ba7cfea4 | ✅ |
status | PARTIALLY_REFUNDED | PARTIALLY_REFUNDED | ✅ |
updatedAt | non-null | 2026-05-09T02:20:07.355221Z | ✅ |
POST /api/payments/pay_0b8615561fc1/refund
{
"reason" : "Minimum boundary refund test",
"amount" : 0.01
}
{
"id" : "pay_0b8615561fc1",
"merchantId" : "setup-merchant",
"customerId" : "setup-customer",
"amount" : 100.0,
"currency" : "USD",
"status" : "PARTIALLY_REFUNDED",
"refundReason" : "Minimum boundary refund test",
"createdAt" : "2026-05-09T02:20:07.358351Z",
"updatedAt" : "2026-05-09T02:20:07.361337Z"
}
| Field | Expected | Actual | Status |
|---|---|---|---|
createdAt | non-null | 2026-05-09T02:20:07.358351Z | ✅ |
refundReason | Minimum boundary refund test | Minimum boundary refund test | ✅ |
id | non-null | pay_0b8615561fc1 | ✅ |
status | PARTIALLY_REFUNDED | PARTIALLY_REFUNDED | ✅ |
updatedAt | non-null | 2026-05-09T02:20:07.361337Z | ✅ |
POST /api/payments/pay_394ad81f4c8f/refund
{
"amount" : 10.0
}
{
"status" : 400,
"code" : "VALIDATION_ERROR",
"message" : "Request validation failed",
"errors" : [ {
"field" : "reason",
"message" : "不能为空"
} ],
"timestamp" : "2026-05-09T02:20:07.366733Z"
}
| Field | Expected | Actual | Status |
|---|---|---|---|
code | VALIDATION_ERROR | VALIDATION_ERROR | ✅ |
status | 400 | 400 | ✅ |