1 | <?php namespace Arcanedev\NoCaptcha; |
||
12 | class NoCaptchaV3 extends AbstractNoCaptcha |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Properties |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | /** |
||
20 | * Decides if we've already loaded the script file or not. |
||
21 | * |
||
22 | * @param bool |
||
23 | */ |
||
24 | protected $scriptLoaded = false; |
||
25 | |||
26 | /* ----------------------------------------------------------------- |
||
27 | | Main Methods |
||
28 | | ----------------------------------------------------------------- |
||
29 | */ |
||
30 | |||
31 | /** |
||
32 | * @param string $name |
||
33 | * |
||
34 | * @return \Illuminate\Support\HtmlString |
||
35 | */ |
||
36 | 12 | public function input($name = 'g-recaptcha-response') |
|
42 | |||
43 | /** |
||
44 | * Get script tag. |
||
45 | * |
||
46 | * @param string|null $callbackName |
||
47 | * |
||
48 | * @return \Illuminate\Support\HtmlString |
||
49 | */ |
||
50 | 20 | public function script($callbackName = null) |
|
63 | |||
64 | /** |
||
65 | * Get the NoCaptcha API Script. |
||
66 | * |
||
67 | * @return \Illuminate\Support\HtmlString |
||
68 | */ |
||
69 | 4 | public function getApiScript() |
|
82 | |||
83 | /* ----------------------------------------------------------------- |
||
84 | | Check Methods |
||
85 | | ----------------------------------------------------------------- |
||
86 | */ |
||
87 | |||
88 | /** |
||
89 | * Check if callback is not empty. |
||
90 | * |
||
91 | * @param string|null $callbackName |
||
92 | * |
||
93 | * @return bool |
||
94 | */ |
||
95 | 20 | private function hasCallbackName($callbackName) |
|
99 | |||
100 | |||
101 | |||
102 | /* ----------------------------------------------------------------- |
||
103 | | Other Methods |
||
104 | | ----------------------------------------------------------------- |
||
105 | */ |
||
106 | |||
107 | /** |
||
108 | * Parse the response. |
||
109 | * |
||
110 | * @param string $json |
||
111 | * |
||
112 | * @return \Arcanedev\NoCaptcha\Utilities\AbstractResponse|mixed |
||
113 | */ |
||
114 | 20 | protected function parseResponse($json) |
|
118 | |||
119 | /** |
||
120 | * Get script source link. |
||
121 | * |
||
122 | * @param string|null $callbackName |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | 20 | private function getScriptSrc($callbackName = null) |
|
140 | } |
||
141 |