From 6b79094fe5f7a5e50a804dc7937c13a50f63ce94 Mon Sep 17 00:00:00 2001 From: Wahyu Arif Purnomo Date: Sat, 24 Jul 2021 00:43:02 +0700 Subject: [PATCH] update for handle error fetch id --- src/NdCaptcha/NdCaptcha.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/NdCaptcha/NdCaptcha.php b/src/NdCaptcha/NdCaptcha.php index c5f5031..219775b 100644 --- a/src/NdCaptcha/NdCaptcha.php +++ b/src/NdCaptcha/NdCaptcha.php @@ -39,6 +39,16 @@ public function init() { 'status' => true, 'captcha' => $resResponse[1], ]; + } else if($resResponse[0] == 'ERROR_WRONG_USER_KEY') { + $data = [ + 'status' => false, + 'captcha' => $resResponse[0], + ]; + } else if($resResponse[0] == 'ERROR_WRONG_CAPTCHA_ID') { + $data = [ + 'status' => false, + 'captcha' => $resResponse[0], + ]; } else{ goto start; }