Convert to Business::OnlinePayment:HTTPS master
authorjeff <jeff>
Tue, 24 Oct 2006 17:30:46 +0000 (17:30 +0000)
committerjeff <jeff>
Tue, 24 Oct 2006 17:30:46 +0000 (17:30 +0000)
Makefile.PL
eWay.pm

index 6bf0fb3..90e08e0 100644 (file)
@@ -5,8 +5,9 @@ WriteMakefile(
     'NAME'         => 'Business::OnlinePayment::eWay',
     'VERSION_FROM' => 'eWay.pm', # finds $VERSION
     'AUTHOR'       => 'Jeff Finucane <jeff@cmh.net>',
-    'PREREQ_PM'    => { 'Net::SSLeay' => 0,
-                        'Business::OnlinePayment' => 0,
+    'PREREQ_PM'    => { 
+                        'Business::OnlinePayment' => 3,
+                        'Business::OnlinePayment::HTTPS' => 0.04,
                         'Business::CreditCard' => 0.27,
                         'XML::Simple' => 2.14,
                       },
diff --git a/eWay.pm b/eWay.pm
index e99ab37..06f348e 100644 (file)
--- a/eWay.pm
+++ b/eWay.pm
@@ -2,20 +2,16 @@ package Business::OnlinePayment::eWay;
 
 use strict;
 use Carp;
-use Business::OnlinePayment;
+use Business::OnlinePayment 3;
+use Business::OnlinePayment::HTTPS;
 use Business::CreditCard;
-use Net::SSLeay qw( post_https );
 use XML::Simple;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $DEBUG);
+use vars qw($VERSION @ISA $DEBUG);
 
-require Exporter;
-
-@ISA = qw(Exporter AutoLoader Business::OnlinePayment);
-@EXPORT = qw();
-@EXPORT_OK = qw();
+@ISA = qw(Business::OnlinePayment::HTTPS);
 $VERSION = '0.01';
 
-$DEBUG = 1;
+$DEBUG = 0;
 
 my $default_path = '/gateway/xmlpayment.asp';
 my $default_cvn_path = '/gateway_cvn/xmlpayment.asp';
@@ -122,30 +118,28 @@ sub submit {
     if ( $DEBUG ) {
       warn $pd,"\n";
     }
-    my $server = $self->server();
-    my $port = $self->port();
-    my $path = $self->path();
-    if ($post_data{ewayCVN} && $path eq $default_path){
-      $path = $default_cvn_path;
+    my $oldpath = $self->path;
+    if ($post_data{ewayCVN} && $self->path eq $default_path){
+      $self->path($default_cvn_path);
     }
     if ($self->test_transaction) {
-      if ($path eq $default_path) {
-        $path = $default_test_path;
-      }elsif ($path eq $default_cvn_path){
-        $path = $default_cvn_test_path;
+      if ($self->path eq $default_path) {
+        $self->path($default_test_path);
+      }elsif ($self->path eq $default_cvn_path){
+        $self->path($default_cvn_test_path);
       }else{
-        croak "Test mode not supported for path: $path\n";
+        croak "Test mode not supported for path: " . $self->path . "\n";
       }
     }
 
-    my($page,$server_response) =
-      post_https($server,$port,$path,'',$pd);
+    my($page,$server_response) = $self->https_post($pd);
+    $self->path($oldpath);
     if ( $DEBUG ) {
       warn $page,"\n";
     }
 
     my $response;
-    if ($server_response =~ /HTTP\/1\.1 200 OK/){
+    if ($server_response =~ /200/){
       $response = XMLin($page);
     }else{
       $response->{ewayTrxnError} = $server_response;