use Tie::IxHash;
@ISA = qw(Business::OnlinePayment::HTTPS);
-$VERSION = '0.01';
+$VERSION = '0.04';
$me = 'Business::OnlinePayment::Jety';
-$DEBUG = 1;
+$DEBUG = 0;
my @fields = (qw(
username
programdesc
ref
bankname
+ bankcity
+ bankstate
accountaba
accountdda
amount
));
my %map = (
- login => 'username',
- first_name => 'firstname',
- last_name => 'lastname',
- address => 'address1',
- bank_name => 'bankname',
- account_number => 'accountdda',
- routing_code => 'accountaba',
+ 'login' => 'username',
+ 'first_name' => 'firstname',
+ 'last_name' => 'lastname',
+ 'address' => 'address1',
+ 'bank_name' => 'bankname',
+ 'bank_city' => 'bankcity',
+ 'bank_state' => 'bankstate',
+ 'account_number' => 'accountdda',
+ 'routing_code' => 'accountaba',
+ 'description' => 'programdesc',
);
-
sub set_defaults {
my $self = shift;
die "Jety interface only supports Normal Authorization.\n"
if(lc($content->{action}) ne 'normal authorization');
- $content->{'function'} = 'ach';
- $content->{'programdesc'} = '415-462-1624 Business::OnlinePayment::Jety';
- $content->{'ref'} = time2str('%Y%m%d',time).'-'.int(rand(1000000));
+ $content->{'function'} = 'echeck';
+ $content->{'ref'} =
+ substr( time2str('%Y%m%d%H%M%S',time). int(rand(10000)), -15 );
+
+ $content->{'phone'} ||= '111-111-1111';
+
+ $content->{'bankname'} ||= 'unknown';
+ $content->{'bankcity'} ||= 'unknown';
+ $content->{'bankstate'} ||= 'XX';
+
return;
}
$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
state
zip
email
- phone
account_number
routing_code
amount
- ) );
+ description
+ ));
$self->map_fields;
- tie my %request, 'Tie::IxHash', (
- map { $_, $self->{_content}->{$_} } @fields
- );
+ tie my %request, 'Tie::IxHash', map { $_ => $self->{_content}->{$_} } @fields;
$DB::single = $DEBUG;
if($self->test_transaction()) {
login => 'testdrive',
password => 'testpass',
action => 'Normal Authorization',
- description => 'Business::OnlinePayment test',
+ description => '111-111-1111 www.example.com',
amount => '49.95',
invoice_number => '100100',
first_name => 'Jason',
=head2 ECHECK
-Content required: type, login, password, action, amount, first_name, last_name, account_number, routing_code.
+Content required: type, login, password, action, amount, first_name, last_name, account_number, routing_code, description.
+
+description should be set in the form "111-111-1111 www.example.com"
=head1 DESCRIPTION