1 | <?php |
||
7 | class OmnipayGatewayManager |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * The application instance. |
||
12 | * |
||
13 | * @var \Illuminate\Foundation\Application |
||
14 | */ |
||
15 | protected $app; |
||
16 | |||
17 | /** |
||
18 | * @var GatewayFactory |
||
19 | */ |
||
20 | protected $factory; |
||
21 | |||
22 | /** |
||
23 | * The default settings, applied to every gateway |
||
24 | */ |
||
25 | protected $defaults; |
||
26 | |||
27 | /** |
||
28 | * The registered gateways |
||
29 | */ |
||
30 | protected $gateways; |
||
31 | |||
32 | /** |
||
33 | * The default gateway override |
||
34 | */ |
||
35 | protected $gateway; |
||
36 | |||
37 | /** |
||
38 | * Create a new Gateway manager instance. |
||
39 | * |
||
40 | * @param \Illuminate\Foundation\Application $app |
||
41 | * @param \Omnipay\Common\GatewayFactory $factory |
||
42 | * @param array |
||
43 | */ |
||
44 | public function __construct($app, GatewayFactory $factory, $defaults = []) |
||
51 | |||
52 | /** |
||
53 | * Get a gateway |
||
54 | * |
||
55 | * @return \Omnipay\Common\GatewayInterface |
||
56 | */ |
||
57 | public function makeGateway() |
||
69 | |||
70 | /** |
||
71 | * Get the configuration, based on the config and the defaults. |
||
72 | * @param string $name |
||
73 | * @return array |
||
74 | */ |
||
75 | protected function getConfig(string $name) |
||
82 | |||
83 | /** |
||
84 | * Get the default gateway name. |
||
85 | * |
||
86 | * @return string |
||
87 | */ |
||
88 | public function getDefaultGateway() |
||
92 | |||
93 | /** |
||
94 | * Set the default gateway name. |
||
95 | * |
||
96 | * @param string $name |
||
97 | * @return void |
||
98 | */ |
||
99 | public function setDefaultGateway(string $name) |
||
103 | |||
104 | /** |
||
105 | * @param string $name |
||
106 | * @return OmnipayGatewayManager |
||
107 | */ |
||
108 | public function withGateway(string $name) |
||
114 | |||
115 | /** |
||
116 | * Dynamically call the default driver instance. |
||
117 | * |
||
118 | * @param string $method |
||
119 | * @param array $parameters |
||
120 | * @return mixed |
||
121 | */ |
||
122 | public function __call($method, $parameters) |
||
126 | } |
||
127 |