Currently adjustment for applied tax have e.g. amount, sourceId and included information defined.
As many payment gateways expects detailed order information to be provided along with payment details, it would greatly help if tax adjustment had information about applied tax rate (% or 0.xx) in addition to amount and sourceId information.
Comments
Comment #2
bojanz commentedWe should add a $percentage and getPercentage() to the Adjustment class, have it populated by both taxes and promotions. Return NULL when unavailable.
Cause why not, and it will come useful in multiple places (such as suffixing VAT labels when there are different rates).
Comment #3
mitrpaka commentedPR: https://github.com/drupalcommerce/commerce/pull/767
Comment #4
bojanz commentedThanks!
Here's a review:
1) We are missing a line in Order::collectAdjustments() that transfers the percentage, otherwise it's lost.
2) We're also missing test coverage to confirm that commerce_tax sets the percentage as expected.
3) We should also add validation to Adjustment::__construct() to ensure we got a valid percentage value, when available.
4) PercentageOffBase::getAmount() should be renamed to PercentageOffBase::getPercentage() to match the code here.
Comment #5
bojanz commentedI'll address the points above.
Comment #7
bojanz commentedDone.