var breeze_prefetch = {"local_url":"https:\/\/www.xeroom.com","ignore_remote_prefetch":"1","ignore_list":["\/cart\/","\/checkout\/","\/my-account\/","\/my-account\/","\/wp-content\/uploads\/xeroom\/xeroom.zip","\/wp-admin\/"]};
var jQueryMigrateHelperHasSentDowngrade = false;window.onerror = function( msg, url, line, col, error ) {
// Break out early, do not processing if a downgrade reqeust was already sent.
if ( jQueryMigrateHelperHasSentDowngrade ) {
return true;
}var xhr = new XMLHttpRequest();
var nonce = '59ed3070df';
var jQueryFunctions = [
'andSelf',
'browser',
'live',
'boxModel',
'support.boxModel',
'size',
'swap',
'clean',
'sub',
];
var match_pattern = /\)\.(.+?) is not a function/;
var erroredFunction = msg.match( match_pattern );// If there was no matching functions, do not try to downgrade.
if ( null === erroredFunction || typeof erroredFunction !== 'object' || typeof erroredFunction[1] === "undefined" || -1 === jQueryFunctions.indexOf( erroredFunction[1] ) ) {
return true;
}// Set that we've now attempted a downgrade request.
jQueryMigrateHelperHasSentDowngrade = true;xhr.open( 'POST', 'https://www.xeroom.com/wp-admin/admin-ajax.php' );
xhr.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
xhr.onload = function () {
var response,
reload = false;if ( 200 === xhr.status ) {
try {
response = JSON.parse( xhr.response );reload = response.data.reload;
} catch ( e ) {
reload = false;
}
}// Automatically reload the page if a deprecation caused an automatic downgrade, ensure visitors get the best possible experience.
if ( reload ) {
location.reload();
}
};xhr.send( encodeURI( 'action=jquery-migrate-downgrade-version&_wpnonce=' + nonce ) );// Suppress error alerts in older browsers
return true;
}
var errorQueue = [];
var timeout;function isBot() {
const bots = ['bot', 'googlebot', 'bingbot', 'facebook', 'slurp', 'twitter','yahoo']; // Adicione outros bots, se necessário
const userAgent = navigator.userAgent.toLowerCase();
return bots.some(bot => userAgent.includes(bot));
}window.onerror = function(msg, url, line) {
var errorMessage = [
'Message: ' + msg,
'URL: ' + url,
'Line: ' + line
].join(' - ');// Filter bots errors...
if (isBot()) {
return;
}
errorQueue.push(errorMessage);
if (errorQueue.length >= 5) {
sendErrorsToServer();
} else {
clearTimeout(timeout);
timeout = setTimeout(sendErrorsToServer, 5000);
}
}
function sendErrorsToServer() {
if (errorQueue.length > 0) {
var message = errorQueue.join(' | ');
//console.log(message);
var xhr = new XMLHttpRequest();
var nonce = 'e6cabdc036';
// var ajaxurl = encodeURIComponent('https://www.xeroom.com/wp-admin/admin-ajax.php?action=log_js_error&_wpnonce=e6cabdc036');
var ajaxurl = 'https://www.xeroom.com/wp-admin/admin-ajax.php?action=log_js_error&_wpnonce=e6cabdc036';
xhr.open('POST', encodeURI(ajaxurl));
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function() {
if (200 === xhr.status) {
try {
//console.log(xhr.response);
} catch (e) {
console.log('error xhr not 200!');
}
} else
{
console.log('error 2');
}
};
xhr.send(encodeURI('action=bill_js_error_catched&_wpnonce=' + nonce + '&bill_js_error_catched=' + message));
errorQueue = []; // Clear the error queue after sending
}
}
window.addEventListener('beforeunload', sendErrorsToServer);
How to Set-up Synch of Order Status in WooCommerce When Invoice is Paid in Xero
Update Xero Invoice Payments to WooCommerce Orders
Once payment is made by the customer then it will show in Xero’s automatic bank feeds either as an individual payment which can be matched with payments sent by Xeroom or as an aggregate consolidated payment that covers multiple invoices. Your bookkeeper will reconcile these actual payments into the bank with the invoices and automatic matching rules can be utilised. When an invoice is paid off in Xero this will trigger Xeroom to update the order status back in WooCommerce. It will show the order Xero status as “Paid in Xero” in blue and also change the order status to “Completed”. It takes around 2 mins for the update to show in WC.
The light blue outline to the box indicates that the invoice has been sent automatically by Xeroom earlier in the process.
Payment Synch Setup in Xeroom
Xeroom uses a webhook that gets triggered by Xero on certain events such as payment. To obtain your webhook go to your Xero app in https://developer.xero.com/ and under webhooks.
Tick the invoices box and add the delivery URL which is usually:
where websitename is your own website name with correct ending ie .com or.co.uk etc. To get the exact URL take the URI given in blue in your Xeroom settings and after the V2 add “invoice_callback” as the suffix.
When you hit save it will generate a webhook and status box. Copy this webhook into the box in Xeroom and save it. Then go back and hit the “Send intent to receive” button. If everything is good then you will get an “ok” message. If it fails the status will be red. Check your settings are correct.
NB: Ensure that you have set a default bank account in Xeroom with the same Xero accounts code as you are using to make the payment to in Xero. Also wait 3 mins for the webhook to synch from Xero before the Xero status for the order in the WooCommerce order dashboard status changes to “Paid in Xero” and turns a solid blue.
Errors and Troubleshooting The Xero Webhook
Before you contact support please go through the following troubleshooting checklist. If the webhook has failed you will get the a “Response not 200” message in the Xero . Response 200 is a success message which means the communication to your server was successful so if it fails it is either an issue with Xeroom (sometimes after an upgrade a bug might cause a problem) or most likely reaching your server or a server setting preventing the response. Please check the following:
Check if your server firewall or any security plugs are blocking the request. Any access requests will show in your firewall/security plugin audit logs. We do add a Xero User Agent to the calls made from the Xero webhook so that they should get recognised by the likes of the GES (Global Edge Security) firewall used by WP Engine to add Cloudflare features. The User Agent will automatically whitelist them but check the logs to ensure that this is working properly otherwise the call will be blocked.
Check for Cloudflare or other caching or anti-bot apps that you are using to see if they are blocking it. If so you will need to whitelist the delivery URL so that it doesn’t get blocked.
Check that your server has Ngnix enabled and set the default application to Xeroom.
Recreate your webhook, copy and paste it and try the “send intent to receive” again.
Check your WC debug log for error messages – see below.
Contact Xero support as they have more visibility on the errors arising and may be able to shed light on the issue and User Agents.
Accessing The WooCommerce Debug Log
Please check for any serious error messages in Woocommerce\Status\logs. Other errors will show in the Woocommerce debug.log file found in the WP-content directory for any warnings or errors relating to Xeroom. To set this see here https://docs.woocommerce.com/document/woocommerce-product-search/api/debugging/ and for general WordPress debugging here https://wordpress.org/support/article/debugging-in-wordpress/ This file will be large and log all messages including advisory ones. Remember not to leave it on otherwise it will show to the users. Copy and paste the relevant Xeroom messages if any are found for reference or to pass to us as part of any support request.
Contacting Support
If none of the above resolves the issue then something more complex is afoot so please open a support ticket to [email protected] and ensure that you provide us with the following information in order to help you in a timely manner:
1. Copies of any errors found in your WC debug log.
2. Copy of any recent errors in your Xeroom debug page.
3. Send an admin login to your site and invitation to your Xero account for a standard business user.
4. Provide us with FTP access to your server.
5. Send any relevant info from the troubleshooting list above especially firewall and caching logs.
(function() {
var file = ["https:\/\/www.xeroom.com\/wp-content\/et-cache\/11013\/et-divi-dynamic-11013-late.css"];
var handle = document.getElementById('divi-style-parent-inline-inline-css');
var location = handle.parentNode;if (0===document.querySelectorAll('link[href="' + file + '"]').length) {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.id = 'et-dynamic-late-css';
link.href = file;location.insertBefore(link, handle.nextSibling);
}
})();
(function () {
var c = document.body.className;
c = c.replace(/woocommerce-no-js/, 'woocommerce-js');
document.body.className = c;
})();
var smuzform = {"ajaxurl":"https:\/\/www.xeroom.com\/wp-admin\/admin-ajax.php","errorMessages":{"required":"This field is required.","email":"Please enter a valid email address.","number":"The value you have entered is not a numeric value","url":"URL is not valid."}};
var wc_add_to_cart_variation_params = {"wc_ajax_url":"\/?wc-ajax=%%endpoint%%","i18n_no_matching_variations_text":"Sorry, no products matched your selection. Please choose a different combination.","i18n_make_a_selection_text":"Please select some product options before adding this product to your cart.","i18n_unavailable_text":"Sorry, this product is unavailable. Please choose a different combination."};
var wc_add_to_cart_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","wc_ajax_url":"\/?wc-ajax=%%endpoint%%","i18n_view_cart":"View cart","cart_url":"https:\/\/www.xeroom.com\/cart\/","is_cart":"","cart_redirect_after_add":"yes"};
var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"ajaxurl":"https:\/\/www.xeroom.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}};
var DIVI = {"item_count":"%d Item","items_count":"%d Items"};
var et_builder_utils_params = {"condition":{"diviTheme":true,"extraTheme":false},"scrollLocations":["app","top"],"builderScrollLocations":{"desktop":"app","tablet":"app","phone":"app"},"onloadScrollLocation":"app","builderType":"fe"};
var et_frontend_scripts = {"builderCssContainerPrefix":"#et-boc","builderCssLayoutPrefix":"#et-boc .et-l"};
var et_pb_custom = {"ajaxurl":"https:\/\/www.xeroom.com\/wp-admin\/admin-ajax.php","images_uri":"https:\/\/www.xeroom.com\/wp-content\/themes\/Divi\/images","builder_images_uri":"https:\/\/www.xeroom.com\/wp-content\/themes\/Divi\/includes\/builder\/images","et_frontend_nonce":"f84f356523","subscription_failed":"Please, check the fields below to make sure you entered the correct information.","et_ab_log_nonce":"5973f9013c","fill_message":"Please, fill in the following fields:","contact_error_message":"Please, fix the following errors:","invalid":"Invalid email","captcha":"Captcha","prev":"Prev","previous":"Previous","next":"Next","wrong_captcha":"You entered the wrong number in captcha.","wrong_checkbox":"Checkbox","ignore_waypoints":"no","is_divi_theme_used":"1","widget_search_selector":".widget_search","ab_tests":[],"is_ab_testing_active":"","page_id":"11013","unique_test_id":"","ab_bounce_rate":"5","is_cache_plugin_active":"yes","is_shortcode_tracking":"","tinymce_uri":"https:\/\/www.xeroom.com\/wp-content\/themes\/Divi\/includes\/builder\/frontend-builder\/assets\/vendors","accent_color":"#003156","waypoints_options":[]};
var et_pb_box_shadow_elements = [];
var shield_vars_notbot = {"strings":{"select_action":"Please select an action to perform.","are_you_sure":"Are you sure?","absolutely_sure":"Are you absolutely sure?"},"comps":{"notbot":{"ajax":{"not_bot":{"action":"shield_action","ex":"capture_not_bot","exnonce":"0ef4bb0dc2","ajaxurl":"https:\/\/www.xeroom.com\/wp-admin\/admin-ajax.php","_wpnonce":"4a293697be","_rest_url":"https:\/\/www.xeroom.com\/wp-json\/shield\/v1\/action\/capture_not_bot?exnonce=0ef4bb0dc2&_wpnonce=4a293697be"},"not_bot_nonce":{"action":"shield_action","ex":"capture_not_bot_nonce","ajaxurl":"https:\/\/www.xeroom.com\/wp-admin\/admin-ajax.php","_wpnonce":"4a293697be","_rest_url":"https:\/\/www.xeroom.com\/wp-json\/shield\/v1\/action\/capture_not_bot_nonce?_wpnonce=4a293697be"}},"flags":{"required":true}}}};