Download the PHP package moffhub/connector-sdk without Composer
On this page you can find all versions of the php package moffhub/connector-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download moffhub/connector-sdk
More information about moffhub/connector-sdk
Files in moffhub/connector-sdk
Package connector-sdk
Short Description SDK for building MPS-compliant payment and service connectors. Base classes, HTTP client, webhook verification, and a sandbox connector.
License MIT
Homepage https://github.com/Moffhub-Solutions/connector-sdk
Informations about the package connector-sdk
Moffhub Connector SDK
Base classes and helpers for building MPS-compliant payment and service connectors. Extend BaseConnector, declare your manifest, implement the capabilities you support, and you're done — config validation, lifecycle, and HTTP plumbing are handled for you.
This package implements the contracts defined in moffhub/mps-spec.
Installation
Requires PHP 8.3+. Pulls in moffhub/mps-spec and guzzlehttp/guzzle.
What you get
BaseConnector— abstract base for payment connectors. ImplementsConnectorInterface(initialize/healthCheck/destroy) and validates config against the manifest.BaseServiceConnector— abstract base for service connectors (domain logic providers).SandboxConnector— in-memory connector for tests and local development. Use it as a stand-in when you don't want to hit a real provider.Support\HttpClient— thin Guzzle wrapper with sensible defaults (timeouts, JSON, retries) for talking to provider APIs.Support\WebhookVerifier— HMAC signature verification helper for webhook endpoints.
Quick start: a payment connector
Wiring it up
initialize() validates the supplied config against requiredConfig from your manifest and throws InvalidArgumentException if anything required is missing.
Helpers
HttpClient — talking to providers
WebhookVerifier — verifying inbound webhooks
SandboxConnector — in-memory connector for tests
Service connectors
Use BaseServiceConnector instead of BaseConnector for service connectors (domain logic providers — utility lookups, ticketing, etc.). The lifecycle is the same; the contract is ServiceConnectorInterface from moffhub/mps-spec.
Testing your connector
The Moffhub CLI (moffhub/cli) ships a certification suite that exercises your connector against the spec — manifest validation, capability conformance, lifecycle, and contract tests. See its README for usage.
License
MIT. See LICENSE.