that barfs even more ....
unknown processor AuthorizeNet (Can't locate Unleashed/AuthorizeCard/A
+uthorizeNet.pm in @INC
and i do have the right mods installed. the test script ( sans subclassing ) works.
i'm going to have to dig around in Business::OnlinePayment's source, i guess. | [reply] [d/l] [select] |
Ah, sure enough -- if you look at the source of OnlinePayment.pm you'll see that it's got a very specific approach to subclassing already implemented.
It might be straightforward to make a package that was a subclass of a specific processor, such as Unleashed::AuthorizeCard::AuthorizeNet inheriting from both your Unleashed::AuthorizeCard and Business::OnlinePayment::AuthorizeNet.
If you want to dynamically handle whichever processor the end-user selects, you'll probably have to either generate subclasses on the fly, or use delegation rather than inheritance.
(More generally, this illustrates one of the advantages of well-factored frameworks that use delegation internally; for example, I can imagine a version of Business::OnlinePayment that was divided into separate Transaction and Processor classes, which would allow you to subclass Transaction without worrying which Processor it was connecting to.)
| [reply] |
i looked at the source and realized that subclassing *wasn't* what i should be doing.
i should have been writing a wrapper, not a subclass. so that's what i did, and stashed the Business::OnlinePayment object in the wrapper object. that takes care of the issue, and i just need an extra method call to access the processor object.
| [reply] [d/l] |