Gateway integration¶
Supported gateways¶
| Provider constant | Value | Class |
|---|---|---|
GatewayProvider::MOBILEPAY | mobilepay | MobilePayGateway |
GatewayProvider::FRISBII | frisbii | FrisbiiGateway |
Frisbii surfaces multiple WooCommerce payment methods: Credit Card, Apple Pay, Google Pay, MobilePay Online, iDEAL, and PayPal.
Using gateways¶
Never call gateway clients directly from outside the Core layer. Always go through the container-provided services:
// Get agreement service from container
$agreementService = $container->get( AgreementService::class );
// Create an agreement (mandate) for a subscription
$response = $agreementService->createAgreement( $createAgreementRequest );
// Get payment service
$paymentService = $container->get( PaymentService::class );
// Create a recurring payment against an existing agreement
$response = $paymentService->createRecurringPayment( $createRecurringPaymentRequest );
Request factory pattern¶
Build request objects via the provided factories rather than instantiating them directly:
$factory = $container->get( PaymentRequestFactory::class );
$request = $factory->createCaptureRequest( $payment );
Gateway interface hierarchy¶
BasePaymentGatewayInterface
├── PaymentGatewayInterface # create, capture, refund, cancel
├── RecurringPaymentGatewayInterface # createRecurring, captureRecurring, …
├── AgreementSessionGatewayInterface # createAgreementSession
└── PaymentSessionGatewayInterface # createPaymentSession
Both MobilePayGateway and FrisbiiGateway implement the relevant interfaces for their supported operations.