as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
AWS
Documentation
Support
Contact Us
My Cases
Docs
Resources
Ecommerce Plug-ins
Publish
Connect

Capture Charge Testing

Summary

While the test cases below outline key testing scenarios, it should be supplemented with your organization's established testing best practices to ensure comprehensive coverage of any use cases not explicitly included in this test plan.

1. Test Case: Successful Capture (200 Response)

Objective: Trigger successful charge capture

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "valid-shopping-trip-uuid",
  "amount": {
    "amount": 25.99,
    "code": "USD"
  }
}

Expected Response:

  • Status Code: 200 OK
  • Body: Empty response body

2. Test Case: Unknown Shopping Trip (400 Error)

Objective: Trigger "UnknownShoppingTrip" error

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "invalid-shopping-trip-uuid",
  "amount": {
    "amount": 10.00,
    "code": "USD"
  }
}

Expected Response:

{
  "errorMsg": "UnknownShoppingTrip"
}

3. Test Case: Bad Request - Invalid Store ID (400 Error)

Objective: Trigger "BadRequestException" for invalid storeId format

{
  "storeId": "INVALID@STORE#ID",
  "shoppingTripId": "valid-shopping-trip-uuid",
  "amount": {
    "amount": 10.00,
    "code": "USD"
  }
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

4. Test Case: Bad Request - Missing Required Fields (400 Error)

Objective: Trigger "BadRequestException" for missing storeId

{
  "shoppingTripId": "valid-shopping-trip-uuid",
  "amount": {
    "amount": 10.00,
    "code": "USD"
  }
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

5. Test Case: Bad Request - Missing Shopping Trip ID (400 Error)

Objective: Trigger "BadRequestException" for missing shoppingTripId

{
  "storeId": "VALID_STORE_ID",
  "amount": {
    "amount": 10.00,
    "code": "USD"
  }
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

6. Test Case: Bad Request - Missing Amount (400 Error)

Objective: Trigger "BadRequestException" for missing amount

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "valid-shopping-trip-uuid"
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

7. Test Case: Bad Request - Invalid Amount Data Type (400 Error)

Objective: Trigger "BadRequestException" for incorrect amount data type

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "valid-shopping-trip-uuid",
  "amount": {
    "amount": "invalid_string_amount",
    "code": "USD"
  }
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

8. Test Case: Bad Request - Invalid Currency Code Format (400 Error)

Objective: Trigger "BadRequestException" for invalid currency code pattern ^[A-Z]{3}$

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "valid-shopping-trip-uuid",
  "amount": {
    "amount": 10.00,
    "code": "invalid"
  }
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

9. Test Case: Bad Request - Currency Code Too Long (400 Error)

Objective: Trigger "BadRequestException" for currency code > 3 characters

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "valid-shopping-trip-uuid",
  "amount": {
    "amount": 10.00,
    "code": "TOOLONG"
  }
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

10. Test Case: StoreId Format Validation (400 Error)

Objective: Test storeId pattern validation ^[0-9a-zA-Z_-]*$

{
  "storeId": "invalid@store#id!",
  "shoppingTripId": "valid-shopping-trip-uuid",
  "amount": {
    "amount": 10.00,
    "code": "USD"
  }
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

11. Test Case: ShoppingTripId Format Validation (400 Error)

Objective: Test shoppingTripId pattern validation ^[0-9a-zA-Z_-]+$

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "invalid@trip#id!",
  "amount": {
    "amount": 10.00,
    "code": "USD"
  }
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

12. Test Case: Field Length Validation (400 Error)

Objective: Test field length limits (> 255 characters)

{
  "storeId": "A".repeat(256),
  "shoppingTripId": "valid-shopping-trip-uuid",
  "amount": {
    "amount": 10.00,
    "code": "USD"
  }
}

Expected Response:

{
  "errorMsg": "BadRequestException"
}

13. Test Case: Rate Limiting (429 Error)

Objective: Trigger "Too Many Requests" error

Test Method: Send multiple rapid requests to exceed rate limit

Expected Response:

{
  "errorMsg": "Too Many Requests"
}

Headers: Retry-After: 600

14. Test Case: Server Error (500 Error)

Objective: Trigger "ServiceException"

Test Method: This typically occurs during server issues or unhandled exceptions

Expected Response:

{
  "errorMsg": "ServiceException"
}

15. Test Case: Service Unavailable (503 Error)

Objective: Trigger "ServiceUnavailableException"

Test Method: Send request during maintenance or service downtime

Expected Response:

{
  "errorMsg": "Service temporarily unavailable",
  "retryAfter": "300"
}

16. Test Case: Zero Amount (400 Error)

Objective: Test zero amount validation

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "valid-shopping-trip-uuid",
  "amount": {
    "amount": 0,
    "code": "USD"
  }
}

17. Test Case: Negative Amount (400 Error)

Objective: Test negative amount validation

{
  "storeId": "VALID_STORE_ID",
  "shoppingTripId": "valid-shopping-trip-uuid",
  "amount": {
    "amount": -10.00,
    "code": "USD"
  }
}

18. Test Case: Empty String Values (400 Error)

Objective: Test empty string validation

{
  "storeId": "",
  "shoppingTripId": "",
  "amount": {
    "amount": 10.00,
    "code": ""
  }
}

19. Test Case: Null Values (400 Error)

Objective: Test null value handling

{
  "storeId": null,
  "shoppingTripId": null,
  "amount": null
}