X-Git-Url: http://git.freeside.biz/gitweb/?p=Business-OnlinePayment-Bambora.git;a=blobdiff_plain;f=lib%2FBusiness%2FOnlinePayment%2FBambora.pm;h=98c402f39e9c67b535f4e7007675b0bf80b91ded;hp=d872f2cf08acac30109daef1b540a6ab0670d153;hb=aafac6c334a6fd51e131e958a22adb04b62bf476;hpb=ced39f8f0dfa79bb947678c00ea33d6538424516 diff --git a/lib/Business/OnlinePayment/Bambora.pm b/lib/Business/OnlinePayment/Bambora.pm index d872f2c..98c402f 100755 --- a/lib/Business/OnlinePayment/Bambora.pm +++ b/lib/Business/OnlinePayment/Bambora.pm @@ -17,14 +17,31 @@ use URI::Escape; use vars qw/ $VERSION $DEBUG /; $VERSION = '0.1'; -$DEBUG = 1; - -if ( $DEBUG ) { - $Data::Dumper::Sortkeys = 1; -} +$DEBUG = 0; =head1 INTERNAL METHODS +=head2 _info + +=cut + +sub _info {{ + info_compat => '0.01', + module_version => $VERSION, + supported_types => [qw/ CC /], + supported_actions => { + CC => [ + 'Normal Authorization', + 'Authorization Only', + 'Post Authorization', + 'Void', + 'Credit', + 'Reverse Authorization', + 'Tokenize', + ], + }, +}} + =head2 set_defaults See L @@ -544,13 +561,14 @@ sub jhref_card { $self->set_expiration; + $content->{owner} ||= $content->{name}; + # Check required input for my $f (qw/ card_number owner expiry_month expiry_year - cvv2 /) { next if $content->{$f}; @@ -558,9 +576,14 @@ sub jhref_card { "Cannot parse card payment - missing required content $f" ); - warn $self->error_message if $DEBUG; - $self->is_success( 0 ); + if ( $DEBUG ) { + warn Dumper({ + error_message => $self->error_message, + content => $content, + }); + } + $self->is_success( 0 ); return {}; } @@ -569,7 +592,8 @@ sub jhref_card { name => $self->truncate( $content->{owner}, 64 ), expiry_month => sprintf( '%02d', $content->{expiry_month} ), expiry_year => sprintf( '%02d', $content->{expiry_year} ), - cvd => $content->{cvv2}, + + $content->{cvv2} ? ( cvd => $content->{cvv2} ) : (), } }