summaryrefslogtreecommitdiff
path: root/StGeorge.pm
diff options
context:
space:
mode:
authorivan <ivan>2004-05-07 06:19:46 +0000
committerivan <ivan>2004-05-07 06:19:46 +0000
commitdd5c4b34ba2bb52e599b7b84416a34debe79022d (patch)
treea0da8169975e5cb726f855c8966317c34f98b512 /StGeorge.pm
parent50e4bcc992753f5536b0ab1960b4c6e982cb6212 (diff)
Only call init_client and free_client once, fixes multiple transactions
Diffstat (limited to 'StGeorge.pm')
-rw-r--r--StGeorge.pm13
1 files changed, 6 insertions, 7 deletions
diff --git a/StGeorge.pm b/StGeorge.pm
index cea459c..1227e8b 100644
--- a/StGeorge.pm
+++ b/StGeorge.pm
@@ -6,9 +6,10 @@ use Carp qw(croak);
use Business::OnlinePayment;
@ISA = qw(Business::OnlinePayment);
-$VERSION = '0.01';
+$VERSION = '0.02';
use webpayperl; #webpayperl.pm from St.George
+webpayperl::init_client or croak "St.George initialization failed\n";
sub set_defaults {
my $self = shift;
@@ -164,10 +165,6 @@ sub submit {
# if ( $DEBUG ) { warn "$_ => $post{$_}\n" foreach keys %post; }
- webpayperl::init_client or croak "St.George initialization failed\n";
- #dd this to all exit places after here
- #webpayperl::cleanup( $webpayRef );
-
my $webpayRef = webpayperl::newBundle;
webpayperl::addVersionInfo($webpayRef);
webpayperl::put($webpayRef, "DEBUG", "OFF");
@@ -194,7 +191,6 @@ sub submit {
);
webpayperl::cleanup( $webpayRef );
- webpayperl::free_client();
return;
}
@@ -216,10 +212,13 @@ sub submit {
}
webpayperl::cleanup( $webpayRef );
- webpayperl::free_client();
}
+END {
+ webpayperl::free_client();
+}
+
1;
__END__