[ic] Need assistance with Tag

Kevin Walsh interchange-users@interchange.redhat.com
Sat Oct 13 09:18:01 2001


> > Using this line in our custom payment module
> >
> > my $tax_charge = $Tag->salestax({name=>$Vend::Items,noformat => 1});
> >
> >
> >  Get this error on checkout..
> >
> > (securetrans): Charge failed, reason: payment routine 'securetrans'
> > returned error: Can't call method "salestax" on an undefined value at
> > /usr/local/interchange/default/lib/Vend/Payment/securetrans.pm line 112.
> >
> Never mind this seems to work fine..
>
> my $tax_charge = &Vend::Interpolate::tag_salestax($Carts->{main},1); Chris
>
Yes, as you have found, the $Tag object is not available from within your
payment module.

As you don't need the formatting, perhaps this will be slightly better
for you:

    my $tax_charge = Vend::Interpolate::salestax();

Also, check the $cart argument to &tag_salestax and &salestax as you
are not using it correctly.  You should be using the cart name, such
as 'main', rather than either of $Vend::Items or $Carts->{main}.
If this argument is left undefined, it will default to your current
cart, which is ususlly 'main' anyway.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.uk.com
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/