TestForge AI Execution Report

Generated 2026-05-09T02:20:07.372216Z  |  Duration 288ms

Total
9
Passed
9
Failed
0
Pass Rate
100.0%

Test Cases

Create payment with all required fieldsHAPPY_PATH233ms9/9

Request

POST /api/payments

{
  "merchantId" : "merchant-001",
  "customerId" : "customer-abc",
  "amount" : 128.5,
  "currency" : "USD",
  "description" : "Order #ORD-20260430-001"
}

Response (HTTP 201, 228ms)

{
  "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"
}

Assertions (9/9 passed)

FieldExpectedActualStatus
idnon-nullpay_c98bef45881a
merchantIdmerchant-001merchant-001
customerIdcustomer-abccustomer-abc
amount128.5128.5
currencyUSDUSD
statusCOMPLETEDCOMPLETED
descriptionOrder #ORD-20260430-001Order #ORD-20260430-001
createdAtnon-null2026-05-09T02:20:07.274143Z
updatedAtnon-null2026-05-09T02:20:07.274143Z
Create payment with minimum allowed amountBOUNDARY3ms8/8

Request

POST /api/payments

{
  "merchantId" : "merchant-001",
  "customerId" : "customer-abc",
  "amount" : 0.01,
  "currency" : "EUR"
}

Response (HTTP 201, 3ms)

{
  "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"
}

Assertions (8/8 passed)

FieldExpectedActualStatus
idnon-nullpay_7a8aa7faf516
merchantIdmerchant-001merchant-001
customerIdcustomer-abccustomer-abc
amount0.010.01
currencyEUREUR
statusCOMPLETEDCOMPLETED
createdAtnon-null2026-05-09T02:20:07.300497Z
updatedAtnon-null2026-05-09T02:20:07.300497Z
Create payment with missing required fieldNEGATIVE30ms2/2

Request

POST /api/payments

{
  "merchantId" : "merchant-001",
  "customerId" : "customer-abc",
  "amount" : 50.0
}

Response (HTTP 400, 29ms)

{
  "status" : 400,
  "code" : "VALIDATION_ERROR",
  "message" : "Request validation failed",
  "errors" : [ {
    "field" : "currency",
    "message" : "不能为空"
  } ],
  "timestamp" : "2026-05-09T02:20:07.326876Z"
}

Assertions (2/2 passed)

FieldExpectedActualStatus
status400400
codeVALIDATION_ERRORVALIDATION_ERROR
Get existing payment by IDHAPPY_PATH4ms8/8

Request

GET /api/payments/pay_e5e5cc1e930e

Response (HTTP 200, 4ms)

{
  "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"
}

Assertions (8/8 passed)

FieldExpectedActualStatus
createdAtnon-null2026-05-09T02:20:07.336010Z
amountnon-null100.0
merchantIdnon-nullsetup-merchant
customerIdnon-nullsetup-customer
currencynon-nullUSD
idnon-nullpay_e5e5cc1e930e
statusCOMPLETEDCOMPLETED
updatedAtnon-null2026-05-09T02:20:07.336010Z
Get payment with non-existent ID returns 404NEGATIVE3ms1/1

Request

GET /api/payments/non-existent-id

Response (HTTP 404, 3ms)

{
  "status" : 404,
  "code" : "PAYMENT_NOT_FOUND",
  "message" : "Payment not found: non-existent-id",
  "timestamp" : "2026-05-09T02:20:07.343190Z"
}

Assertions (1/1 passed)

FieldExpectedActualStatus
timestampnon-null2026-05-09T02:20:07.343190Z
Get payment with SQL injection in ID returns 4xxSECURITY2ms1/1

Request

GET /api/payments/' OR '1'='1

Response (HTTP 404, 2ms)

{
  "status" : 404,
  "code" : "PAYMENT_NOT_FOUND",
  "message" : "Payment not found: ' OR '1'='1",
  "timestamp" : "2026-05-09T02:20:07.345665Z"
}

Assertions (1/1 passed)

FieldExpectedActualStatus
timestampnon-null2026-05-09T02:20:07.345665Z
Partial refund of an existing paymentHAPPY_PATH7ms5/5

Request

POST /api/payments/pay_1387ba7cfea4/refund

{
  "reason" : "Customer requested partial cancellation",
  "amount" : 10.0
}

Response (HTTP 200, 7ms)

{
  "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"
}

Assertions (5/5 passed)

FieldExpectedActualStatus
createdAtnon-null2026-05-09T02:20:07.348071Z
refundReasonCustomer requested partial cancellationCustomer requested partial cancellation
idnon-nullpay_1387ba7cfea4
statusPARTIALLY_REFUNDEDPARTIALLY_REFUNDED
updatedAtnon-null2026-05-09T02:20:07.355221Z
Refund with minimum allowed amount boundary valueBOUNDARY3ms5/5

Request

POST /api/payments/pay_0b8615561fc1/refund

{
  "reason" : "Minimum boundary refund test",
  "amount" : 0.01
}

Response (HTTP 200, 3ms)

{
  "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"
}

Assertions (5/5 passed)

FieldExpectedActualStatus
createdAtnon-null2026-05-09T02:20:07.358351Z
refundReasonMinimum boundary refund testMinimum boundary refund test
idnon-nullpay_0b8615561fc1
statusPARTIALLY_REFUNDEDPARTIALLY_REFUNDED
updatedAtnon-null2026-05-09T02:20:07.361337Z
Refund with missing required reason fieldNEGATIVE3ms2/2

Request

POST /api/payments/pay_394ad81f4c8f/refund

{
  "amount" : 10.0
}

Response (HTTP 400, 3ms)

{
  "status" : 400,
  "code" : "VALIDATION_ERROR",
  "message" : "Request validation failed",
  "errors" : [ {
    "field" : "reason",
    "message" : "不能为空"
  } ],
  "timestamp" : "2026-05-09T02:20:07.366733Z"
}

Assertions (2/2 passed)

FieldExpectedActualStatus
codeVALIDATION_ERRORVALIDATION_ERROR
status400400