--- /dev/null
+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-*' },
+);
+
--- /dev/null
+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").
+
-#!/usr/bin/perl -w -d
+#!/usr/bin/perl -w
#
# Make sure to copy Business::OnlinePayment::vSecureProcessing into its
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',
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 ( $@ ) {
} else {
print "Card was rejected: ". $transaction->error_message(). "\n";
}
-
}
}
+sub VoidPayment {
+
+}
+
+sub RefundPayment {
+
+}
+
sub expiration_date {
my($month, $year) = (localtime)[4,5];