Skip to content

Add webhook support for WooCommerce platform #19

@Prateek32177

Description

@Prateek32177

We want to add webhook support for WooCommerce in tern. WooCommerce sends events for orders, customers, products, and more.

Tasks

  • Webhook Handler:
    • Implement a handler in /src/platforms/woocommerce.ts.
    • Normalize payloads into tern’s event structure (id, type, timestamp, payload).
  • Platform Config:
    • Add platformConfigs.woocommerce with supported event types (e.g., order.created, order.updated, customer.created).
  • Test Cases:
    • Add fixtures for at least 3 event types (order created, customer created, product updated).
    • Write Jest tests in /tests/woocommerce.test.ts to validate parsing.
  • Docs:
    • Add setup instructions in /docs/platforms.md.
    • Example: how to configure a webhook in WooCommerce dashboard.
  • Acceptance Criteria:
    • WooCommerce handler implemented
    • Tests cover 3+ event types
    • Docs updated
  • Final Integration Testing:
    • Trigger a webhook event from the WooCommerce dashboard (use the “Send Test Event” option if available).
    • Verify the signature using the platform’s signing secret/HMAC.
    • The event should pass verification if the signature is correct.
    • The event should fail verification if the signature is invalid.
    • Add a test case in Jest covering both valid and invalid signature scenarios.

Contributor directive:

  • Mention this issue and its number in your PR to get it linked with the issue.

Helpful Links: WooCommerce Webhooks Docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions