Skip to content

Integrations Overview

MIDDAG Account centralizes your B2B operations without replacing the tools your team already uses. Stripe handles payments, HubSpot manages your CRM pipeline, Jira tracks service requests, and ISSNet issues tax invoices. The plugin sits at the center, connecting data flows and keeping everything in sync.

Philosophy

Three principles guide how MIDDAG Account approaches integrations:

  1. Centralize, don't replace. Each external system remains the authority for what it does best. MIDDAG Account reads, syncs, and orchestrates -- it does not duplicate functionality.
  2. Webhook-first. Integrations prefer real-time webhooks over periodic polling. Polling is used only when the external system does not support webhooks (ISSNet).
  3. Graceful degradation. If an external service is down, the plugin continues to function. Sync recovers automatically when the connection is restored.

ConnectorRegistry

All integrations flow through the ConnectorRegistry, a central component that maps organizations to their configured connectors. When a domain event fires (an order is paid, an entitlement is activated), the registry resolves the correct connector instance for the organization involved.

The registry supports per-organization configuration. An organization linked to the Brazilian entity uses Stripe BR and HubSpot BR; an international organization uses their US counterparts. Configuration is persisted encrypted in WordPress options.

Available integrations

These integrations are implemented and working in the current release.

IntegrationDirectionWhat it does
StripeBidirectionalPayment processing, subscriptions, invoices, refunds
HubSpotBidirectionalCRM sync, deal pipelines, quote lifecycle
ISSNetOutboundBrazilian tax invoice (NFSe) generation via SOAP
Banco InterInboundPix and Boleto payments for Brazil
CloudflareOutboundD1 edge database and R2 object storage
JiraBidirectionalService request sync, worklogs, SLA tracking
WooCommerceBidirectionalOrders, products, subscriptions
SolidAffiliateInboundPartner program, referrals, commissions

Planned integrations

IntegrationDescription
ChatwootCustomer support chat with entitlement context
Outbound webhooksEvent catalog for notifying your external systems

Dual-account support

MIDDAG operates two legal entities: MIDDAG Tecnologia LTDA (Brazil, BRL) and MIDDAG, LLC (United States, USD). Stripe and HubSpot both run in dual-account mode, with separate credentials, webhook endpoints, and customer records per entity. The plugin handles routing automatically based on the organization's billing entity.

Integration health

Every inbound webhook is logged with a timestamp, direction, payload hash, and processing result. Failed events are retried with exponential backoff. The admin dashboard surfaces integration health so you can spot issues before they affect customers.

Key health indicators:

  • Webhook processing rate -- percentage of webhooks processed successfully in the last 24 hours.
  • Sync lag -- time since the last successful sync for each integration.
  • Failed events -- count of events that exhausted retry attempts and require manual review.

Idempotency

All webhook handlers are idempotent. Duplicate events (common during retries) do not create duplicate records. Each handler checks the event ID against previously processed events before taking action.

Audit trail

Every integration event is recorded with:

  • Timestamp
  • Direction (inbound or outbound)
  • Payload hash
  • Processing status (success, failed, skipped)
  • Source integration and account

This trail is essential for debugging sync issues and for compliance auditing.

Next steps