0.09
[Business-OnlinePayment-Jety.git] / lib / Business / OnlinePayment / Jety.pm
index f653e8a..bfd7998 100644 (file)
@@ -10,7 +10,7 @@ use Date::Format;
 use Tie::IxHash;
 
 @ISA = qw(Business::OnlinePayment::HTTPS);
-$VERSION = '0.06';
+$VERSION = '0.09';
 $me = 'Business::OnlinePayment::Jety';
 
 $DEBUG = 0;
@@ -18,6 +18,7 @@ $DEBUG = 0;
 my %trans_type = (
   'normal authorization' => 'echeck',
   'void'                 => 'ereturn',
+  'credit'               => 'ereturn',
   );
 
 my %map = (
@@ -36,7 +37,7 @@ my %map = (
   'phone'         => 'phone',
   'programdesc'   => 'description',
   'ref'           => sub { my %c = @_; 
-                           $c{'order_number'} || 
+                           $c{'authorization'} || 
                            substr( time2str('%Y%m%d%H%M%S',time). int(rand(10000)), -15 ) 
                            },
   'bankname'      => 'bank_name',
@@ -49,11 +50,12 @@ my %map = (
 'void' => [
   'username'      => 'login',
   'password'      => 'password',
-  'ref'           => 'order_number',
+  'ref'           => 'authorization',
   'accountdda'    => 'account_number',
   'amount'        => sub { my %c = @_; sprintf("%.02f",$c{'amount'}) },
 ],
 );
+$map{'credit'} = $map{'void'};
 
 my %defaults = ( # using the B:OP names
   'phone'         => '111-111-1111',
@@ -85,11 +87,24 @@ my %required = (
   action
   login
   password
-  order_number
+  authorization 
   account_number
   amount
 ) ],
 );
+$required{'credit'} = $required{'void'};
+
+sub _info {
+  {
+    info_compat             => '0.01',
+    gateway_name            => 'Jety',
+    gateway_url             => 'http://www.jetypay.com',
+    module_version          => $VERSION,
+    supported_types         => [ 'ECHECK' ],
+    supported_actions       => [ 'Normal Authorization', 'Void', 'Credit' ],
+    ECHECK_void_requires_account => 1,
+  }
+}
 
 sub set_defaults {
   my $self = shift;
@@ -245,8 +260,7 @@ Business::OnlinePayment::Jety - Jety Payments ACH backend for Business::OnlinePa
   use Business::OnlinePayment;
 
   ####
-  # Electronic check authorization.  We only support 
-  # 'Normal Authorization'.
+  # Electronic check authorization.
   ####
 
   my $tx = new Business::OnlinePayment("Jety");
@@ -307,7 +321,9 @@ Returns a useful error message.
 
 The following actions are valid:
 
-  normal authorization
+  Normal Authorization
+  Void
+  Credit
 
 =head1 AUTHOR
 
@@ -317,5 +333,14 @@ Mark Wells <mark@freeside.biz>
 
 perl(1). L<Business::OnlinePayment>.
 
+=head1 ADVERTISEMENT
+
+Need a complete, open-source back-office and customer self-service solution?
+The Freeside software includes support for credit card and electronic check
+processing, integrated trouble ticketing, and customer signup and self-service
+web interfaces.
+
+http://freeside.biz/freeside/
+
 =cut