File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const arcaptchaApi = "https://arcaptcha.co/2/siteverify"
1313type Website struct {
1414 SiteKey string
1515 SecretKey string
16+ verifyUrl string
1617}
1718
1819type verifyReq struct {
@@ -36,9 +37,14 @@ func NewWebsite(siteKey, secretKey string) *Website {
3637 return & Website {
3738 SiteKey : siteKey ,
3839 SecretKey : secretKey ,
40+ verifyUrl : arcaptchaApi ,
3941 }
4042}
4143
44+ func (w * Website ) SetVerifyUrl (url string ) {
45+ w .verifyUrl = url
46+ }
47+
4248// Verify calls arcaptcha verify API and returns result.
4349//
4450// if an error occurs while sending or receiving the request, returns error.
@@ -50,7 +56,7 @@ func (w *Website) Verify(response string) (VerifyResp, error) {
5056 Response : response ,
5157 }
5258 var resp VerifyResp
53- err := sendRequest (http .MethodPost , arcaptchaApi , data , & resp )
59+ err := sendRequest (http .MethodPost , w . verifyUrl , data , & resp )
5460 return resp , err
5561}
5662
You can’t perform that action at this time.
0 commit comments