1. Go to this page and download the library: Download moffhub/connector-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
moffhub / connector-sdk example snippets
use Moffhub\ConnectorSdk\BaseConnector;
use Moffhub\MpsSpec\Contracts\HasChargeCapability;
use Moffhub\MpsSpec\Data\{ChargeRequest, ChargeResponse, ConfigField, ConnectorManifest};
use Moffhub\MpsSpec\Enums\{Capability, Channel, ChargeStatus, SettlementModel};
final class AcmeConnector extends BaseConnector implements HasChargeCapability
{
public function manifest(): ConnectorManifest
{
return new ConnectorManifest(
connectorId: 'acme',
displayName: 'Acme Payments',
version: '1.0.0',
specVersion: '0.1',
vendorName: 'Acme Inc.',
vendorWebsite: 'https://acme.example',
vendorSupportEmail: '[email protected]',
supportedChannels: [Channel::Card],
supportedCurrencies: ['USD'],
capabilities: [Capability::Payment],
settlementModel: SettlementModel::T1,
use Moffhub\ConnectorSdk\Support\WebhookVerifier;
$verifier = new WebhookVerifier(secret: $this->/ Throws WebhookVerificationFailedException on mismatch
use Moffhub\ConnectorSdk\SandboxConnector;
$connector = new SandboxConnector();
$connector->initialize([]);
$response = $connector->createCharge($request); // returns deterministic fake data
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.