BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
home
/
imagivibe
/
public_html
/
app.imagivibe.com
/
app
/
Services
/
Payment
/
Factories
📤 Upload
📝 New File
📁 New Folder
Close
Editing: GatewayFactory.php
<?php namespace App\Services\Payment\Factories; use App\Services\Payment\Contracts\PaymentGatewayInterface; use App\Services\Payment\Enums\PaymentGatewayEnum; use App\Services\Payment\Gateways\TwoCheckoutGateway; use InvalidArgumentException; class GatewayFactory { public static function make(PaymentGatewayEnum $gateway): PaymentGatewayInterface { return match ($gateway) { PaymentGatewayEnum::TwoCheckout => new TwoCheckoutGateway, // Add other gateways here as needed default => throw new InvalidArgumentException("Unsupported payment gateway: {$gateway->value}"), }; } }
Save
Cancel