Remove prod_string() taxes argument
authorfbriere <fbriere>
Thu, 16 Feb 2006 23:44:35 +0000 (23:44 +0000)
committerfbriere <fbriere>
Thu, 16 Feb 2006 23:44:35 +0000 (23:44 +0000)
InternetSecure.pm

index c70b79f..65a9112 100755 (executable)
@@ -108,14 +108,13 @@ sub parse_expdate {
 # Convert a single product into a product string
 #
 sub prod_string {
-       my ($self, $currency, $taxes, %data) = @_;
+       my ($self, $currency, %data) = @_;
 
        croak "Missing amount in product" unless defined $data{amount};
 
        my @flags = ($currency);
 
-       $taxes = uc $data{taxes} if defined $data{taxes};
-       foreach (split ' ' => $taxes) {
+       foreach (split ' ' => uc($data{taxes} || '')) {
                croak "Unknown tax code $_" unless /^(GST|PST|HST)$/;
                push @flags, $_;
        }
@@ -200,16 +199,16 @@ sub to_xml {
        
        if (ref $content{description}) {
                $data{Products} = join '|' => map $self->prod_string(
-                                                       $content{currency},
-                                                       $content{taxes},
-                                                       %$_),
-                                               @{ $content{description} };
+                                               $content{currency},
+                                               taxes => $content{taxes},
+                                               %$_),
+                                       @{ $content{description} };
        } else {
                $self->required_fields(qw(amount));
                $data{Products} = $self->prod_string(
                                        $content{currency},
-                                       $content{taxes},
-                                       amount => $content{amount},
+                                       taxes       => $content{taxes},
+                                       amount      => $content{amount},
                                        description => $content{description},
                                );
        }