Support

Home Forums Event Espresso Premium Authorize.net Accept Hosted instead of Authorize.net SIM

Authorize.net Accept Hosted instead of Authorize.net SIM

Posted: October 10, 2017 at 10:40 am


Grow Socially

October 10, 2017 at 10:40 am

Authorize.net SIM payment process baked into Event Espresso has been throwing out timeout messages for the past few days. When I contacted Authorize.net, they highly recommended that I switch to Authorize.net Accept Hosted process instead because they won’t be supporting SIM much longer.

Any plans to bake this into Event Espresso?

https://developer.authorize.net/api/reference/features/accept_hosted.html


Josh

  • Support Staff

October 10, 2017 at 10:47 am

The plan as it stands right now is before they drop support there will be a replacement, and the replacement for the SIM add-on will likely be an Accept Hosted add-on.

You can avoid the timeout messages by making a request to the /transactions/ page do fewer http requests. I checked your site and right now there are 38 http requests happening on the /transactions page. You can add some code to your site to get that number down to less than ten for that page.

https://gist.github.com/joshfeck/b625f638c6096da4a7429ffe1931a6a0

You can add the above to a functions plugin or into your WordPress theme’s functions.php file.

What that will do is remove all the scripts, styles, and fonts getting loaded for that one page. The transactions page is used to listen for the payment notification from Authnet, and those additional assets aren’t needed and are quite likely contributing to the timeout.


Grow Socially

October 10, 2017 at 10:58 am

I appreciate you help. What is the EE4 Transaction page named? I know it sounds like a silly question, but where is it nested in the file tree?


Grow Socially

October 10, 2017 at 11:06 am

Is it this file? Transactions_Admin_Page.core.php


Grow Socially

October 10, 2017 at 11:08 am

Nevermind. Think I have it.


Josh

  • Support Staff

October 10, 2017 at 11:31 am

No you don’t actually edit that file.

You put the code into your theme’s functions.php file or into a site specific plugin and it will do the rest.


Grow Socially

October 10, 2017 at 11:37 am

add_action(‘template_redirect’, ‘my_simple_ee_transactions_page’);
function my_simple_ee_transactions_page() {
if(class_exists(‘EE_Registry’)) {
if(isset(EE_Registry::instance()->CFG->core->txn_page_id)) {
if(is_page(EE_Registry::instance()->CFG->core->txn_page_id)) {
remove_all_actions(‘wp_enqueue_scripts’);
remove_all_actions(‘wp_head’);
remove_all_actions(‘wp_footer’);
}
}
}
}

Even thought I do not have a file named “my_simple_ee_transactions_page?” Wouldn’t it want to find the exact named file to redirect to? I have no file like that in my file tree. Maybe I am missing something.


Josh

  • Support Staff

October 10, 2017 at 11:46 am

You actually do not put the code in a file with that name.

Can you follow the instructions on this wiki page?

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


Grow Socially

October 10, 2017 at 11:57 am

I know. I am have loaded the following code into my theme’s Function.php file:

add_action(‘template_redirect’, ‘my_simple_ee_transactions_page’);
function my_simple_ee_transactions_page() {
if(class_exists(‘EE_Registry’)) {
if(isset(EE_Registry::instance()->CFG->core->txn_page_id)) {
if(is_page(EE_Registry::instance()->CFG->core->txn_page_id)) {
remove_all_actions(‘wp_enqueue_scripts’);
remove_all_actions(‘wp_head’);
remove_all_actions(‘wp_footer’);
}
}
}
}

However, I see that is it using a redirect to a place/file called, “my_simple_ee_transactions_page.” I do not believe I have a place/file called that in my file tree. Do I load the language exactly as it is listed above? Or do I replace “my_simple_ee_transactions_page” with a different place/file?


Josh

  • Support Staff

October 10, 2017 at 12:14 pm

No, no file like that needed.

I’ll try to explain what’s going on a nutshell, here’s how that code gets executed:

1) WordPress loads each plugin, then it loads your theme’s functions.php file.
2) Then on each request on the front end, WP fires action hooks. (you’ll find a list of those actions here). When the template_redirect action fires, your my_simple_ee_transactions_page function is called. That’s the job of this line of code here:

add_action('template_redirect', 'my_simple_ee_transactions_page');

3) When that my_simple_ee_transactions_page function is called, the code between the brackets is executed. This line:
if(is_page(EE_Registry::instance()->CFG->core->txn_page_id))
makes sure the only page that’s affected by this code is the /transactions/ page on your site.

You can check the /transactions/ page on your site to verify that the code is working. If it’s working you’ll notice that the page looks kind of ugly. That’s OK that it looks ugly because that’s not a page that will be visited by anyone using the website. The page is only used as a listener for the payment notification, and it needs to load fast or Authnet will timeout.


Grow Socially

October 10, 2017 at 12:19 pm

I visited the /transactions/ area. It is ugly. Any way to remove even more information? Lists of links? The widgets? The following message:

This is the Event Espresso Transactions page. This page receives instant payment notification (IPN) requests and should have a status of published, but should not be easily accessible by site visitors. Do not add it to your website’s navigation menu or link to it from another page. Also, do not delete it or change its status to private.

Will the individuals using the Authorize.net SIM’s payment system on our site see this?


Josh

  • Support Staff

October 10, 2017 at 12:27 pm

No they will not see it because they are never directed to that page, ever. No need to remove items from that page, but if you really want to you can set up a custom page template for that page only. Your custom page template will need to still do a WordPress loop and show the_content of the post, but things like the header and footer can be removed if you prefer.


Grow Socially

October 10, 2017 at 12:30 pm

Unfortunately, it is still throwing out a timeout message after information is entered into the Authorize.net processing page and “submit” is clicked.

Hopefully, the Accept Hosted add-on will be developed and offered very soon.


Grow Socially

October 10, 2017 at 12:31 pm

By the way, thank you for helping me. I will keep working on it from my end.


Grow Socially

October 10, 2017 at 2:27 pm

Think my /thank-you/ page needs to go lightweight as well?


Josh

  • Support Staff

October 10, 2017 at 2:33 pm

The thank-you page is visible to the end user so you’ll need to take care and only remove unnecessary scripts/styles/files. I don’t think making the thank-you page will have an effect on the timeout from Authnet because the IPN sent from Authnet goes to the /transactions page in Event Espresso 4.


Grow Socially

October 10, 2017 at 2:40 pm

Thanks again.


Grow Socially

October 13, 2017 at 8:42 am

I wanted to reach out one last time. I spoke with a few customer to replicate the issue and they are having trouble with the following screen. They say when they try to click the button, the screen freezes and will not allow them to proceed to the payment page:

Screen 1

However, when we try to replicate it in-house, it allows us to click the button and proceed to the Authnet screen to proceed with payment. Please see below:

Screen 2

What might the problem? This creates an entirely new wrinkle, as it isn’t an Authnet issue, rather something on the EE side.


Josh

  • Support Staff

October 13, 2017 at 9:39 am

It sounds like they’re confused by having to select the one available payment mthod. Since you only have one payment method option, you can set the payment method to “Open by Default” to Yes. Then the users will not have to click on the payment method to select it. Instead it will be selected for them.


Josh

  • Support Staff

May 2, 2018 at 8:08 pm

Update:

The Authorize.net Accept gateway add-on is now available.

https://eventespresso.com/product/eea-authorizenet-accept/


Grow Socially

May 3, 2018 at 9:25 am

Thank you, Josh!

The support post ‘Authorize.net Accept Hosted instead of Authorize.net SIM’ 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