Forums / Upgrading to 1.5.x / Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

Views: 16,227

Results 1 to 16 of 16
7 Jan 2019, 11:45 PM
#1
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

zc156
vanilla install. confirm basic functionality with demo data
drop db tables
import db from backup of live db

I did fiddle around with zc_bootstrap template

Check Auth.net SIM and PP settings
Install Square payment settings

I am using SIM but AIM is also setup but disabled. Processor requires SIM use due to SAQ-A vs SAQ-A-EP differences.

Upload USPS and Fedex shipping modules
Have not uninstalled and reinstalled yet

This same error file appears several dozen times in the zc logs folder

[07-Jan-2019 15:37:01 America/Los_Angeles] Request URI: /156/ADMINFOLDER/modules.php?set=payment&module=square, IP address: 98.146.xxx.yyy
#1  authorizenet_aim->__construct() called at [/home/CPANEL/public_html/156/ADMINFOLDER/modules.php:195]
--> PHP Warning: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY - assumed 'MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY' (this will throw an Error in a future version of PHP) in /home/chaisinf/public_html/156/includes/modules/payment/authorizenet_aim.php on line 135.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

8 Jan 2019, 1:24 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

My thoughts are that in the __construct function that the assignment of a value to $this->gateway_currency be dependent on the gateway currency being defined. The potential problem with this is that later in the code, it seems that if the payment method is accessed while that definition is not set, that it may cause some other message to be issued. But the install of the plugin should take care of that absent definition...

So my current suggestion for the code of includes/modules/payment/authorizenet_aim.php is to change:

$this->gateway_currency = MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY;

To:

if (defined('MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY')) {
  $this->gateway_currency = MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY;
}

This should be taken with a grain of salt as I haven't dug deeper into the code/situation.

But there may be some other suggestion like if it is defined to use that value otherwise use the default value of the installation?

What it does seem to include/encourage is the removal/installation of the payment module I believe which is otherwise encouraged/suggested when doing an upgrade/install?

I don't get that message on my default ZC install where I don't have a history of possibly using/installing the module in some previous cart version nor is it currently enabled/potentially being accessed...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

8 Jan 2019, 5:53 AM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY is a new(ish) key. You have to uninstall and reinstall this module.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

8 Jan 2019, 2:06 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

This issue will be detected and automatically resolved by Zen Cart in the next release for both Authorize and Authorize AIM.
See https://github.com/zencart/zencart/pull/2055

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

8 Jan 2019, 9:00 PM
#5
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

**TNX

Uninstall/Reinstall AIM resolved the logfile being generated. **on to USPS module logfiles now

IT SURE WOULD BE NICE IF ALL THE SETTINGS WOULD BE REMEMBERED for all these modules that always require just an uninstall/reinstall click every time there is an update.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

9 Jan 2019, 3:38 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

RixStix:

IT SURE WOULD BE NICE IF ALL THE SETTINGS WOULD BE REMEMBERED for all these modules that always require just an uninstall/reinstall click every time there is an update.
Indeed it was supposed to; however, there was an oversight in fixing that specifically for the authnet modules. :(

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Jan 2019, 3:50 AM
#7
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

TNX DrByte.

I'm sure keeping things straight/ironed out is a monumental task that most of us average users haven't a clue.

So settings are ultimately, intended, supposed to be in a perfect world, remembered when uninstall/install USPS, FEDEX, UPS, Auth.net AIM/SIM, Square, etc during an upgrade?

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

9 Jan 2019, 7:14 AM
#8
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

RixStix:

So settings are ultimately, intended, supposed to be in a perfect world, remembered when uninstall/install USPS, FEDEX, UPS, Auth.net AIM/SIM, Square, etc during an upgrade?

Bear in mind that lots of these modules are not part of the Zen Cart core, but are contributed by developers who generously share their work and time. So some receive more or less attention than others.

It took a lot of work to get to this point; early modules wouldn't even tell you that an uninstall-reinstall was needed.

But yes, the current design goal for modules like this is for changes to be transparent to users, so an uninstall/reinstall is not needed.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

9 Jan 2019, 3:04 PM
#9
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

swguy:

Bear in mind that lots of these modules are not part of the Zen Cart core, but are contributed by developers who generously share their work and time. So some receive more or less attention than others.
I understand that. I only indicated certain shipping and payment modules that are of significant concern. Many are core. I do try to show my appreciation to those who have shared their time.

swguy:

It took a lot of work to get to this point; early modules wouldn't even tell you that an uninstall-reinstall was needed. I appreciate that. None of those I mentioned had any indication that was obvious, so I didn't see any difference. There was notice that there were glitches in setup AFTER entering/exiting the edit mode. I just know from past updates that shipping/payment require that drill every time.

swguy:

But yes, the current design goal for modules like this is for changes to be transparent to users, so an uninstall/reinstall is not needed.
I appreciate that too. Thank you.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

9 Jan 2019, 6:51 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

RixStix:

So settings are ultimately, intended, supposed to be in a perfect world, remembered when uninstall/install USPS, FEDEX, UPS, Auth.net AIM/SIM, Square, etc during an upgrade?
No, not "when uninstall/install", because "uninstall" removes the settings.

The REASON for the historical need to uninstall/reinstall was just to "add any new config settings for that module" if any were added, else the new features wouldn't work or maybe even errors would happen unexpectedly. That's it.
So the newer coding approach has been to try to ensure that if the module is missing a new config setting then just push it in quietly so there's no need to uninstall/reinstall. When we code it properly it works great. In this authnet case we missed one line of code to empower it. Argh.
But still, if you uninstall the module, you will indeed lose its settings and have to re-enter them.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Jan 2019, 7:50 PM
#11
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

TNX DrByte for the explanation. OK, so there is no need to reinstall USPS, Auth.net SIM, Fedex, etc? Fedex is going to be painful.

Ditto on yellow errors for OT remnants from 154 that I have zero intention of installing in 156.
Starting from scratch again. Maybe this time I will learn my lesson and not make any changes to layout settings or colors until I successfully complete 1 order. Darn FREE shipping is gonna kill me trying to figure out why it is showing up.

Sorry to be venting. I know everyone has been working very hard but it is equally frustrating from the user side while trying to be helpful with the DEBUG files.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

9 Jan 2019, 7:54 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

RixStix:

TNX DrByte for the explanation. OK, so there is no need to reinstall USPS, Auth.net SIMThose should be fine.
RixStix:

Fedex, etc? Fedex is going to be painful.Unless Fedex touches a bunch of admin files that were updated in 156, it's probably fine. I dunno if it's been updated to catch PHP 7.2 strict errors, but that's unrelated to 156.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Jan 2019, 8:39 PM
#13
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

DrByte:

Those should be fine.
Unless Fedex touches a bunch of admin files that were updated in 156, it's probably fine. I dunno if it's been updated to catch PHP 7.2 strict errors, but that's unrelated to 156.

Thank you. I understand. The Fedex issue is unrelated to zencart but requires stepping through the fedex dev site and regenerating meter numbers while not cancelling existing setups.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

3 Dec 2023, 10:19 PM
#14
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

I just upgraded from 1.5.4 to 1.5.8a. Still running php 7.4 as I have other stores yet to upgrade. I am seeing in my logs
Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY - assumed 'MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

I see back in 2019 the solution was to uninstall/reinstall and the hopes that future versions this would not be necessary. As I have never had to uninstall and reinstall I hesitate... Are the only items I will need to know for the reinstall shown if I click edit on the module? I should just print screen this so I have all the settings or do I need to get more information and if so what do I need so I can be prepared and have minimal down time?

Another question I saw "Payment Zone
If a zone is selected, only enable this payment method for that zone." I am in Florida. If I set that to Florida does it only accept shipping addresses in Florida or specifically how does this limit to the zone?

Thanks for your help.

4 Dec 2023, 4:56 PM
#16
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY

Go to Admin > Modules > Payment > Authorize AIM and the problem should disappear after that.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.