diff --git a/Changes b/Changes index 4865a7e..1185485 100644 --- a/Changes +++ b/Changes @@ -19,3 +19,6 @@ Revision history for Perl extension Business::OnlinePayment::CyberSource.. 0.05 Mon Oct 2 2005 - Set the defaults for the business logic settings using the cybs.ini + +0.05 Wed Oct 12 2005 + - Allow both line items and grand total. If you use both, the grand total will prevail. diff --git a/CyberSource.pm b/CyberSource.pm index 5ccc88a..8a60b02 100644 --- a/CyberSource.pm +++ b/CyberSource.pm @@ -12,7 +12,7 @@ require Exporter; @ISA = qw(Exporter AutoLoader Business::OnlinePayment); @EXPORT = qw(); @EXPORT_OK = qw(); -$VERSION = '0.05'; +$VERSION = '0.06'; # ACTION MAP my @action_list = ('ccAuthService_run', 'ccAuthReversalService_run', @@ -361,7 +361,8 @@ sub _set_item_list { &Carp::croak("Item " . $item->{'number'} . " has no unit_price"); } } - } elsif (defined($content->{'amount'}) && $content->{'amount'} ne '') { + } + if (defined($content->{'amount'}) && $content->{'amount'} ne '') { if (defined($content->{'freight'}) && $content->{'freight'} ne '') { $request->{'purchaseTotals_freightAmount'} = $content->{'freight'}; } @@ -369,7 +370,9 @@ sub _set_item_list { $request->{'purchaseTotals_taxAmount'} = $content->{'tax'}; } $request->{'purchaseTotals_grandTotalAmount'} = $content->{'amount'}; - } else { + } + if ((!defined($content->{'items'}) || scalar($content->{'items'}) < 0) && + (!defined($content->{'amount'})|| $content->{'amount'} eq '')) { &Carp::croak("It's impossible to auth without items or amount populated!"); } diff --git a/META.yml b/META.yml index 6a6998d..3162531 100644 --- a/META.yml +++ b/META.yml @@ -1,7 +1,7 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Business-OnlinePayment-CyberSource -version: 0.05 +version: 0.06 version_from: CyberSource.pm installdirs: site requires: