Wrong base for recalculation of payment fees after admin actions
| Project: | Ubercart Payment Method Adjustments |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (to be ported) |
Jump to:
problem:
- base for calculation of percentaged payment fees are cart-items
- calculation fee and line item storage in function uc_pma_order() works fine during checkout process, since cart items are identical to line-items of order to save
- if any order is edited by an admin afterwards, there is a mismatch between cart items and line-items of order to save (usually the cart of the admin is empty ;-) )
- by updating line item in database for payment fee, the original correct entry gets lost
porposal:
1. extend function _payment_method_adjustment($method_id) to
function _payment_method_adjustment($method_id, $order=NULL){
..if (is_object($order) && isset($order->products)){
....$items = $order->products;
..}else{
....$items = uc_cart_get_contents();
..}
.....
}
2. adjust only the function call in uc_pma_order() to
$adjustment = _payment_method_adjustment($arg1->payment_method, $arg1);
-> should solve the problem so far

#1
This has been fixed in the Drupal 6 branch, but should probably be backported to Drupal 5 at some point.