1 | <?php |
||
19 | abstract class PaymentService extends Object{ |
||
20 | |||
21 | /** |
||
22 | * @var Guzzle\Http\ClientInterface |
||
23 | */ |
||
24 | private static $httpclient; |
||
25 | |||
26 | /** |
||
27 | * @var Guzzle\Http\Message\Request |
||
28 | */ |
||
29 | private static $httprequest; |
||
30 | |||
31 | /** |
||
32 | * @var Payment |
||
33 | */ |
||
34 | protected $payment; |
||
35 | |||
36 | /** |
||
37 | * @var String |
||
38 | */ |
||
39 | protected $returnurl; |
||
40 | |||
41 | /** |
||
42 | * @var String |
||
43 | */ |
||
44 | protected $cancelurl; |
||
45 | |||
46 | /** |
||
47 | * @var Guzzle\Http\Message\Response |
||
48 | */ |
||
49 | protected $response; |
||
50 | |||
51 | /** |
||
52 | * @var GatewayFactory |
||
53 | */ |
||
54 | protected $gatewayFactory; |
||
55 | |||
56 | private static $dependencies = array( |
||
57 | 'gatewayFactory' => '%$\Omnipay\Common\GatewayFactory', |
||
58 | ); |
||
59 | |||
60 | |||
61 | /** |
||
62 | * @param Payment |
||
63 | */ |
||
64 | public function __construct(Payment $payment) { |
||
68 | |||
69 | /** |
||
70 | * Get the url to return to, that has been previously stored. |
||
71 | * This is not a database field. |
||
72 | * @return string the url |
||
73 | */ |
||
74 | public function getReturnUrl() { |
||
77 | |||
78 | /** |
||
79 | * Set the url to redirect to after payment is made/attempted. |
||
80 | * This function also populates the cancel url, if it is empty. |
||
81 | * @return PaymentService this object for chaining |
||
82 | */ |
||
83 | public function setReturnUrl($url) { |
||
91 | |||
92 | /** |
||
93 | * @return string cancel url |
||
94 | */ |
||
95 | public function getCancelUrl() { |
||
98 | |||
99 | /** |
||
100 | * Set the url to redirect to after payment is cancelled |
||
101 | * @return PaymentService this object for chaining |
||
102 | */ |
||
103 | public function setCancelUrl($url) { |
||
108 | |||
109 | /** |
||
110 | * Get the appropriate redirect url |
||
111 | */ |
||
112 | public function getRedirectURL() { |
||
123 | |||
124 | /** |
||
125 | * Update class properties via array. |
||
126 | */ |
||
127 | public function update($data) { |
||
135 | |||
136 | |||
137 | /** |
||
138 | * Get the omnipay gateway associated with this payment, |
||
139 | * with configuration applied. |
||
140 | * |
||
141 | * @throws RuntimeException - when gateway doesn't exist. |
||
142 | * @return AbstractGateway omnipay gateway class |
||
143 | */ |
||
144 | public function oGateway() { |
||
158 | |||
159 | /** |
||
160 | * Generate a return/notify url for off-site gateways (completePayment). |
||
161 | * @return string endpoint url |
||
162 | */ |
||
163 | protected function getEndpointURL($action, $identifier) { |
||
166 | |||
167 | /** |
||
168 | * Record a transaction on this for this payment. |
||
169 | * @param string $type the type of transaction to create. |
||
170 | * This is any class that is (or extends) PaymentMessage. |
||
171 | * @param array|string|AbstractResponse|AbstractRequest|OmnipayException $data the response to record, or data to store |
||
172 | * @return GatewayTransaction newly created dataobject, saved to database. |
||
173 | */ |
||
174 | protected function createMessage($type, $data = null) { |
||
223 | |||
224 | /** |
||
225 | * Helper function for logging gateway requests |
||
226 | */ |
||
227 | protected function logToFile($data, $type = "") { |
||
244 | |||
245 | protected function createGatewayResponse() { |
||
250 | |||
251 | /** |
||
252 | * @return GatewayFactory |
||
253 | */ |
||
254 | public function getGatewayFactory() { |
||
261 | |||
262 | /** |
||
263 | * @param GatewayFactory $gatewayFactory |
||
264 | * |
||
265 | * @return $this |
||
266 | */ |
||
267 | public function setGatewayFactory($gatewayFactory) { |
||
271 | |||
272 | //testing functions (could these instead be injected somehow?) |
||
273 | |||
274 | |||
275 | /** |
||
276 | * Set the guzzle client (for testing) |
||
277 | * @param Guzzle\Http\ClientInterface $httpClient guzzle client for testing |
||
278 | */ |
||
279 | public static function set_http_client(Guzzle\Http\ClientInterface $httpClient) { |
||
282 | |||
283 | public static function get_http_client() { |
||
286 | |||
287 | /** |
||
288 | * Set the symphony http request (for testing) |
||
289 | * @param Symfony\Component\HttpFoundation\Request $httpRequest symphony http request for testing |
||
290 | */ |
||
291 | public static function set_http_request(Symfony\Component\HttpFoundation\Request $httpRequest) { |
||
294 | |||
295 | public static function get_http_request() { |
||
298 | |||
299 | } |
||
300 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.