Skip to content

Fix: Implement unit tests and a model validator for the PaymentInfo pydantic model #1218

@Sulai-maan

Description

@Sulai-maan

Describe the solution you'd like

Implement unit tests and extra validators for the PaymentInfo pydantic model. The data model, which is used to process card payments, currently only checks for correct card number and cvv character count, and is not covered by any unit tests. I want to implement a model validator that checks for expired cards - so we don't call payment processor APIs with expired cards - and write unit tests for the model.

Acceptance Criteria

  • Model rejects expired cards and rasises an error
  • Unit tests cover all field and model validators

Testing Requirements
Unit Tests:

  • Write and run unit tests to validate input data.
    Integration Tests:
  • Ensure end-to-end functionality is tested with integration tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions