Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mambose opened this issue Nov 24, 2021 · 2 comments
Open

Comments

@mambose
Copy link
Contributor

mambose commented Nov 24, 2021

$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())),
@timeverts
Copy link
Contributor

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

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

@timeverts
Copy link
Contributor

@barryvdh, any movement on this bug fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants