When i place an order with the amount 485 SEK everything looks good at checkout with vat (moms)
but when redirecting to auriga payment it shows a different amount 525 SEK
and it doesnt show moms on auriga page.

CommentFileSizeAuthor
#2 aurigapayment.png31.95 KBtracer76
#2 review.png15.44 KBtracer76
#2 vat.png33.65 KBtracer76

Comments

henrrrik’s picture

Component: User interface » Code
Assigned: Unassigned » henrrrik
Status: Active » Postponed (maintainer needs more info)

Sounds like some kind of configuration problem. The module adds up all the line items and sends the total to Auriga, VAT isn't (and IIRC can't be) reported separately to the payment gateway.

tracer76’s picture

StatusFileSize
new33.65 KB
new15.44 KB
new31.95 KB

Figured out that shipping adds cost twice at review and auriga page.
Maybe it will work to reinstall the module and delete Tax, vat tables from database ?

henrrrik’s picture

I'm not sure, but I wouldn't manually wipe anything from the DB.

Christofer Roth’s picture

I'm new to Ubercart, but I'm guessing the problem is in the loop that starts on line 196 in uc_auriga.module

  // Compile total amount
  foreach ($order->line_items as $item) {
    $amount = $amount + $item['amount'];
  }
  $data['Amount'] = ($amount * 100); // Auriga wants the amount in ören/cents

The $item['amount'] doesn't seem safe to just add up. In my case it contained subtotal including taxes but excluding shipping + taxes + shipping excluding taxes. So taxes where added twice on the items.

Since the amount already is calculated and exists in the $order object as $order->order_total you could probably just change the code above to the following:

  $data['Amount'] = ($order->order_total * 100); // Auriga wants the amount in ören/cents

Also, I haven't tried this, but maybe you could use: uc_order_get_total($order) - it also seems to return the correct amount.