X-Git-Url: http://git.freeside.biz/gitweb/?p=Business-OnlinePayment-Cardcom.git;a=blobdiff_plain;f=Cardcom.pm;h=57e9d142102c717f5c132f44b7cdf769c1079b12;hp=68ba354a2a3441309280546fba229b122c24cc29;hb=f4e54b965c13751c1a4b79f801f65d25dbd13cae;hpb=eee2fc961434a73bf93bf42dae256961d31fa6b8 diff --git a/Cardcom.pm b/Cardcom.pm index 68ba354..57e9d14 100644 --- a/Cardcom.pm +++ b/Cardcom.pm @@ -24,7 +24,6 @@ sub set_defaults { # -Identity number # -Configurable currency # -Configurable deal code -# -Refunds or whatever this thing calls them sub submit { my($self) = @_; @@ -38,8 +37,13 @@ sub submit { cvv2 => 'cvv', ); - die "invalid action" unless - $self->{_content}{'action'} =~ /^\s*normal\s*authorization\s*$/i; + my $action = $self->{_content}{'action'}; + if ( $action =~ /^\s*credit\s*$/i ) { + $self->{_content}{dealtype} = 51; + $self->{_content}{credittype} = 1; + } elsif ( $action !~ /^\s*normal\s*authorization\s*$/i ) { + die "invalid action"; + } $self->{_content}{'expiration'} =~ /^(\d+)\D+\d*(\d{2})$/ or croak "unparsable expiration ". $self->{_content}{expiration}; @@ -111,6 +115,8 @@ sub fields { Username userpassword languages + dealtype + credittype cvv ); } @@ -124,9 +130,10 @@ sub _info { 'support_types' => [ 'CC' ], 'token_support' => 0, # well technically the gateway supports it, but we haven't implemented it 'test_transaction' => 1, - 'supported_actions' => [ # XXX refunds + 'supported_actions' => [ 'Normal Authorization', - ], + 'Credit', + ], }; }