SHARE
TWEET

Untitled

tototototo123 Jul 22nd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private Boolean checkCaptcha(){
  2.         system.debug('### START checkCaptcha');
  3.         Boolean isCaptchaOK = true;
  4.  
  5.         // Captcha management
  6.         String responseBody = FormUtils.doCaptchaRequest(FormUtils.getCaptchaBaseUrl(),
  7.             'secret=' + FormUtils.getCaptchaSecret() +
  8.             '&response='+ captchaResponse
  9.         );
  10.         system.debug('## Captcha response: '+responseBody);
  11.         String success = FormUtils.getValueFromJson(responseBody, 'success');
  12.         String errorCodes = FormUtils.getValueFromJson(responseBody,'error-codes');
  13.         if(success.equalsIgnoreCase('false')){
  14.             system.debug('## Error on Captcha: '+errorCodes);
  15.             isCaptchaOK = false;
  16.         }
  17.         // End captcha
  18.         system.debug('### END checkCaptcha');
  19.         return isCaptchaOK;
  20.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top