Skip to main content

Installation Steps

  1. Install and activate Monime Gateway.
  2. Add your custom plugin or theme code that implements the Monime adapter interfaces.
  3. Load your adapter classes from the main plugin file.
  4. Register the payment adapter from the main plugin file during plugin boot.
  5. If your plugin handles webhooks, load and register the webhook adapter from the same main plugin file.
The important installation detail is timing: Monime must know about your adapter before it builds a checkout session or dispatches a webhook. If the adapter class is not loaded early enough, Monime cannot register it during boot. For a small plugin, keep the integration code in a dedicated class file and load it from your main plugin bootstrap file. Example structure:
my-custom-plugin/
  my-custom-plugin.php
  includes/
    class-custom-monime-adapter.php

Example Registration

<?php

use Monime\registry\AdapterRegistry;

require_once __DIR__ . '/includes/class-custom-monime-adapter.php';

add_action('plugins_loaded', function () {
    if (class_exists(AdapterRegistry::class) && class_exists(CustomMonimeAdapter::class)) {
        AdapterRegistry::registerAdapter(new CustomMonimeAdapter());
    }
});

If You Also Handle Webhooks

If your custom plugin processes webhook data, make sure the webhook adapter class is also loaded and the same adapter instance implements WebhookAdapterInterface. In practice, that means your main plugin file should:
  • require the adapter class file,
  • register the payment adapter,
  • and expose the webhook handler before Monime initializes its shared webhook service.
If your plugin uses a separate webhook class, load that class from the main plugin file as well so it is available when Monime receives a verified webhook payload.

Verify the Setup

Confirm that your adapter class is available and that Monime can load it without autoloading errors. You can verify this by:
  • loading a page that triggers plugin boot,
  • checking your PHP error log for class-loading problems,
  • and running a test checkout plus a test webhook to confirm that both the payment flow and callback flow work.