Support

Home Forums Event Espresso Premium Braintree Error: Payment nonce is needed to process the transaction.

Braintree Error: Payment nonce is needed to process the transaction.

Posted: January 18, 2018 at 12:37 pm

Viewing 8 reply threads


Dr Ian Coleman

January 18, 2018 at 12:37 pm

Hello, since upgrading my site to PositiveSSL and dedicates IP, I am not getting the following error when trying to make an online payment through Braintree:

An error has occurred:
Payment nonce is needed to process the transaction. No or incorrect payment nonce provided.

Can you please help as I am unable to current take direct payments from the site.

Thanks,

Ian


Josh

  • Support Staff

January 18, 2018 at 1:40 pm

Hi Ian,

Can you doublecheck and make sure the API credentials set in Event Espresso > Payment Settings are correct and that Debug Mode On is set to No?

It may also help to deactivate the reCAPTCHA setting in Event Espresso > Registration Form > Settings. I took a quick look at your site and it appears the reCAPTCHA form isn’t allowing registration form submissions.


Dr Ian Coleman

January 19, 2018 at 2:29 pm

Hello, I have checked all of the above but with no success. The API keys are all correct and debug mode is off.

Do you have any other suggestions please?


Josh

  • Support Staff

January 19, 2018 at 3:05 pm

If you can deactivate the reCAPTCHA setting in Event Espresso > Registration Form > Settings, it will allow us to investigate further.


Dr Ian Coleman

January 19, 2018 at 3:11 pm

Hi Josh,

reCAPTURE is set to NO


Josh

  • Support Staff

January 19, 2018 at 3:29 pm

There may be a conflict with Contact Form 7’s reCAPTCHA form then. Do you see the reCAPTCHA form on the home page? That may be causing issues elsewhere on the website.

You can also check the Logs in Event Espresso > Payment Methods > Logs and compare the logs from before when the payments were working, to the logs now.


Dr Ian Coleman

January 19, 2018 at 3:42 pm

Hello, I have removed the reCAPTURE from the Contact7 form on the homepage. Does this now allow you to investigate the issue further? I cannot see any logs that go back to when the payment originally worked.


Dr Ian Coleman

January 19, 2018 at 3:56 pm

So have have been exploring some recent changes to the site and have worked out that the issue was related to a site specific plugin that I needed to create in order to allow the Event Espresso Calendar to show up. The code that was causing the issue was:

add_action( ‘template_redirect’, ‘my_calendar_load_scripts’ );
function my_calendar_load_scripts() {
if ( is_page(
array(
2755,
// add more IDs if needed
)
) && class_exists( ‘EED_Espresso_Calendar’ ) ) {
add_action( ‘wp_enqueue_scripts’, array( EED_Espresso_Calendar::instance(), ‘calendar_scripts’ ) );
if ( EED_Espresso_Calendar::instance()->config()->tooltip->show ) {
add_filter(‘FHEE_load_qtip’, ‘__return_true’ );
}
}
}

add_action( ‘template_redirect’, ‘my_add_ee_calendar_assets’ );
function my_add_ee_calendar_assets() {
if ( class_exists( ‘EED_Espresso_Calendar’ ) ) {
global $is_espresso_calendar;
$is_espresso_calendar = TRUE;
add_action( ‘wp_enqueue_scripts’, array( EED_Espresso_Calendar::instance(), ‘calendar_scripts’ ) );
if ( EED_Espresso_Calendar::instance()->config()->tooltip->show ) {
add_filter(‘FHEE_load_qtip’, ‘__return_true’ );
}
}
}

However, my calendar is now not working again. I would be interested in understanding why this was happening?


Josh

  • Support Staff

January 19, 2018 at 5:00 pm

The reason why that code is breaking things is because the second part (starting with
add_action( 'template_redirect', 'my_add_ee_calendar_assets' );
)
is loading on every page of the site. You should only load the code on the one page where the calendar is displayed. Otherwise other scripts on the page (including those used by the Braintree plugin) won’t even get loaded because of the earlier errors on the page.

You’ll need to make sure the code loads only on the calendar page, so this is what you need to fix the calendar when using the x-theme, nothing else:

add_action( 'template_redirect', 'my_calendar_load_scripts' );
function my_calendar_load_scripts() {
  if ( is_page(2271) && class_exists( 'EED_Espresso_Calendar' ) ) {
    add_action( 'wp_enqueue_scripts', array( EED_Espresso_Calendar::instance(), 'calendar_scripts' ) );
    if ( EED_Espresso_Calendar::instance()->config()->tooltip->show ) {
      add_filter('FHEE_load_qtip', '__return_true' );
    }
  }
}
Viewing 8 reply threads

The support post ‘Braintree Error: Payment nonce is needed to process the transaction.’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso