File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,13 +130,12 @@ class PayFastController
130130{
131131 public function webhook(Request $request)
132132 {
133- // From the PayFast docs... Send a 200 response right away...
134- header('HTTP/1.0 200 OK');
135- flush();
136-
137133 // Create a new validator
138134 $validator = new \TPG\PayFast\ItnValidator($request->input());
139135
136+ // From the PayFast docs... Send a 200 response right away...
137+ $validator->flush();
138+
140139 // You have access to all the response data through the `PayfastResponse` class.
141140 $response = $validator->response();
142141
Original file line number Diff line number Diff line change @@ -21,6 +21,17 @@ public function __construct(array $responseData)
2121 $ this ->response = new PayFastResponse ($ responseData );
2222 }
2323
24+ /**
25+ * @deprecated Version 1 will flush on ItnValidator construction. Won't need to call this at all.
26+ */
27+ public function flush (): self
28+ {
29+ header ('HTTP/1.0 200 OK ' );
30+ flush ();
31+
32+ return $ this ;
33+ }
34+
2435 public function testing (bool $ testing = true ): self
2536 {
2637 $ this ->testing = $ testing ;
You can’t perform that action at this time.
0 commit comments