summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a977326)
- build_subs now uses can() so it doesn't redefine subs (and generate warnings)
- DOC: SYNOPSIS now uses correct "card_number" and not "cardnumber"
my($class,$processor,%data) = @_;
Carp::croak("unspecified processor") unless $processor;
my($class,$processor,%data) = @_;
Carp::croak("unspecified processor") unless $processor;
if($params{'type'}) { $self->transaction_type($params{'type'}); }
%{$self->{'_content'}} = %params;
}
if($params{'type'}) { $self->transaction_type($params{'type'}); }
%{$self->{'_content'}} = %params;
}
- return %{$self->{'_content'}};
+ return exists $self->{'_content'} ? %{$self->{'_content'}} : ();
# AutoLoader::AUTOLOAD, instead of passing up the chain
sub build_subs {
my $self = shift;
# AutoLoader::AUTOLOAD, instead of passing up the chain
sub build_subs {
my $self = shift;
- no warnings 'redefine';
+ next if($self->can($_));
eval "sub $_ { my \$self = shift; if(\@_) { \$self->{$_} = shift; } return \$self->{$_}; }";
}
}
eval "sub $_ { my \$self = shift; if(\@_) { \$self->{$_} = shift; } return \$self->{$_}; }";
}
}
my $transaction = new Business::OnlinePayment($processor, %processor_info);
$transaction->content(
my $transaction = new Business::OnlinePayment($processor, %processor_info);
$transaction->content(
- type => 'Visa',
- amount => '49.95',
- cardnumber => '1234123412341238',
- expiration => '0100',
- name => 'John Q Doe',
+ type => 'Visa',
+ amount => '49.95',
+ card_number => '1234123412341238',
+ expiration => '0100',
+ name => 'John Q Doe',
);
$transaction->submit();
);
$transaction->submit();