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 | 16 | public function script($callbackName = null) |
|
61 | |||
62 | /** |
||
63 | * Get the NoCaptcha API Script. |
||
64 | * |
||
65 | * @return \Illuminate\Support\HtmlString |
||
66 | */ |
||
67 | public function getApiScript() |
||
80 | |||
81 | /* ----------------------------------------------------------------- |
||
82 | | Check Methods |
||
83 | | ----------------------------------------------------------------- |
||
84 | */ |
||
85 | |||
86 | /** |
||
87 | * Check if callback is not empty. |
||
88 | * |
||
89 | * @param string|null $callbackName |
||
90 | * |
||
91 | * @return bool |
||
92 | */ |
||
93 | 16 | private function hasCallbackName($callbackName) |
|
97 | |||
98 | |||
99 | |||
100 | /* ----------------------------------------------------------------- |
||
101 | | Other Methods |
||
102 | | ----------------------------------------------------------------- |
||
103 | */ |
||
104 | |||
105 | /** |
||
106 | * Parse the response. |
||
107 | * |
||
108 | * @param string $json |
||
109 | * |
||
110 | * @return \Arcanedev\NoCaptcha\Utilities\AbstractResponse|mixed |
||
111 | */ |
||
112 | 20 | protected function parseResponse($json) |
|
116 | |||
117 | /** |
||
118 | * Get script source link. |
||
119 | * |
||
120 | * @param string|null $callbackName |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | 16 | private function getScriptSrc($callbackName = null) |
|
138 | } |
||
139 |