Skip to content

Architecture

Overview

The plugin follows a modular PHP architecture under the Adyen namespace, autoloaded via Composer PSR-4 (inc/). JavaScript assets live in src/ and are compiled to dist/ via Laravel Mix.

Directory structure

inc/
  API/
    Notifications/      Webhook endpoint, handler, HMAC security, event code handlers
    Populator.php       Builds Adyen API request payloads from WooCommerce orders
  Backend/
    AdminEndpoints.php  Admin REST/AJAX endpoints
    Ajax.php            WP AJAX handlers
    OrderNotifications.php  Meta box showing Adyen notifications on order screen
    Orders.php          Order management helpers
    OrderNotifications.php  Admin meta box (Vue app host)
    Subscriptions.php   Subscription admin helpers
  Data/
    NotificationStore.php   DB read/write for stored notifications
    Notification.php        Notification model
  Exceptions/           Custom exceptions (HMAC, base, recurring payment, auth)
  Extensions/
    ExtensionsProvider.php  Registers plugin extensions/integrations
  Frontend/
    Template.php        Frontend template helpers
  Gateway/
    Gateway.php         Abstract base WooCommerce payment gateway
    CreditCard.php      Concrete gateway: credit card (adyen_creditcard)
    IDEAL.php           Concrete gateway: iDEAL (adyen_ideal)
    ApiMethods.php      Shared API method helpers used by gateways
  Helpers/              General utility helpers
  Models/               Data models (notifications, etc.)
  Modules/
    ChangePaymentMethod.php   Allows customers to change payment method on subscriptions
    GatewaySetup.php          Registers gateways with WooCommerce
    Mollie.php                Mollie migration compatibility module
    NotificationScheduler.php Schedules and processes Adyen notifications via Action Scheduler
    OrderBulkActions.php      Adds bulk order actions in WP admin
    OrdersManager.php         Order status transition logic
    OrderStatuses.php         Registers custom Adyen order statuses
    SettingsPage.php          Plugin admin settings page
    SubscriptionsManager.php  Handles WooCommerce Subscriptions renewal payments
  Traits/
    Module.php          Provides logger and shared module behaviour
    Singleton.php       Singleton instantiation helper
src/
  frontend/             Checkout JS (credit card Drop-in, iDEAL)
  order-notifications/  Vue 2 app rendered inside the WP admin order meta box

Key design patterns

  • Singleton — gateways and key services use Traits\Singleton to ensure a single instance.
  • Module trait — most classes use Traits\Module which provides a PSR-3 compatible logger and a standard init() hook registration entry point.
  • Action Scheduler — async notification processing uses Action Scheduler (as_schedule_recurring_action) rather than WP-Cron directly, for reliability.
  • WooCommerce hooks — all gateway registration, order status changes and admin UI additions go through WooCommerce/WP hooks, never direct class calls.