Skip to content

Configuration

Gateway configuration is loaded from environment variables at boot time via PaymentConfigFactory::createFromEnvironment(). Use a .env file (excluded from version control) or your hosting environment's config management.

A gateway is only registered if its required credentials are present.

MobilePay

Variable Required Description
MOBILEPAY_CLIENT_ID Yes OAuth client ID
MOBILEPAY_CLIENT_SECRET Yes OAuth client secret
MOBILEPAY_OCP_APIM_SUBSCRIPTION_KEY Yes Azure API Management subscription key
MOBILEPAY_MSN Yes Merchant serial number
MOBILEPAY_WEBHOOK_SECRET Yes HMAC secret for webhook signature verification
MOBILEPAY_SANDBOX No Set to true to use the sandbox environment

Frisbii

Variable Required Description
FRISBII_PRIVATE_KEY Yes API private key
FRISBII_WEBHOOK_SECRET Yes HMAC secret for webhook signature verification

Checking gateway status at runtime

use Subscribed\PaymentsHub\Config\PaymentGatewayConfig;
use Subscribed\PaymentsHub\Corenums\GatewayProvider;

$config = $container->get( PaymentGatewayConfig::class );

if ( $config->isGatewayEnabled( GatewayProvider::FRISBII ) ) {
    $frisbiiConfig = $config->getConfig( GatewayProvider::FRISBII );
}

Or via helper functions:

if ( paymenthub_is_gateway_enabled( GatewayProvider::MOBILEPAY ) ) {
    $config = paymenthub_get_gateway_config( GatewayProvider::MOBILEPAY );
}