Skip to content

[TEST] Add integration tests for payment webhook endpoints #321

@aniebietafia

Description

@aniebietafia

Problem

Stripe, PayPal, and Paystack webhooks are responsible for updating user credits and subscription statuses. These endpoints process raw JSON payloads, compute signatures, and trigger database modifications. They currently lack integration test coverage.

Proposed Solution

Create integration tests that mock external payment gateway requests. Send raw payload signatures to webhook endpoints using Spring's MockMvc and verify that the database correctly updates subscription and transactional records.

User Stories

  • As an operator, I want webhook endpoints verified automatically to guarantee that subscriptions update correctly upon receipt of payment events.

Acceptance Criteria

  • Webhook integration tests mock signature validation.
  • Mock transactions execute successfully and modify test database records.

Tasks

  • Create StripeWebhookIntegrationTest.java, PaystackWebhookIntegrationTest.java, and PayPalWebhookIntegrationTest.java.
  • Draft sample event payloads.
  • Assert status modifications in test database fixtures.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions