Proceed to WorldPay to make your payment button not clicked automatically

diff --git a/commerce_worldpay/commerce_worldpay_bg.module b/commerce_worldpay/commerce_worldpay_bg.module
index 3da1d35..222ebd9 100644
--- a/commerce_worldpay/commerce_worldpay_bg.module
+++ b/commerce_worldpay/commerce_worldpay_bg.module
@@ -579,6 +579,14 @@ function commerce_worldpay_bg_submit_form_submit($payment_method, $pane_form, $p
* @see commerce_worldpay_bg_redirect_form()
*/
function commerce_worldpay_bg_order_form($form, &$form_state, $order, $settings) {
+
+ /**
+ * Add the JS that will automatcially click the button after 6 seconds
+ *
+ * @todo - See if 6 seconds is OK as I've plucked it out of thin air
+ */
+ drupal_add_js(drupal_get_path('module', 'commerce_worldpay_bg') . '/includes/commerce_worldpay.js');
+
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
$currency_code = $order_wrapper->commerce_order_total->currency_code->value();
$amount = $order_wrapper->commerce_order_total->amount->value();

diff --git a/commerce_worldpay/includes/commerce_worldpay.js b/commerce_worldpay/includes/commerce_worldpay.js
index 6b31bac..b80f930 100644
--- a/commerce_worldpay/includes/commerce_worldpay.js
+++ b/commerce_worldpay/includes/commerce_worldpay.js
@@ -1,14 +1,13 @@
(function($) {

/**
- * Makes the thumbnail the main image when clicked
+ * Clicks the Wolrdpay submit button after 6 seconds
+ *
+ * @todo - See if 6 seconds is OK as I've plucked it out of thin air
*/
Drupal.behaviors.commerceWorldpayAutoSubmit = {
attach: function (context, settings) {
-
- alert($(':input[name="wp-sub"]').attr('name'));
-
- //$(':input[name="wp-sub"]').delay(600).click();
+ $(':input[name="wp-sub"]').delay(600).click();
}
};