Issue 76: Preferences::CC_PROCESSORS constant causes warning on override
Status:  Accepted
Owner: ----
Reported by cmauj...@gmail.com, Apr 13, 2008
What steps will reproduce the problem?
1. Override Preferences model in the standard way
2. Modify your app/models/preferences.rb copy to add a new cc processor
3. watch the warnings about "Constant Already Initialized"

What is the expected output? What do you see instead?
I think that a constant array is the wrong way to go about this, perhaps a
CCProcessor model containing information about different processors would
be a better while also providing the base for a way to enable multiple
processors for the same store and easier integration of new processors.

What version of the product are you using? On what operating system?
1.0.a2 on CentOS5 

Please provide any additional information below.
I'll be working toward this myself, as I have a cart that should accept
Multicards (the CC Processor I just integrated) but allow a customer to
choose Paypal if they prefer.
Apr 19, 2008
#1 rogerpack2005
You could just comment it out of the substruct code [yours will always be used,
anyway].  The way I avoid this is by just using a whole new copy of preferences.rb
instead of overriding the existing.
Apr 20, 2008
#2 cmauj...@gmail.com
Thanks rogerpack2005, those are good temporary workarounds.
However,
a. commenting it out of the substruct code
   I'll then have to remember to go back and comment it out after every upgrade.
b. using all of preferences.rb in my custom code
   I'll then have to merge any preference changes after every upgrade.

I think it'll be better to let it spew a warning for now, and hope for or build a
better method of dealing with CC processors down the line.
May 5, 2008
Project Member #3 subim...@gmail.com
Perhaps moving this to a class variable (@@cc_processors) would be better...?
Jul 13, 2008
#4 jpow...@gmail.com
Sounds like we might be working on the same thing... I current run PayPal Soap and
will be integrating that in for normal CC processing, but also want the IPN.  That
really seems like it should be a separate checkbox or something, not a complete
processor.

Jason
Jul 17, 2008
#5 jpow...@gmail.com
Ok, 
Have most of the code done to allow IPN to work separately as a processor that's not
quite tied to the CC processors allowing it to alongside another processor on the
payment pages.

Also got 99% of the WebsitePaymentsPro stuff from active merchant integrated

Aug 11, 2008
Project Member #6 subim...@gmail.com
jpower2 - did you ever make a patch for this? Would love to see it.
Status: Accepted