Support

Home Forums Community Forum EE4 Authorize.net gateway – change processing url for ProCharge

EE4 Authorize.net gateway – change processing url for ProCharge

Posted: March 24, 2017 at 12:06 pm


mattbru

March 24, 2017 at 12:06 pm

I need to know how to change the processing url inside of EEG_Aim.gateway.php without hacking the EE4 plugin. My version is 4.9.31.p

All i need to do is change this “https://secure.authorize.net/gateway/transact.dll”
to “https://secure2.procharge.com/gateway/transact.dll”, see instructions here:

<img src=”http://mattbru.me/assets/images/authorize-net-and-procharge.jpg”
alt=”Authorize.net and ProCharge PDF” />

I found the funtion possibly_use_deprecated_aim_server() inside /event_espresso/caffeinated/payment_methods/Aim/EEG_Aim.gateway.php

Looks like I could hack the plugin here. But I would rather use a hook and do it the right way. Better yet, create a functionality plugin to work alongside EE4.

code

First, would you add this functionality into the next version of EE?
Second – if not, what is the best way to hook into that function?

Thank you kindly!
Matt


Tony

  • Support Staff

March 24, 2017 at 12:45 pm

Hi Matt,

There is already a filter available within the AIM payment method, possibly_use_deprecated_aim_server() uses that filter and its actually within the first method in the screenshot you posted:

FHEE__EEG_Aim___get_server_url

Add your own function that uses that same hook to change the URL to whatever you prefer, just make sure it hooks in later than possibly_use_deprecated_aim_server() does, id use priority 20.

For example:

https://gist.github.com/Pebblo/9d0921b2373f47de311fad88d112a215

Add that functions to Custom Functions Plugin to set the URL to the one you requested.


mattbru

March 27, 2017 at 8:42 am

Tony, thankyou. This helps.
One more thing – do you know how I can find out if the code is working? Is there an EE4 object I can print_r to view gateway url? (I’m guessing not). But im just wondering if there is a way other than when we get into testing.


Tony

  • Support Staff

March 27, 2017 at 8:56 am

Yes, you can view the payment logs within:

Event Espresso -> Payment methods -> logs.

When you attempt a payment you will create log entries there (likely at least 3 for AIM) if you view those logs you can see which URL is being used there within the ‘Server URL’ field.

The support post ‘EE4 Authorize.net gateway – change processing url for ProCharge’ 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