19 lines
564 B
PHP
19 lines
564 B
PHP
<?php
|
|
|
|
namespace App\Domains\Integration\Services;
|
|
|
|
use App\Domains\Integration\Services\Contracts\PaymentProviderInterface;
|
|
use App\Domains\Integration\Services\Providers\TelepagosProvider;
|
|
use InvalidArgumentException;
|
|
|
|
class PaymentProviderFactory
|
|
{
|
|
public function make(string $integrationCode): PaymentProviderInterface
|
|
{
|
|
return match ($integrationCode) {
|
|
'telepagos' => new TelepagosProvider(),
|
|
default => throw new InvalidArgumentException("Integración de pago no soportada: {$integrationCode}"),
|
|
};
|
|
}
|
|
}
|