my @flags = ($currency);
- foreach (ref $data{taxes} ?
- @{ $data{taxes} } :
- split(' ' => $data{taxes} || '')) {
+ my @taxes;
+ if (ref $data{taxes}) {
+ @taxes = @{ $data{taxes} };
+ } elsif ($data{taxes}) {
+ @taxes = split ' ' => $data{taxes};
+ }
+
+ foreach (@taxes) {
croak "Unknown tax code $_" unless /^(GST|PST|HST)$/i;
push @flags, uc $_;
}
croak "Unknown currency code ", $content{currency}
unless $content{currency} =~ /^(CAD|USD)$/;
- $content{taxes} = uc($content{taxes} || '');
-
my %data = $self->get_remap_fields(qw(
xxxCard_Number card_number
=item taxes
-Taxes to be added automatically to B<amount> by InternetSecure.
+Taxes to be added automatically to B<amount> by InternetSecure. Available
+taxes are C<GST>, C<PST> and C<HST>.
-Available taxes are C<GST>, C<PST> and C<HST>. Multiple taxes can specified
-by concatenating them with spaces, such as C<GST HST>.
+This argument can either be a single string of taxes concatenated with spaces
+(such as C<GST PST>), or a reference to an array of taxes (such as C<[ "GST",
+"PST" ]>).
=item name / company / address / city / state / zip / country / phone / email