moved website outside of panel folder
This commit is contained in:
parent
92ac778956
commit
08f07dca97
10328 changed files with 90 additions and 501 deletions
|
|
@ -1,30 +0,0 @@
|
|||
<?php
|
||||
require_once __DIR__ . '/../classes/PaymentGatewayInterface.php';
|
||||
require_once __DIR__ . '/../classes/PayPalGateway.php';
|
||||
require_once __DIR__ . '/../classes/ManualGateway.php';
|
||||
require_once __DIR__ . '/../classes/StripeGateway.php';
|
||||
|
||||
/**
|
||||
* Factory for instantiating payment gateways by name.
|
||||
*/
|
||||
class GatewayFactory
|
||||
{
|
||||
/**
|
||||
* @param string $name Gateway name: 'paypal', 'stripe', 'manual'
|
||||
* @return PaymentGatewayInterface
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public static function make(string $name): PaymentGatewayInterface
|
||||
{
|
||||
switch (strtolower($name)) {
|
||||
case 'paypal':
|
||||
return PayPalGateway::fromConfig();
|
||||
case 'manual':
|
||||
return new ManualGateway();
|
||||
case 'stripe':
|
||||
return new StripeGateway();
|
||||
default:
|
||||
throw new InvalidArgumentException("Unknown payment gateway: {$name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue