integration

Google Captcha Integration

Super simple to use, callback adaptors along the whole process chain.
Development cycle: Beta stage
Categories: php, jQuery, ES6promise
LOCATOR = {}; //site wide constants...

jQuery(document).ready( function() {
	
	googleCaptchaSetup = {
		'sitekey': LOCATOR.googleCaptchaSecret
		, 'node': '#googleCaptcha'
		, 'validationUrl': '/googleCaptcha.php'
		, 'onLoadCallback': (function(instance) {
				instance.node.show();
				instance.node.css('bottom', '100px');
			})
		, 'onDataCallback': (function(instance) { 
				instance.node.hide();
			})
		, 'resolveCallback': (function(instanceAndData) { 
				jQuery('form').submit();
			})
			, 'rejectCallback': (function(instanceAndError) {
			})
		, 'removeType': 'remove'
		}; //object
		if ('googleCaptcha_fakeAtClient' in LOCATOR.testing) {
			googleCaptchaSetup.simulateResult = LOCATOR.testing.googleCaptcha_fakeAtClient;
	} //if
	
	jQuery('form input[type="button"]')
		.on('click', function(event) {
			new GoogleCaptchaValidate(googleCaptchaSetup);
		});
});
class LOCATOR {}; //site wide constants...

$googleCaptchaSetup = [
		'secret' => \LOCATOR::$googleCaptchaSecret,
	]; //map
	if (\LOCATOR::testing('googleCaptcha_fakeAtServer')) {
		$setup['simulateResult'] = \LOCATOR::$testing['googleCaptcha_fakeAtServer'];
} //if

$validator = new GoogleCaptchaValidate(
		$googleCaptchaSetup,
		function($phase) {
			//notify on progress
		},
		function($phase, $data) {
			//notify on error
		}
	);

$validator->data();
$validator->validate();
$validator->httpResponse();

Loading...
Price: 2 €
Delivery to: 

...processing...
Thank you for your purchase.
I will send you the most current version zipped and will create a git account for you as soon as I get to it.
A confirmation email has already been sent out.
Something didn't work as it should have.
Happens, oh well.
Reloading might help.
I will try to inspect the logs and contact you.