Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: bojanz at Centarro for Adapt 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 CreditAttribution: mitrpaka as a volunteer commentedPR: https://github.com/drupalcommerce/commerce/pull/767
Comment #4
bojanz CreditAttribution: bojanz at Centarro 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 CreditAttribution: bojanz at Centarro commentedI'll address the points above.
Comment #7
bojanz CreditAttribution: bojanz at Centarro commentedDone.