diff --git a/lib/Vend/Payment/AuthorizeNet.pm b/lib/Vend/Payment/AuthorizeNet.pm index 745cc62..bfd2a96 100644 --- a/lib/Vend/Payment/AuthorizeNet.pm +++ b/lib/Vend/Payment/AuthorizeNet.pm @@ -274,7 +274,9 @@ sub authorizenet { my $opt; my $secret; - + my $shipping; + my $salestax; + if(ref $user) { $opt = $user; $user = $opt->{id} || undef; @@ -398,6 +400,20 @@ sub authorizenet { $amount = Vend::Util::round_to_frac_digits($amount,$precision); } + $shipping = $opt->{shipping} if $opt->{shipping}; + + if(! $shipping) { + $shipping = Vend::Interpolate::tag_shipping(); + $shipping = Vend::Util::round_to_frac_digits($shipping,$precision); + } + + $salestax = $opt->{salestax} if $opt->{salestax}; + + if(! $salestax) { + $salestax = Vend::Interpolate::salestax(); + $salestax = Vend::Util::round_to_frac_digits($salestax,$precision); + } + my $order_id = gen_order_id($opt); #::logDebug("auth_code=$actual->{auth_code} order_id=$opt->{order_id}"); @@ -414,6 +430,11 @@ sub authorizenet { x_Method => 'ECHECK', ); + my $tax_exempt = 'TRUE'; + if($salestax > 0) { + $tax_exempt = 'FALSE'; + } + my %query = ( x_Test_Request => $opt->{test} || charge_param('test'), x_First_Name => $actual->{b_fname}, @@ -436,6 +457,10 @@ sub authorizenet { x_Phone => $actual->{phone_day}, x_Type => $transtype, x_Amount => $amount, + x_Tax => $salestax, + x_Freight => $shipping, + x_PO_Num => $actual->{po_number}, + x_Tax_Exempt => $tax_exempt, x_Method => 'CC', x_Card_Num => $actual->{mv_credit_card_number}, x_Exp_Date => $exp,