Skip to main content

Troubleshooting Embedded Forms

The embedded form will not load

The first thing to check if an embedded form is not loading is to try going to the form URL without embedding it. The URL can be found within the embed snippet code generated on the Publish tab. For example, given the following snippet:

    <script id="xfp-embed-406ac7b5" type="text/javascript" src="//jadu.net/site/xfp/js/embed.js"></script>
<script type="text/javascript">XFormsProEmbed.init({"url":"https://jadu.net/xfp/embed?formID=1","width":"auto","height":"dynamic","id":"xfp-embed-406ac7b5"});</script>

The URL to visit would be:

https://jadu.net/xfp/embed?formID=1

If this page does not load then there is likely an issue with the forms installation and not the configuration of the embedded form.

Protocols, FORCE_SECURE and FORCE_SECURE_FORM

Most Jadu Central installations will have either FORCE_SECURE or FORCE_SECURE_FORM enabled to ensure the form can only be completed over HTTPS. When the form is only accessible over HTTPS then it should only be embedded in pages that are accessed over HTTPS. If HTTPS is not supported on forms then the form can only be embedded on pages not accessed over HTTPS.

If the form is still not loading when embedded then check that the form URL in the embed snippet matches the expected protocol.

Browser click-jacking protection with X-Frame-Options

By default most Jadu Central installs will send the HTTP header X-Frame-Options: SAMEORIGIN. What this does is tell the browser not to allow a third-party website to embed forms with in frames. This is to prevent a number of possible attacks. To embed a form on a third-party website this header should not be sent.

PayBridge in Embedded Forms

When embedding a form with PayBridge enabled, no basket will be shown. This is regardless of whether the payment adapter is configured to use a basket. Instead, the user will be shown a summary of their order, and asked to proceed to the relevant payment provider.

From time to time, an error may occur in PayBridge that cannot be recovered from. In such cases, the user will see a page titled 'Something has gone wrong', and an error code will be provided. The possible errors are detailed below:

| Code | Error | Cause | |-:-|-:-|-:-| | 0001 | Order not present | The ID of the order does not match any order in the database. The user should reload the page and try to complete the form and payment again. | | 0002 | Order already submitted | This order has already been paid for, and cannot be submitted again. | | 0003 | Order security violation | Security checks for this order have failed. The user should reload the page and try to complete the form and payment again. | | 0004 | Service could not be found | The service that this order is for could not be found. It may have been deleted or archived. Check the PayBridge configuration of the form is correct in the Control Center. | | 0005 | Unable to build payment request | PayBridge could not build a valid request for the payment provider. Check that all required schema mappings are completed in the PayBridge tab of the form. | | 0010 | Use of unsupported Payment Provider | The payment provider that this form is configured to use is not supported by embedded forms. Use a different payment provider, or contact Jadu Support. | | 1001 | Invalid data received from Payment Provider | The payment provider has returned data that PayBridge does not understand. Contact Jadu Support. | | 1002 | Security check failed after payment | This order has failed security checks after payment. This could be due to session expiry, or a malicious attempt to skip payment. The user's order reference should be reconciled with the records of the payment provider. |