thephpleague / omnipay-braintree

Braintree Driver for Omnipay Gateway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`$item->getPrice()` being used as a total amount when it is a unit amount

mambose opened this issue · comments

$item->getPrice() returns the item's unit price and not the line item's total amount. This is creating inaccurate line item data when viewing transactions in Braintree.

'totalAmount' => abs($item->getPrice()),
'unitAmount' => abs($unit_amount),

The code should look something like this:

'totalAmount' => abs(round($item->getQuantity() * $item->getPrice(), $this->getCurrencyDecimalPlaces())),
'unitAmount' => abs(round($item->getPrice(), $this->getCurrencyDecimalPlaces())),

@barryvdh, any chance we can get this fix rolled out (see pull request)?

It's a fairly critical fix for the line item code.

@barryvdh, any movement on this bug fix?