[bop-devel] AuthorizeNet MD5 Check

Ivan Kohler ivan at sisd.com
Wed Sep 26 01:18:20 PDT 2007


On Tue, Sep 25, 2007 at 05:17:56PM -0700, Bill Moseley wrote:
> On Tue, Sep 25, 2007 at 04:32:56PM -0700, Ivan Kohler wrote:
> > On Tue, Sep 25, 2007 at 03:00:30PM -0700, Bill Moseley wrote:
> > > On Tue, Sep 25, 2007 at 02:03:07PM -0700, Ivan Kohler wrote:
> > > 
> > > 
> > > > Yes, the advantage is very much the whole reason why we have a class of 
> > > > modules within a framework and not disparate modules.
> > > > 
> > > >    my $tx = Business::OnlinePayment->new( $processor, %options );
> > > > 
> > > > is better than:
> > > > 
> > > >   my $tx = eval "Business::OnlinePayment::$processor->new( \%options )";
> > > >   die $@ if $@;
> > > 
> > > You don't mean string eval there.  And I don't think you mean eval
> > > block, either.
> > 
> 
> I thought we were talking about how the end-user calls B::OP.
>
> The current way is:
> 
>     $tx = Business::OnlinePayment->new("AuthorizeNet");
> 
> Where I was suggesting that end-users pick their payment gateway of
> choice and do:
> 
>     $tx = Business::OnlinePayment::AuthorizeNet->new;

The end-user picking the payment gateway is not necessarily the 
programmer implementing the code.  Changing the interface to hardcode 
the payment gateway is a gratuitous interface change that makes things 
more difficult for the other 99.9% of folks who don't care about 
subclassing gateway modules.  Did I mention that subclassing the gateway 
modules is NOT A SUPPORTED PUBLIC INTERFACE?

This change is not going to happen on my watch.  Move on.

> > Yes, I sure did.  $processor needs to be interpolated.
> 
> Maybe we are talking about different things.  What's the eval string for?
> 
>     my $package = "Business::OnlinePayment::$processor";
>     $package->require || die "Failed to load package '$package': $@"
>     my $tx = $package->new;

This is supposed to be an improvement?

> > Which is why we offer the first interface instead.  "AuthorizeNet" 
> > should not be hardcoded.
> 
> That was my question.  Do people use different processors at the same
> time?

People use different processors with a single application without 
changing the code.  The fact that we implment different processors with 
different modules is not a public aspect of the implmentation.  MOVE ON.

-- 
_ivan


More information about the bop-devel mailing list