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.)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.