add introspection info used in Business::OnlinePayment 3.01+
authorivan <ivan>
Tue, 24 Nov 2009 02:54:42 +0000 (02:54 +0000)
committerivan <ivan>
Tue, 24 Nov 2009 02:54:42 +0000 (02:54 +0000)
Changes
IPPay.pm
MANIFEST
t/introspection.t [new file with mode: 0644]

diff --git a/Changes b/Changes
index c904684..8f25fda 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Perl extension Business::OnlinePayment::IPPay.
 
+0.05  unreleased
+        - add introspection info used in Business::OnlinePayment 3.01+
+
 0.04  Tue Jul 22 12:19:54 2008 EDT
        - force country and ship country to ISA-3166-alpha-3
 
index 9c35919..bc97446 100644 (file)
--- a/IPPay.pm
+++ b/IPPay.pm
@@ -11,10 +11,34 @@ use Business::OnlinePayment::HTTPS;
 use vars qw($VERSION $DEBUG @ISA $me);
 
 @ISA = qw(Business::OnlinePayment::HTTPS);
-$VERSION = '0.04';
+$VERSION = '0.05_01';
+$VERSION = eval $VERSION; # modperlstyle: convert the string into a number
+
 $DEBUG = 0;
 $me = 'Business::OnlinePayment::IPPay';
 
+sub _info {
+  {
+    'info_version'          => '0.01',
+    'module_version'        => $VERSION,
+    'supported_types'       => [ qw( CC ECHECK ) ],
+    'supported_actions'     => { 'CC' => [
+                                     'Normal Authorization',
+                                     'Authorization Only',
+                                     'Post Authorization',
+                                     'Void',
+                                     'Credit',
+                                   ],
+                                   'ECHECK' => [
+                                     'Normal Authorization',
+                                     'Void',
+                                     'Credit',
+                                   ],
+                                 },
+    'CC_void_requires_card' => 1,
+  };
+}
+
 sub set_defaults {
     my $self = shift;
     my %opts = @_;
@@ -397,6 +421,7 @@ sub _xmlwrite {
 }
 
 1;
+
 __END__
 
 =head1 NAME
index c782755..1ce0cab 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -7,4 +7,5 @@ t/00load.t
 t/card.t
 t/check.t
 t/bop.t
+t/introspection.t
 META.yml                                 Module meta-data (added by MakeMaker)
diff --git a/t/introspection.t b/t/introspection.t
new file mode 100644 (file)
index 0000000..38a76f1
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w
+
+use Test::More;
+
+eval 'use Business::OnlinePayment 3.01;';
+if ( $@ ) {
+  plan skip_all => 'Business::OnlinePayment 3.01+ not available';
+} else {
+  plan tests => 1;
+}
+
+my($login, $password, @opts) = ('TESTMERCHANT', '',
+                                'default_Origin' => 'RECURRING' );
+
+my $tx = Business::OnlinePayment->new("IPPay", @opts);
+
+ok( $tx->info('CC_void_requires_card') == 1, 'CC_void_requires_card introspection' );