Beginning of CPAN/debian package preparation.
authorAlex Brelsfoard <alex@Alexs-MacBook-Pro.local>
Fri, 6 Feb 2015 23:10:23 +0000 (18:10 -0500)
committerAlex Brelsfoard <alex@Alexs-MacBook-Pro.local>
Fri, 6 Feb 2015 23:10:23 +0000 (18:10 -0500)
MANIFEST [new file with mode: 0644]
Makefile.PL [new file with mode: 0644]
README [new file with mode: 0644]
test.pl

diff --git a/MANIFEST b/MANIFEST
new file mode 100644 (file)
index 0000000..2c03f96
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,13 @@
+Changes
+MANIFEST
+Makefile.PL
+README
+ignore.txt
+lib/Business/OnlinePayment/vSecureProcessing.pm
+t/00-load.t
+t/boilerplate.t
+t/manifest.t
+t/pod-coverage.t
+t/pod.t
+t/transaction.t
+t/transaction_decline.t
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644 (file)
index 0000000..fe27943
--- /dev/null
@@ -0,0 +1,24 @@
+use strict;
+use warnings;
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    NAME                => 'Business::OnlinePayment::vSecureProcessing',
+    AUTHOR              => q{Alex Brelsfoard <alex@brelsfoard.com>},
+    VERSION_FROM        => 'lib/Business/OnlinePayment/vSecureProcessing.pm',
+    ABSTRACT_FROM       => 'lib/Business/OnlinePayment/vSecureProcessing.pm',
+    ($ExtUtils::MakeMaker::VERSION >= 6.3002
+      ? ('LICENSE'=> 'perl')
+      : ()),
+    PL_FILES            => {},
+    PREREQ_PM => {
+        'Test::More' => 0,
+        'Business::OnlinePayment' => 3.01,
+        'XML::Simple' => 0,
+        'Template' => 0,
+        'Data::Dumper' => 0,
+    },
+    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+    clean               => { FILES => 'Business-OnlinePayment-vSecureProcessing-*' },
+);
+
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..1340c8c
--- /dev/null
+++ b/README
@@ -0,0 +1,14 @@
+Copyright (c) 2014 Freeside Internet Services, Inc.
+All rights reserved. This program is free software; you can redistribute it
+and/or modify it under the same terms as Perl itself.
+
+This is Business::OnlinePayment::vSecureProcessing, a
+Business::OnlinePayment backend module for vSecure Processing.  It is
+only useful if you have a merchant account with vSecure Processing:
+https://www.vsecureprocessing.com/
+
+Business::OnlinePayment is a generic interface for processing payments through
+online credit card processors, online check acceptance houses, etc.  (If you
+like buzzwords, call it an "multiplatform ecommerce-enabling middleware
+solution").
+
diff --git a/test.pl b/test.pl
index 34e38b4..40f528b 100755 (executable)
--- a/test.pl
+++ b/test.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w -d
+#!/usr/bin/perl -w
 
 #
 # Make sure to copy Business::OnlinePayment::vSecureProcessing into its
@@ -18,10 +18,14 @@ my %opt = (
     env => 'test'
 );
 
+my $action = shift || 'Normal Authorization';
+my $auth = shift || '';
+
 
 my %content = (
     appid          => 'yiptv',
-    action         => 'Normal Authorization',
+    action         => $action,
+    auth           => $auth,
     description    => 'Business::OnlinePayment visa test',
 #    card_number    => '4007000000027',
     card_number    => '4111111111111111',
@@ -38,10 +42,29 @@ main();
 
 sub main {
     my $transaction = Business::OnlinePayment->new("vSecureProcessing", %opt);
-    #$transaction->server('localhost');
-    #$transaction->path('/cgi-bin/test.cgi');
+    
+    print "MAKING PAYMENT\n";
+    MakPayment($transaction);
+    $content{'action'} = 'void';
+    $content{'reference_number'} = $transaction->authorization;
+    $content{'transaction_date'} = $transaction->txn_date;
+    $content{'amount'} = $transaction->txn_amount;
+    print "VOIDING PAYMENT\n";
+    VoidPayment($transaction);
+    $content{'action'} = 'Normal Authorization';
+    print "MAKING PAYMENT\n";
+    MakePayment($transaction);
+    print "REFUNDING PAYMENT\n";
+    $content{'action'} = 'credit';
+    $content{'reference_number'} = $transaction->authorization;
+    $content{'transaction_date'} = $transaction->txn_date;
+    $content{'amount'} = $transaction->txn_amount;
+    refundPayment($transaction);
+}
+
+sub MakePayment {
     $transaction->content(%content);
-    $DB::single = 1;
+
     eval { $transaction->submit(); };
 
     if ( $@ ) {
@@ -55,10 +78,17 @@ sub main {
         } else {
             print "Card was rejected: ". $transaction->error_message(). "\n";
         }
-    
     }
 }
 
+sub VoidPayment {
+    
+}
+
+sub RefundPayment {
+    
+}
+
 
 sub expiration_date {
     my($month, $year) = (localtime)[4,5];