omnipay-braintree
omnipay-braintree copied to clipboard
`$item->getPrice()` being used as a total amount when it is a unit amount
$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.
https://github.com/thephpleague/omnipay-braintree/blob/fef291e3018515bdd6dcc447d6de5e24dda990e1/src/Message/AbstractRequest.php#L455-L456
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?