File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
src/Ignited/LaravelOmnipay Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ class LaravelOmnipayManager {
25
25
*/
26
26
protected $ gateway ;
27
27
28
+ /**
29
+ * The Guzzle client to use (null means use default)
30
+ * @var \Guzzle\Http\Client|null
31
+ */
32
+ protected $ httpClient ;
33
+
28
34
/**
29
35
* The array of resolved queue connections.
30
36
*
@@ -70,7 +76,7 @@ protected function resolve($name)
70
76
throw new \UnexpectedValueException ("Gateway [ $ name] is not defined. " );
71
77
}
72
78
73
- $ gateway = $ this ->factory ->create ($ config ['driver ' ]);
79
+ $ gateway = $ this ->factory ->create ($ config ['driver ' ], $ this -> getHttpClient () );
74
80
75
81
$ class = trim (Helper::getGatewayClassName ($ config ['driver ' ]), "\\" );
76
82
@@ -117,6 +123,16 @@ public function setGateway($name)
117
123
$ this ->gateway = $ name ;
118
124
}
119
125
126
+ public function setHttpClient ($ httpClient )
127
+ {
128
+ $ this ->httpClient = $ httpClient ;
129
+ }
130
+
131
+ public function getHttpClient ()
132
+ {
133
+ return $ this ->httpClient ;
134
+ }
135
+
120
136
public function __call ($ method , $ parameters )
121
137
{
122
138
$ callable = [$ this ->gateway (), $ method ];
@@ -128,4 +144,4 @@ public function __call($method, $parameters)
128
144
129
145
throw new \BadMethodCallException ("Method [ $ method] is not supported by the gateway [ $ this ->gateway ]. " );
130
146
}
131
- }
147
+ }
You can’t perform that action at this time.
0 commit comments