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.

Shared

Applies to all gateways.

Variable Required Description
PAYMENTHUB_HANDLE_PREFIX No Prefix applied to every order handle, and to the customer handle the PSP lookup starts from — see Gateways → Customer provisioning. Must stay stable per environment: changing it makes existing PSP customers unreachable and causes "Customer not found" errors.
PAYMENTHUB_CHECKOUT_VERIFY_ENDPOINT No Checkout endpoint used for the payment verification page. Defaults to verify-payment.

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 );
}