| 1 | <?php |
||
| 5 | class GatewayFactory |
||
| 6 | { |
||
| 7 | const GATEWAY_NAMESPACE = 'Larium\\Pay\\Gateway\\'; |
||
| 8 | |||
| 9 | private static $gateways = []; |
||
| 10 | |||
| 11 | private function __construct() |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Register a gateway with given name and class name. |
||
| 17 | * |
||
| 18 | * @throws Larium\Pay\GatewayException |
||
| 19 | * |
||
| 20 | * @param string $name The unique name for the gateway. |
||
| 21 | * @param string $className The full class name of gateway. |
||
| 22 | * @return void |
||
| 23 | */ |
||
| 24 | public static function register($name, $className) |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Return an instance of a Gateway based on given name. |
||
| 34 | * |
||
| 35 | * @param string $name The registered name of Gateway |
||
| 36 | * @param array $options Options for gateway |
||
| 37 | * @return Larium\Pay\Gateway\Gateway |
||
| 38 | */ |
||
| 39 | 2 | public static function create($name, array $options = []) |
|
| 55 | } |
||
| 56 |