projects
/
Business-OnlinePayment-Jety.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5542044
)
clean up parameters
author
mark
<mark>
Tue, 27 Oct 2009 01:22:40 +0000
(
01:22
+0000)
committer
mark
<mark>
Tue, 27 Oct 2009 01:22:40 +0000
(
01:22
+0000)
lib/Business/OnlinePayment/Jety.pm
patch
|
blob
|
history
diff --git
a/lib/Business/OnlinePayment/Jety.pm
b/lib/Business/OnlinePayment/Jety.pm
index
c154d21
..
890152e
100644
(file)
--- 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';
$VERSION = '0.01';
$me = 'Business::OnlinePayment::Jety';
-$DEBUG =
1
;
+$DEBUG =
0
;
my @fields = (qw(
username
my @fields = (qw(
username
@@
-31,6
+31,8
@@
my @fields = (qw(
programdesc
ref
bankname
programdesc
ref
bankname
+ bankcity
+ bankstate
accountaba
accountdda
amount
accountaba
accountdda
amount
@@
-42,6
+44,8
@@
my %map = (
last_name => 'lastname',
address => 'address1',
bank_name => 'bankname',
last_name => 'lastname',
address => 'address1',
bank_name => 'bankname',
+ bank_city => 'bankcity',
+ bank_state => 'bankstate',
account_number => 'accountdda',
routing_code => 'accountaba',
);
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');
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->{'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;
}
return;
}
@@
-77,6
+86,13
@@
sub submit {
$Business::OnlinePayment::HTTPS::DEBUG = $DEBUG;
$DB::single = $DEBUG;
$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
$self->required_fields(qw(
type
action