diff options
author | mark <mark> | 2009-10-27 01:22:40 +0000 |
---|---|---|
committer | mark <mark> | 2009-10-27 01:22:40 +0000 |
commit | b99fc5647d41a7dfadd0817228b91191d1ad04ad (patch) | |
tree | 358c5387ee2f0e9c08d8e0ade524c003467b3933 | |
parent | 5542044a7fae3e5a3201985b9c6a3ff358dff294 (diff) |
clean up parameters
-rw-r--r-- | lib/Business/OnlinePayment/Jety.pm | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/Business/OnlinePayment/Jety.pm b/lib/Business/OnlinePayment/Jety.pm index c154d21..890152e 100644 --- a/lib/Business/OnlinePayment/Jety.pm +++ b/lib/Business/OnlinePayment/Jety.pm @@ -13,7 +13,7 @@ use Tie::IxHash; $VERSION = '0.01'; $me = 'Business::OnlinePayment::Jety'; -$DEBUG = 1; +$DEBUG = 0; my @fields = (qw( username @@ -31,6 +31,8 @@ my @fields = (qw( programdesc ref bankname + bankcity + bankstate accountaba accountdda amount @@ -42,6 +44,8 @@ my %map = ( last_name => 'lastname', address => 'address1', bank_name => 'bankname', + bank_city => 'bankcity', + bank_state => 'bankstate', account_number => 'accountdda', routing_code => 'accountaba', ); @@ -66,9 +70,14 @@ sub map_fields { die "Jety interface only supports Normal Authorization.\n" if(lc($content->{action}) ne 'normal authorization'); - $content->{'function'} = 'ach'; + $content->{'function'} = 'echeck'; $content->{'programdesc'} = '415-462-1624 Business::OnlinePayment::Jety'; $content->{'ref'} = time2str('%Y%m%d',time).'-'.int(rand(1000000)); + + $content->{'bankname'} ||= 'unknown'; + $content->{'bankcity'} ||= 'unknown'; + $content->{'bankstate'} ||= 'XX'; + return; } @@ -77,6 +86,13 @@ sub submit { $Business::OnlinePayment::HTTPS::DEBUG = $DEBUG; $DB::single = $DEBUG; + # strip existent but empty fields so that required_fields works right + foreach(keys(%{$self->{_content}})) { + delete $self->{_content}->{$_} + if (!defined($self->{_content}->{$_} ) or + $self->{_content}->{$_} eq ''); + } + $self->required_fields(qw( type action |