( function() {
var insertErrorMessage = function (message) {
jQuery('script').each(function (i, e) {
var js = jQuery(e)[0].src || '';
if (js.indexOf('3670016.js') > 0)
jQuery(e).after('<p style="color: red">' + message + '</p>');
});
};
var fetchWidget = function () {
if (window.ActiveXObject) { // they are using IE < 11, which doesn't support TLS 1.1
insertErrorMessage('Your browser does not support the minimum security requirements for keeping your Credit Card information safe when processing payments. Please upgrade your browser or download the latest version of' +
' <a target=\'_blank\' href=\'https://www.google.com/chrome/browser/desktop/\'>Chrome</a> or <a target=\'_blank\' href=\'https://www.mozilla.org/en-US/firefox/new/\'>Firefox</a>.');
}
else {
Bloomerang.Util.requireJQueryValidation(function() {
Bloomerang.useKey('pub_33e8976c-0922-11ee-b757-02a40401dacd');
var success = function(result) {
eval(result.WidgetJavascript);
// Set payment intent properties
Bloomerang.StripePaymentElement = (!Bloomerang.StripePaymentElement) ? {
PaymentIntentId: result.PaymentElement.PaymentIntentId,
ClientSecret: result.PaymentElement.ClientSecret,
CustomerId: result.PaymentElement.CustomerId
} :
{
...Bloomerang.StripePaymentElement,
PaymentIntentId: result.PaymentElement.PaymentIntentId,
ClientSecret: result.PaymentElement.ClientSecret,
CustomerId: result.PaymentElement.CustomerId
};
};
var failure = function() {
insertErrorMessage('Donation form could not be loaded. Please try again later.');
};
var data = {
ServedSecurely: (window.location.protocol == 'https:' || window.location.href.indexOf('http://localhost:') == 0),
FormUrl: window.location.href
};
Bloomerang.Api._post('v1/Widget/3670016', data, success, failure);
});
}
};
var startBloomerangLoad = function() {
if (window.bloomerangLoadStarted == undefined) {
window.bloomerangLoadStarted = true;
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://crm.bloomerang.co/Content/Scripts/Api/Bloomerang-v2.js?nocache=1723140074';
document.getElementsByTagName('head')[0].appendChild(script);
waitForBloomerangLoad(fetchWidget);
}
else {
waitForBloomerangLoad(fetchWidget);
}
};
var waitForBloomerangLoad = function(callback) {
if (typeof(Bloomerang) === 'undefined' || !Bloomerang._isReady) {
setTimeout(function () { waitForBloomerangLoad(callback) }, 500);
}
else {
if (true) {
callback();
} else {
window.bloomerangLoadStarted = undefined;
Bloomerang = undefined; // The version of Blomerang.js is not what we want. So blow it away and reload.
startBloomerangLoad();
}
}
};
startBloomerangLoad();})();