src/_ideas/Billing.php 1 location
|
@@ 40-45 (lines=6) @@
|
37 |
|
// $plans = $planRepo->findAll($spec); |
38 |
|
$plans = $planRepo->findByOrder($order); |
39 |
|
$charges = []; |
40 |
|
foreach ($order->getActions() as $actionKey => $action) { |
41 |
|
if (empty($plans[$actionKey])) { |
42 |
|
throw new FailedFindPlan(); |
43 |
|
} |
44 |
|
$charges[$actionKey] = $plans[$actionKey]->calculateCharges($action); |
45 |
|
} |
46 |
|
|
47 |
|
return $charges; |
48 |
|
} |
src/order/Calculator.php 1 location
|
@@ 49-57 (lines=9) @@
|
46 |
|
{ |
47 |
|
$plans = $this->findPlans($order); |
48 |
|
$charges = []; |
49 |
|
foreach ($order->getActions() as $actionKey => $action) { |
50 |
|
if (empty($plans[$actionKey])) { |
51 |
|
/* XXX not sure... think more |
52 |
|
throw new FailedFindPlan(); |
53 |
|
*/ |
54 |
|
continue; |
55 |
|
} |
56 |
|
$charges[$actionKey] = $plans[$actionKey]->calculateCharges($action); |
57 |
|
} |
58 |
|
|
59 |
|
return $charges; |
60 |
|
} |